2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
archinfo,
|
|
|
|
buildPythonPackage,
|
2024-06-05 15:53:02 +00:00
|
|
|
cart,
|
2024-04-21 15:54:59 +00:00
|
|
|
cffi,
|
|
|
|
fetchFromGitHub,
|
|
|
|
minidump,
|
|
|
|
pefile,
|
|
|
|
pyelftools,
|
|
|
|
pynose,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyvex,
|
|
|
|
pyxbe,
|
|
|
|
setuptools,
|
|
|
|
sortedcontainers,
|
2021-04-22 02:08:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# The binaries are following the argr projects release cycle
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "9.2.108";
|
2021-04-22 02:08:21 +00:00
|
|
|
|
|
|
|
# Binary files from https://github.com/angr/binaries (only used for testing and only here)
|
|
|
|
binaries = fetchFromGitHub {
|
|
|
|
owner = "angr";
|
|
|
|
repo = "binaries";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-d3Hs3k7PmOZqvLoiHD9HctaEHHOafCefjUcKGBPIiHU=";
|
2021-04-22 02:08:21 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cle";
|
|
|
|
inherit version;
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
disabled = pythonOlder "3.11";
|
2021-04-22 02:08:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "angr";
|
2023-10-19 13:55:26 +00:00
|
|
|
repo = "cle";
|
2023-03-30 22:05:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-3zzTH6WKAavB/lkLBastOdeKegO8IyKRGN7k2vnX5WA=";
|
2021-04-22 02:08:21 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
|
|
|
archinfo
|
2024-06-05 15:53:02 +00:00
|
|
|
cart
|
2021-04-22 02:08:21 +00:00
|
|
|
cffi
|
|
|
|
minidump
|
|
|
|
pefile
|
|
|
|
pyelftools
|
|
|
|
pyvex
|
|
|
|
pyxbe
|
|
|
|
sortedcontainers
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
pynose
|
2021-04-22 02:08:21 +00:00
|
|
|
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"
|
2021-04-25 03:57:28 +00:00
|
|
|
"test_plt_full_relro"
|
2021-12-06 16:07:01 +00:00
|
|
|
# Test fails
|
|
|
|
"test_tls_pe_incorrect_tls_data_start"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test_x86"
|
|
|
|
"test_x86_64"
|
2022-04-27 09:35:20 +00:00
|
|
|
# The required parts is not present on Nix
|
|
|
|
"test_remote_file_map"
|
2021-04-22 02:08:21 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "cle" ];
|
2021-04-22 02:08:21 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python loader for many binary formats";
|
|
|
|
homepage = "https://github.com/angr/cle";
|
|
|
|
license = with licenses; [ bsd2 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|