1{
2 lib,
3 stdenv,
4 ailment,
5 archinfo,
6 buildPythonPackage,
7 cachetools,
8 capstone,
9 cffi,
10 claripy,
11 cle,
12 cppheaderparser,
13 dpkt,
14 fetchFromGitHub,
15 gitpython,
16 itanium-demangler,
17 mulpyplexer,
18 nampa,
19 networkx,
20 progressbar2,
21 protobuf,
22 psutil,
23 pycparser,
24 pyformlang,
25 pythonOlder,
26 pythonRelaxDepsHook,
27 pyvex,
28 rich,
29 rpyc,
30 setuptools,
31 sortedcontainers,
32 sqlalchemy,
33 sympy,
34 unicorn,
35 unique-log-filter,
36}:
37
38buildPythonPackage rec {
39 pname = "angr";
40 version = "9.2.102";
41 pyproject = true;
42
43 disabled = pythonOlder "3.11";
44
45 src = fetchFromGitHub {
46 owner = "angr";
47 repo = "angr";
48 rev = "refs/tags/v${version}";
49 hash = "sha256-NZO4aQQfp+P9nbVr+cFd5Z2Ziz9cYzuLUi6nVY+Czr0=";
50 };
51
52 pythonRelaxDeps = [ "capstone" ];
53
54 build-system = [
55 pythonRelaxDepsHook
56 setuptools
57 ];
58
59 dependencies = [
60 ailment
61 archinfo
62 cachetools
63 capstone
64 cffi
65 claripy
66 cle
67 cppheaderparser
68 dpkt
69 gitpython
70 itanium-demangler
71 mulpyplexer
72 nampa
73 networkx
74 progressbar2
75 protobuf
76 psutil
77 pycparser
78 pyformlang
79 pyvex
80 rich
81 rpyc
82 sortedcontainers
83 sqlalchemy
84 sympy
85 unicorn
86 unique-log-filter
87 ];
88
89 passthru.optional-dependencies = {
90 AngrDB = [ sqlalchemy ];
91 };
92
93 setupPyBuildFlags = lib.optionals stdenv.isLinux [
94 "--plat-name"
95 "linux"
96 ];
97
98 # Tests have additional requirements, e.g., pypcode and angr binaries
99 # cle is executing the tests with the angr binaries
100 doCheck = false;
101
102 pythonImportsCheck = [
103 "angr"
104 "claripy"
105 "cle"
106 "pyvex"
107 "archinfo"
108 ];
109
110 meta = with lib; {
111 description = "Powerful and user-friendly binary analysis platform";
112 homepage = "https://angr.io/";
113 license = with licenses; [ bsd2 ];
114 maintainers = with maintainers; [ fab ];
115 };
116}