2021-02-08 21:14:13 +00:00
|
|
|
{ lib
|
2021-02-24 22:50:38 +00:00
|
|
|
, stdenv
|
2021-02-08 21:14:13 +00:00
|
|
|
, archinfo
|
|
|
|
, bitstring
|
|
|
|
, buildPythonPackage
|
2021-04-06 15:26:47 +01:00
|
|
|
, cffi
|
|
|
|
, fetchPypi
|
2021-02-08 21:14:13 +00:00
|
|
|
, future
|
|
|
|
, pycparser
|
2022-01-18 20:42:55 +00:00
|
|
|
, pythonOlder
|
2021-02-08 21:14:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyvex";
|
2022-01-18 20:42:55 +00:00
|
|
|
version = "9.1.11508";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-02-08 21:14:13 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-18 20:42:55 +00:00
|
|
|
hash = "sha256-FNCAvag0ErVjzgXqiwDnX80WnjUdnWHtcLYuanlj0ME=";
|
2021-02-08 21:14:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
archinfo
|
|
|
|
bitstring
|
|
|
|
cffi
|
|
|
|
future
|
|
|
|
pycparser
|
|
|
|
];
|
|
|
|
|
2022-01-18 20:42:55 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace vex/Makefile-gcc \
|
|
|
|
--replace '/usr/bin/ar' 'ar'
|
|
|
|
'';
|
|
|
|
|
|
|
|
setupPyBuildFlags = lib.optionals stdenv.isLinux [
|
|
|
|
"--plat-name"
|
|
|
|
"linux"
|
|
|
|
];
|
|
|
|
|
2021-04-21 23:47:23 +01:00
|
|
|
preBuild = ''
|
|
|
|
export CC=${stdenv.cc.targetPrefix}cc
|
2022-01-18 20:42:55 +00:00
|
|
|
substituteInPlace pyvex_c/Makefile \
|
|
|
|
--replace 'AR=ar' 'AR=${stdenv.cc.targetPrefix}ar'
|
2021-04-06 15:26:47 +01:00
|
|
|
'';
|
|
|
|
|
2021-02-08 21:14:13 +00:00
|
|
|
# No tests are available on PyPI, GitHub release has tests
|
|
|
|
# Switch to GitHub release after all angr parts are present
|
|
|
|
doCheck = false;
|
2022-01-18 20:42:55 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyvex"
|
|
|
|
];
|
2021-02-08 21:14:13 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|