depot/third_party/nixpkgs/pkgs/development/python-modules/cle/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

93 lines
1.8 KiB
Nix

{
lib,
archinfo,
buildPythonPackage,
cart,
cffi,
fetchFromGitHub,
minidump,
pefile,
pyelftools,
pynose,
pytestCheckHook,
pythonOlder,
pyvex,
pyxbe,
setuptools,
sortedcontainers,
}:
let
# The binaries are following the argr projects release cycle
version = "9.2.107";
# Binary files from https://github.com/angr/binaries (only used for testing and only here)
binaries = fetchFromGitHub {
owner = "angr";
repo = "binaries";
rev = "refs/tags/v${version}";
hash = "sha256-7b3kjPoaJ9z1wdz125XsD0hj5FXj9DmUt8Hpqd/AjKs=";
};
in
buildPythonPackage rec {
pname = "cle";
inherit version;
pyproject = true;
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "angr";
repo = "cle";
rev = "refs/tags/v${version}";
hash = "sha256-0dfnp0sIxO4Ln20c57Wb9B0E987v+xhrX53yriC+Qy0=";
};
build-system = [ setuptools ];
dependencies = [
archinfo
cart
cffi
minidump
pefile
pyelftools
pyvex
pyxbe
sortedcontainers
];
nativeCheckInputs = [
pynose
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"
"test_x86"
"test_x86_64"
# 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 ];
};
}