2018-10-15 15:53:02 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
2019-10-16 07:59:47 +00:00
|
|
|
, setuptools
|
2020-01-02 20:06:50 +00:00
|
|
|
, capstone
|
2018-10-15 15:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "capstone";
|
2020-01-02 20:06:50 +00:00
|
|
|
version = stdenv.lib.getVersion capstone;
|
2019-07-16 17:15:39 +00:00
|
|
|
|
2020-01-02 20:06:50 +00:00
|
|
|
src = capstone.src;
|
|
|
|
sourceRoot = "${capstone.name}/bindings/python";
|
2018-10-15 15:53:02 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2020-01-02 20:06:50 +00:00
|
|
|
ln -s ${capstone}/lib/libcapstone${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/
|
|
|
|
ln -s ${capstone}/lib/libcapstone.a prebuilt/
|
2018-10-15 15:53:02 +00:00
|
|
|
'';
|
|
|
|
|
2020-01-02 20:06:50 +00:00
|
|
|
propagatedBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
mv capstone capstone.hidden
|
|
|
|
patchShebangs test_*
|
|
|
|
make check
|
2018-10-15 15:53:02 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "http://www.capstone-engine.org/";
|
|
|
|
license = licenses.bsdOriginal;
|
2020-01-02 20:06:50 +00:00
|
|
|
description = "Python bindings for Capstone disassembly engine";
|
|
|
|
maintainers = with maintainers; [ bennofs ris ];
|
2018-10-15 15:53:02 +00:00
|
|
|
};
|
|
|
|
}
|