2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
bitstring,
|
|
|
|
buildPythonPackage,
|
|
|
|
cffi,
|
|
|
|
fetchPypi,
|
|
|
|
pycparser,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2021-02-13 14:23:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyvex";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "9.2.107";
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
disabled = pythonOlder "3.11";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-e8DZgHCVUcAEgo9IR7Ut/v580//oeH9l1MwGSe/RThw=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2021-02-13 14:23:35 +00:00
|
|
|
bitstring
|
|
|
|
cffi
|
|
|
|
pycparser
|
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace vex/Makefile-gcc \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail '/usr/bin/ar' 'ar'
|
2022-01-19 23:45:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
setupPyBuildFlags = lib.optionals stdenv.isLinux [
|
|
|
|
"--plat-name"
|
|
|
|
"linux"
|
|
|
|
];
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
preBuild = ''
|
|
|
|
export CC=${stdenv.cc.targetPrefix}cc
|
2022-01-19 23:45:15 +00:00
|
|
|
substituteInPlace pyvex_c/Makefile \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail '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;
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pyvex" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python interface to libVEX and VEX IR";
|
|
|
|
homepage = "https://github.com/angr/pyvex";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
bsd2
|
|
|
|
gpl3Plus
|
|
|
|
lgpl3Plus
|
|
|
|
];
|
2021-02-13 14:23:35 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|