2021-04-22 17:34:16 +02:00
|
|
|
{ lib
|
2018-10-15 17:53:02 +02:00
|
|
|
, buildPythonPackage
|
2021-01-22 23:13:13 +01:00
|
|
|
, capstone
|
2021-04-22 17:34:16 +02:00
|
|
|
, stdenv
|
2018-10-15 17:53:02 +02:00
|
|
|
, fetchpatch
|
2021-01-22 23:13:13 +01:00
|
|
|
, fetchPypi
|
2019-10-16 09:59:47 +02:00
|
|
|
, setuptools
|
2018-10-15 17:53:02 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "capstone";
|
2021-01-22 23:13:13 +01:00
|
|
|
version = lib.getVersion capstone;
|
2019-07-16 19:15:39 +02:00
|
|
|
|
2020-01-02 21:06:50 +01:00
|
|
|
src = capstone.src;
|
|
|
|
sourceRoot = "${capstone.name}/bindings/python";
|
2018-10-15 17:53:02 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
2020-01-02 21:06:50 +01:00
|
|
|
ln -s ${capstone}/lib/libcapstone${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
|
|
|
|
ln -s ${capstone}/lib/libcapstone.a prebuilt/
|
2021-01-22 23:13:13 +01:00
|
|
|
substituteInPlace setup.py --replace manylinux1 manylinux2014
|
2018-10-15 17:53:02 +02:00
|
|
|
'';
|
|
|
|
|
2020-01-02 21:06:50 +01:00
|
|
|
propagatedBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
mv capstone capstone.hidden
|
|
|
|
patchShebangs test_*
|
|
|
|
make check
|
2018-10-15 17:53:02 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-10-15 17:53:02 +02:00
|
|
|
homepage = "http://www.capstone-engine.org/";
|
|
|
|
license = licenses.bsdOriginal;
|
2020-01-02 21:06:50 +01:00
|
|
|
description = "Python bindings for Capstone disassembly engine";
|
|
|
|
maintainers = with maintainers; [ bennofs ris ];
|
2021-04-22 17:34:16 +02:00
|
|
|
# creates a manylinux2014-x86_64 wheel
|
|
|
|
broken = stdenv.isAarch64;
|
2018-10-15 17:53:02 +02:00
|
|
|
};
|
|
|
|
}
|