My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nomicon/pkgs/development/python-modules/pyvex/default.nix

52 lines
1.1 KiB

{ lib
, stdenv
, archinfo
, bitstring
, buildPythonPackage
, cffi
, fetchPypi
, future
, pycparser
}:
buildPythonPackage rec {
pname = "pyvex";
version = "9.1.10913";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-EUgCyjD5ia5KQMvZWVAsXeKRjmSVE7tRRYH5u/Ozug0=";
};
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 ];
};
}