mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 21:53:32 +00:00
50 lines
1022 B
Nix
50 lines
1022 B
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, setuptools
|
|
, unicorn-emu
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "unicorn";
|
|
version = lib.getVersion unicorn-emu;
|
|
format = "setuptools";
|
|
|
|
src = unicorn-emu.src;
|
|
|
|
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 ];
|
|
};
|
|
}
|