depot/third_party/nixpkgs/pkgs/development/python-modules/pyvex/default.nix
Default email ce641f4048 Project import generated by Copybara.
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
2021-12-06 17:07:01 +01:00

51 lines
1.1 KiB
Nix

{ lib
, stdenv
, archinfo
, bitstring
, buildPythonPackage
, cffi
, fetchPypi
, future
, pycparser
}:
buildPythonPackage rec {
pname = "pyvex";
version = "9.0.10689";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-BP0yRsp0I6QNN6lCpF6MwBw/BXTXCsNbmzfpKNMS0fQ=";
};
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace vex/Makefile-gcc --replace '/usr/bin/ar' 'ar'
'';
setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];
propagatedBuildInputs = [
archinfo
bitstring
cffi
future
pycparser
];
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 ];
};
}