1{ lib
2, stdenv
3, archinfo
4, bitstring
5, buildPythonPackage
6, cffi
7, fetchPypi
8, future
9, pycparser
10}:
11
12buildPythonPackage rec {
13 pname = "pyvex";
14 version = "9.0.10576";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "sha256-pOQZXymIuffUfShAUrXqlxwWCIRKZpkMZcJS1fad2bs=";
19 };
20
21 postPatch = lib.optionalString stdenv.isDarwin ''
22 substituteInPlace vex/Makefile-gcc --replace '/usr/bin/ar' 'ar'
23 '';
24
25 propagatedBuildInputs = [
26 archinfo
27 bitstring
28 cffi
29 future
30 pycparser
31 ];
32
33 preBuild = ''
34 export CC=${stdenv.cc.targetPrefix}cc
35 substituteInPlace pyvex_c/Makefile --replace 'AR=ar' 'AR=${stdenv.cc.targetPrefix}ar'
36 '';
37
38 # No tests are available on PyPI, GitHub release has tests
39 # Switch to GitHub release after all angr parts are present
40 doCheck = false;
41 pythonImportsCheck = [ "pyvex" ];
42
43 meta = with lib; {
44 description = "Python interface to libVEX and VEX IR";
45 homepage = "https://github.com/angr/pyvex";
46 license = with licenses; [ bsd2 gpl3Plus lgpl3Plus ];
47 maintainers = with maintainers; [ fab ];
48 # ERROR: pyvex-X-py3-none-manylinux1_aarch64.whl is not a supported wheel on this platform.
49 broken = stdenv.isAarch64;
50 };
51}