8 buildPythonPackage rec {
10 version = lib.getVersion unicorn-emu;
11 format = "setuptools";
13 src = unicorn-emu.src;
15 sourceRoot = "${src.name}/bindings/python";
18 ln -s ${unicorn-emu}/lib/libunicorn.* prebuilt/
21 # needed on non-x86 linux
22 setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ]
23 # aarch64 only available from MacOS SDK 11 onwards, so fix the version tag.
24 # otherwise, bdist_wheel may detect "macosx_10_6_arm64" which doesn't make sense.
25 ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "--plat-name" "macosx_11_0" ];
27 propagatedBuildInputs = [
34 mv unicorn unicorn.hidden
35 patchShebangs sample_*.py shellcode.py
41 pythonImportsCheck = [
46 description = "Python bindings for Unicorn CPU emulator engine";
47 homepage = "https://www.unicorn-engine.org/";
48 license = licenses.gpl2Plus;
49 maintainers = with maintainers; [ bennofs ris ];