Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 58 lines 1.2 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 setuptools, 6 unicorn, 7}: 8 9buildPythonPackage rec { 10 pname = "unicorn"; 11 version = lib.getVersion unicorn; 12 pyproject = true; 13 14 src = unicorn.src; 15 16 sourceRoot = "${src.name}/bindings/python"; 17 18 prePatch = '' 19 ln -s ${unicorn}/lib/libunicorn.* prebuilt/ 20 ''; 21 22 # Needed on non-x86 linux 23 setupPyBuildFlags = 24 lib.optionals stdenv.hostPlatform.isLinux [ 25 "--plat-name" 26 "linux" 27 ] 28 # aarch64 only available from MacOS SDK 11 onwards, so fix the version tag. 29 # otherwise, bdist_wheel may detect "macosx_10_6_arm64" which doesn't make sense. 30 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ 31 "--plat-name" 32 "macosx_11_0" 33 ]; 34 35 build-system = [ setuptools ]; 36 37 checkPhase = '' 38 runHook preCheck 39 40 mv unicorn unicorn.hidden 41 patchShebangs sample_*.py shellcode.py 42 sh -e sample_all.sh 43 44 runHook postCheck 45 ''; 46 47 pythonImportsCheck = [ "unicorn" ]; 48 49 meta = with lib; { 50 description = "Python bindings for Unicorn CPU emulator engine"; 51 homepage = "https://www.unicorn-engine.org/"; 52 license = licenses.gpl2Plus; 53 maintainers = with maintainers; [ 54 bennofs 55 ris 56 ]; 57 }; 58}