2021-04-25 03:57:28 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-02-16 17:04:54 +00:00
|
|
|
, capstone
|
2021-04-25 03:57:28 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, setuptools
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "capstone";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = lib.getVersion capstone;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = capstone.src;
|
2022-01-07 04:07:37 +00:00
|
|
|
sourceRoot = "source/bindings/python";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
ln -s ${capstone}/lib/libcapstone${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
|
|
|
|
ln -s ${capstone}/lib/libcapstone.a prebuilt/
|
2021-02-16 17:04:54 +00:00
|
|
|
substituteInPlace setup.py --replace manylinux1 manylinux2014
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
mv capstone capstone.hidden
|
|
|
|
patchShebangs test_*
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.capstone-engine.org/";
|
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
description = "Python bindings for Capstone disassembly engine";
|
|
|
|
maintainers = with maintainers; [ bennofs ris ];
|
|
|
|
};
|
|
|
|
}
|