depot/third_party/nixpkgs/pkgs/development/python-modules/cle/default.nix
Default email 889482aab3 Project import generated by Copybara.
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
2022-06-26 12:26:21 +02:00

86 lines
1.7 KiB
Nix

{ lib
, buildPythonPackage
, cffi
, fetchFromGitHub
, minidump
, nose
, pefile
, pyelftools
, pytestCheckHook
, pythonOlder
, pyvex
, pyxbe
, sortedcontainers
}:
let
# The binaries are following the argr projects release cycle
version = "9.2.7";
# Binary files from https://github.com/angr/binaries (only used for testing and only here)
binaries = fetchFromGitHub {
owner = "angr";
repo = "binaries";
rev = "v${version}";
hash = "sha256-LpYi5Ty6OBcW0zokCliMDhujJ7tPPl1XdPs5ad1tv5s=";
};
in
buildPythonPackage rec {
pname = "cle";
inherit version;
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "angr";
repo = pname;
rev = "v${version}";
hash = "sha256-IQLtkS4LNyyEOwInd9A3pHGtj80yXARXcQKA3FonPUE=";
};
propagatedBuildInputs = [
cffi
minidump
pefile
pyelftools
pyvex
pyxbe
sortedcontainers
];
checkInputs = [
nose
pytestCheckHook
];
# Place test binaries in the right location (location is hard-coded in the tests)
preCheck = ''
export HOME=$TMPDIR
cp -r ${binaries} $HOME/binaries
'';
disabledTests = [
# PPC tests seems to fails
"test_ppc_rel24_relocation"
"test_ppc_addr16_ha_relocation"
"test_ppc_addr16_lo_relocation"
"test_plt_full_relro"
# Test fails
"test_tls_pe_incorrect_tls_data_start"
# The required parts is not present on Nix
"test_remote_file_map"
];
pythonImportsCheck = [
"cle"
];
meta = with lib; {
description = "Python loader for many binary formats";
homepage = "https://github.com/angr/cle";
license = with licenses; [ bsd2 ];
maintainers = with maintainers; [ fab ];
};
}