1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-21 08:59:20 +03:00
nixpkgs/pkgs/development/python-modules/unicorn/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1,022 B
Nix
Raw Normal View History

{ lib
, stdenv
, buildPythonPackage
, setuptools
, unicorn-emu
}:
buildPythonPackage rec {
pname = "unicorn";
version = lib.getVersion unicorn-emu;
format = "setuptools";
src = unicorn-emu.src;
2020-10-29 19:22:04 +01:00
sourceRoot = "source/bindings/python";
prePatch = ''
ln -s ${unicorn-emu}/lib/libunicorn${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
ln -s ${unicorn-emu}/lib/libunicorn.a prebuilt/
'';
# needed on non-x86 linux
setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];
propagatedBuildInputs = [
setuptools
];
checkPhase = ''
runHook preCheck
mv unicorn unicorn.hidden
patchShebangs sample_*.py shellcode.py
sh -e sample_all.sh
runHook postCheck
'';
pythonImportsCheck = [
"unicorn"
];
meta = with lib; {
description = "Python bindings for Unicorn CPU emulator engine";
homepage = "https://www.unicorn-engine.org/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ bennofs ris ];
};
}