1{ lib
2, buildPythonPackage
3, cffi
4, fetchFromGitHub
5, minidump
6, nose
7, pefile
8, pyelftools
9, pytestCheckHook
10, pythonOlder
11, pyvex
12, pyxbe
13, sortedcontainers
14}:
15
16let
17 # The binaries are following the argr projects release cycle
18 version = "9.0.10576";
19
20 # Binary files from https://github.com/angr/binaries (only used for testing and only here)
21 binaries = fetchFromGitHub {
22 owner = "angr";
23 repo = "binaries";
24 rev = "v${version}";
25 sha256 = "1qlrxfj1n34xvwkac6mbcc7zmixxbp34fj7lkf0fvp7zcz1rpla1";
26 };
27
28in
29buildPythonPackage rec {
30 pname = "cle";
31 inherit version;
32 disabled = pythonOlder "3.6";
33
34 src = fetchFromGitHub {
35 owner = "angr";
36 repo = pname;
37 rev = "v${version}";
38 sha256 = "sha256-ftaFISU37GcCFTybxV31PwUl2vrbKVm/S00Qo+pUxgo=";
39 };
40
41 propagatedBuildInputs = [
42 cffi
43 minidump
44 pefile
45 pyelftools
46 pyvex
47 pyxbe
48 sortedcontainers
49 ];
50
51 checkInputs = [
52 nose
53 pytestCheckHook
54 ];
55
56 # Place test binaries in the right location (location is hard-coded in the tests)
57 preCheck = ''
58 export HOME=$TMPDIR
59 cp -r ${binaries} $HOME/binaries
60 '';
61
62 disabledTests = [
63 # PPC tests seems to fails
64 "test_ppc_rel24_relocation"
65 "test_ppc_addr16_ha_relocation"
66 "test_ppc_addr16_lo_relocation"
67 # Binary not found, seems to be missing in the current binaries release
68 "test_plt_full_relro"
69 # Test fails
70 "test_tls_pe_incorrect_tls_data_start"
71 ];
72
73 pythonImportsCheck = [
74 "cle"
75 ];
76
77 meta = with lib; {
78 description = "Python loader for many binary formats";
79 homepage = "https://github.com/angr/cle";
80 license = with licenses; [ bsd2 ];
81 maintainers = with maintainers; [ fab ];
82 };
83}