ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / manticore / default.nix
blobc645a070e4b1dd5af79bfd262d71f5f8eeaa5758
1 { lib
2 , buildPythonPackage
3 , capstone
4 , crytic-compile
5 , fetchFromGitHub
6 , intervaltree
7 , ply
8 , prettytable
9 , protobuf
10 , pyelftools
11 , pyevmasm
12 , pysha3
13 , pytestCheckHook
14 , pythonOlder
15 , pyyaml
16 , rlp
17 , stdenv
18 , unicorn
19 , wasm
20 , yices
21 , z3
24 buildPythonPackage rec {
25   pname = "manticore";
26   version = "0.3.7";
27   format = "setuptools";
29   disabled = pythonOlder "3.7";
31   src = fetchFromGitHub {
32     owner = "trailofbits";
33     repo = "manticore";
34     rev = version;
35     hash = "sha256-+17VBfAtkZZIi3SF5Num1Uqg3WjIpgbz3Jx65rD5zkM=";
36   };
38   propagatedBuildInputs = [
39     crytic-compile
40     intervaltree
41     ply
42     prettytable
43     protobuf
44     pyevmasm
45     pysha3
46     pyyaml
47     rlp
48     wasm
49   ] ++ lib.optionals (stdenv.isLinux) [
50     capstone
51     pyelftools
52     unicorn
53   ];
55   postPatch = ''
56     # Python API is not used in the code, only z3 from PATH
57     substituteInPlace setup.py \
58       --replace "z3-solver" "" \
59       --replace "crytic-compile==0.2.2" "crytic-compile>=0.2.2"
60   '';
62   checkInputs = [
63     pytestCheckHook
64   ];
66   preCheck = ''
67     export PATH=${yices}/bin:${z3}/bin:$PATH
68   '';
70   disabledTestPaths = [
71     "tests/ethereum" # Enable when solc works again
72     "tests/ethereum_bench"
73   ] ++ lib.optionals (!stdenv.isLinux) [
74     "tests/native"
75     "tests/other/test_locking.py"
76     "tests/other/test_state_introspection.py"
77   ];
79   disabledTests = [
80     # Failing tests
81     "test_chmod"
82     "test_timeout"
83     "test_wasm_main"
84     # Slow tests
85     "testmprotectFailSymbReading"
86     "test_ConstraintsForking"
87     "test_resume"
88     "test_symbolic"
89     "test_symbolic_syscall_arg"
90     "test_state_merging"
91     "test_decree"
92     "test_register_comparison"
93     "test_arguments_assertions_armv7"
94     "test_integration_basic_stdout"
95     "test_fclose_linux_amd64"
96     "test_fileio_linux_amd64"
97     "test_arguments_assertions_amd64"
98     "test_ioctl_bogus"
99     "test_ioctl_socket"
100     "test_brk_regression"
101     "test_basic_arm"
102     "test_logger_verbosity"
103     "test_profiling_data"
104     "test_integration_basic_stdin"
105     "test_getchar"
106     "test_ccmp_reg"
107     "test_ld1_mlt_structs"
108     "test_ccmp_imm"
109     "test_try_to_allocate_greater_than_last_space_memory_page_12"
110     "test_not_enough_memory_page_12"
111     "test_PCMPISTRI_30_symbolic"
112     "test_ld1_mlt_structs"
113     "test_time"
114     "test_implicit_call"
115     "test_trace"
116     "test_plugin"
117     # Tests are failing with latest unicorn
118     "Aarch64UnicornInstructions"
119     "test_integration_resume"
120   ];
122   pythonImportsCheck = [
123     "manticore"
124   ];
126   meta = with lib; {
127     # m.c.manticore:WARNING: Manticore is only supported on Linux. Proceed at your own risk!
128     broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
129     description = "Symbolic execution tool for analysis of smart contracts and binaries";
130     homepage = "https://github.com/trailofbits/manticore";
131     changelog = "https://github.com/trailofbits/manticore/releases/tag/${version}";
132     license = licenses.agpl3Only;
133     platforms = platforms.unix;
134     maintainers = with maintainers; [ arturcygan ];
135   };