b450903751
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, archinfo
|
|
, bitstring
|
|
, buildPythonPackage
|
|
, cffi
|
|
, fetchPypi
|
|
, future
|
|
, pycparser
|
|
, pythonOlder
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyvex";
|
|
version = "9.2.15";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-Yik1RTz4SQBFJxgPzp7LnPHV4EMbxGEhD2fBVcKJC7c=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
archinfo
|
|
bitstring
|
|
cffi
|
|
future
|
|
pycparser
|
|
];
|
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
substituteInPlace vex/Makefile-gcc \
|
|
--replace '/usr/bin/ar' 'ar'
|
|
'';
|
|
|
|
setupPyBuildFlags = lib.optionals stdenv.isLinux [
|
|
"--plat-name"
|
|
"linux"
|
|
];
|
|
|
|
preBuild = ''
|
|
export CC=${stdenv.cc.targetPrefix}cc
|
|
substituteInPlace pyvex_c/Makefile \
|
|
--replace 'AR=ar' 'AR=${stdenv.cc.targetPrefix}ar'
|
|
'';
|
|
|
|
# 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 ];
|
|
};
|
|
}
|