2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
2021-03-09 03:18:52 +00:00
|
|
|
, stdenv
|
2021-02-13 14:23:35 +00:00
|
|
|
, archinfo
|
|
|
|
, bitstring
|
|
|
|
, buildPythonPackage
|
2021-04-22 02:08:21 +00:00
|
|
|
, cffi
|
|
|
|
, fetchPypi
|
2021-02-13 14:23:35 +00:00
|
|
|
, future
|
|
|
|
, pycparser
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyvex";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "9.0.10689";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-BP0yRsp0I6QNN6lCpF6MwBw/BXTXCsNbmzfpKNMS0fQ=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace vex/Makefile-gcc --replace '/usr/bin/ar' 'ar'
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
archinfo
|
|
|
|
bitstring
|
|
|
|
cffi
|
|
|
|
future
|
|
|
|
pycparser
|
|
|
|
];
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
preBuild = ''
|
|
|
|
export CC=${stdenv.cc.targetPrefix}cc
|
2021-05-20 23:08:51 +00:00
|
|
|
substituteInPlace pyvex_c/Makefile --replace 'AR=ar' 'AR=${stdenv.cc.targetPrefix}ar'
|
2021-04-22 02:08:21 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
# No tests are available on PyPI, GitHub release has tests
|
|
|
|
# Switch to GitHub release after all angr parts are present
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "pyvex" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python interface to libVEX and VEX IR";
|
|
|
|
homepage = "https://github.com/angr/pyvex";
|
|
|
|
license = with licenses; [ bsd2 gpl3Plus lgpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|