nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, archinfo
4, bitstring
5, buildPythonPackage
6, cffi
7, fetchPypi
8, future
9, pycparser
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "pyvex";
15 version = "9.2.4";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-r+dmf5qIjiN5vmdzBmPORnPWPrjLKGks+OAdZXdAbOc=";
23 };
24
25 propagatedBuildInputs = [
26 archinfo
27 bitstring
28 cffi
29 future
30 pycparser
31 ];
32
33 postPatch = lib.optionalString stdenv.isDarwin ''
34 substituteInPlace vex/Makefile-gcc \
35 --replace '/usr/bin/ar' 'ar'
36 '';
37
38 setupPyBuildFlags = lib.optionals stdenv.isLinux [
39 "--plat-name"
40 "linux"
41 ];
42
43 preBuild = ''
44 export CC=${stdenv.cc.targetPrefix}cc
45 substituteInPlace pyvex_c/Makefile \
46 --replace 'AR=ar' 'AR=${stdenv.cc.targetPrefix}ar'
47 '';
48
49 # No tests are available on PyPI, GitHub release has tests
50 # Switch to GitHub release after all angr parts are present
51 doCheck = false;
52
53 pythonImportsCheck = [
54 "pyvex"
55 ];
56
57 meta = with lib; {
58 description = "Python interface to libVEX and VEX IR";
59 homepage = "https://github.com/angr/pyvex";
60 license = with licenses; [ bsd2 gpl3Plus lgpl3Plus ];
61 maintainers = with maintainers; [ fab ];
62 };
63}