git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #112434 from fabaff/pyxbe
commit4216cf5aee04260b8433cc8bd6eecaee8ed1e687 authorSandro <sandro.jaeckel@gmail.com> dateMon 19 Apr 2021, 21:17 (6 years ago) parent0db38eab2ca9d1
8 files changed+227−10
pkgs/development/python-modules/ailment/default.nix+2−2 pkgs/development/python-modules/angr/default.nix+93 pkgs/development/python-modules/archinfo/default.nix+2−2 pkgs/development/python-modules/claripy/default.nix+2−2 pkgs/development/python-modules/cle/default.nix+77 pkgs/development/python-modules/pyvex/default.nix+9−4 pkgs/development/python-modules/pyxbe/default.nix+36 pkgs/top-level/python-packages.nix+6
pkgs/development/python-modules/ailment/default.nix+2−2
@@ -7,14 +7,14 @@
77
88buildPythonPackage rec {
99 pname = "ailment";
10− version = "9.0.5903";
10+ version = "9.0.6281";
1111 disabled = pythonOlder "3.6";
1212
1313 src = fetchFromGitHub {
1414 owner = "angr";
1515 repo = pname;
1616 rev = "v${version}";
17− sha256 = "sha256-75Ul9JfMFYv3AfBlgmer6IDyfgOAS4AdXexznoxi35Y=";
17+ sha256 = "sha256-IFUGtTO+DY8FIxLgvmwM/y/RQr42T9sABPpnJMILkqg=";
1818 };
1919
2020 propagatedBuildInputs = [ pyvex ];
pkgs/development/python-modules/angr/default.nixnew file+93
@@ -0,0 +1,93 @@
1+{ lib
2+, ailment
3+, archinfo
4+, buildPythonPackage
5+, cachetools
6+, capstone
7+, cffi
8+, claripy
9+, cle
10+, cppheaderparser
11+, dpkt
12+, fetchFromGitHub
13+, GitPython
14+, itanium_demangler
15+, mulpyplexer
16+, networkx
17+, progressbar2
18+, protobuf
19+, psutil
20+, pycparser
21+, pkgs
22+, pythonOlder
23+, pyvex
24+, sqlalchemy
25+, rpyc
26+, sortedcontainers
27+, unicorn
28+}:
29+
30+let
31+ # Only the pinned release in setup.py works properly
32+ unicorn' = unicorn.overridePythonAttrs (old: rec {
33+ pname = "unicorn";
34+ version = "1.0.2-rc4";
35+ src = fetchFromGitHub {
36+ owner = "unicorn-engine";
37+ repo = pname;
38+ rev = version;
39+ sha256 = "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy";
40+ };
41+ });
42+in
43+
44+buildPythonPackage rec {
45+ pname = "angr";
46+ version = "9.0.6281";
47+ disabled = pythonOlder "3.6";
48+
49+ src = fetchFromGitHub {
50+ owner = pname;
51+ repo = pname;
52+ rev = "v${version}";
53+ sha256 = "10i4qdk8f342gzxiwy0pjdc35lc4q5ab7l5q420ca61cgdvxkk4r";
54+ };
55+
56+ propagatedBuildInputs = [
57+ ailment
58+ archinfo
59+ cachetools
60+ capstone
61+ cffi
62+ claripy
63+ cle
64+ cppheaderparser
65+ dpkt
66+ GitPython
67+ itanium_demangler
68+ mulpyplexer
69+ networkx
70+ progressbar2
71+ protobuf
72+ psutil
73+ sqlalchemy
74+ pycparser
75+ pyvex
76+ sqlalchemy
77+ rpyc
78+ sortedcontainers
79+ unicorn'
80+ ];
81+
82+ # Tests have additional requirements, e.g., pypcode and angr binaries
83+ # cle is executing the tests with the angr binaries
84+ doCheck = false;
85+ pythonImportsCheck = [ "angr" ];
86+
87+ meta = with lib; {
88+ description = "Powerful and user-friendly binary analysis platform";
89+ homepage = "https://angr.io/";
90+ license = with licenses; [ bsd2 ];
91+ maintainers = with maintainers; [ fab ];
92+ };
93+}
pkgs/development/python-modules/archinfo/default.nix+2−2
@@ -7,13 +7,13 @@
77
88buildPythonPackage rec {
99 pname = "archinfo";
10− version = "9.0.5903";
10+ version = "9.0.6281";
1111
1212 src = fetchFromGitHub {
1313 owner = "angr";
1414 repo = pname;
1515 rev = "v${version}";
16− sha256 = "sha256-4e+ZGIt/ouZj5rsmaVxUrz8gAq4Yq2+Qx4jdOojB4Sw=";
16+ sha256 = "sha256-ZO2P53RdR3cYhDbtrdGJnadFZgKkBdDi5gR/CB7YTpI=";
1717 };
1818
1919 checkInputs = [
pkgs/development/python-modules/claripy/default.nix+2−2
@@ -13,14 +13,14 @@
1313
1414buildPythonPackage rec {
1515 pname = "claripy";
16− version = "9.0.5903";
16+ version = "9.0.6281";
1717 disabled = pythonOlder "3.6";
1818
1919 src = fetchFromGitHub {
2020 owner = "angr";
2121 repo = pname;
2222 rev = "v${version}";
23− sha256 = "sha256-NIKWUx1VT5TjnuqppuT6VzwNRwcBLc0xI5k3F2Nmj8A=";
23+ sha256 = "sha256-gvo8I6LQRAEUa7QiV5Sugrt+e2SmGkkKfsGn/IKz+Mk=";
2424 };
2525
2626 # Use upstream z3 implementation
pkgs/development/python-modules/cle/default.nixnew file+77
@@ -0,0 +1,77 @@
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+
16+let
17+ # The binaries are following the argr projects release cycle
18+ version = "9.0.6281";
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+
28+in
29+buildPythonPackage 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 = "0f2zc02dljmgp6ny6ja6917j08kqhwckncan860dq4xv93g61rmg";
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+ ];
68+
69+ pythonImportsCheck = [ "cle" ];
70+
71+ meta = with lib; {
72+ description = "Python loader for many binary formats";
73+ homepage = "https://github.com/angr/cle";
74+ license = with licenses; [ bsd2 ];
75+ maintainers = with maintainers; [ fab ];
76+ };
77+}
pkgs/development/python-modules/pyvex/default.nix+9−4
@@ -2,20 +2,20 @@
22, stdenv
33, archinfo
44, bitstring
5−, fetchPypi
6−, cffi
75, buildPythonPackage
6+, cffi
7+, fetchPypi
88, future
99, pycparser
1010}:
1111
1212buildPythonPackage rec {
1313 pname = "pyvex";
14− version = "9.0.5903";
14+ version = "9.0.6281";
1515
1616 src = fetchPypi {
1717 inherit pname version;
18− sha256 = "sha256-qhLlRlmb48zhjX2u9w6TVVv2gb0E9kSapabiv+u4J2s=";
18+ sha256 = "sha256-E8BYCzV71qVNRzWCCI2yTVU88JVMA08eqnIO8OtbNlM=";
1919 };
2020
2121 propagatedBuildInputs = [
@@ -26,6 +26,11 @@ buildPythonPackage rec {
2626 pycparser
2727 ];
2828
29+ postPatch = ''
30+ substituteInPlace pyvex_c/Makefile \
31+ --replace "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc"
32+ '';
33+
2934 # No tests are available on PyPI, GitHub release has tests
3035 # Switch to GitHub release after all angr parts are present
3136 doCheck = false;
pkgs/development/python-modules/pyxbe/default.nixnew file+36
@@ -0,0 +1,36 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestCheckHook
5+}:
6+
7+buildPythonPackage rec {
8+ pname = "pyxbe";
9+ version = "unstable-2021-01-10";
10+
11+ src = fetchFromGitHub {
12+ owner = "mborgerson";
13+ repo = pname;
14+ rev = "a7ae1bb21b02a57783831eb080c1edbafaad1d5d";
15+ sha256 = "1cp9a5f41z8j7bzip6nhka8qnxs12v75cdf80sk2nzgf1k15wi2p";
16+ };
17+
18+ checkInputs = [
19+ pytestCheckHook
20+ ];
21+
22+ # Update location for run with pytest
23+ preCheck = ''
24+ substituteInPlace tests/test_load.py \
25+ --replace "'xbefiles'" "'tests/xbefiles'"
26+ '';
27+
28+ pythonImportsCheck = [ "xbe" ];
29+
30+ meta = with lib; {
31+ description = "Library to work with XBE files";
32+ homepage = "https://github.com/mborgerson/pyxbe";
33+ license = with licenses; [ mit ];
34+ maintainers = with maintainers; [ fab ];
35+ };
36+}
pkgs/top-level/python-packages.nix+6
@@ -393,6 +393,8 @@ in {
393393
394394 androguard = callPackage ../development/python-modules/androguard { };
395395
396+ angr = callPackage ../development/python-modules/angr { };
397+
396398 aniso8601 = callPackage ../development/python-modules/aniso8601 { };
397399
398400 annexremote = callPackage ../development/python-modules/annexremote { };
@@ -1385,6 +1387,8 @@ in {
13851387
13861388 cld2-cffi = callPackage ../development/python-modules/cld2-cffi { };
13871389
1390+ cle = callPackage ../development/python-modules/cle { };
1391+
13881392 cleo = callPackage ../development/python-modules/cleo { };
13891393
13901394 clf = callPackage ../development/python-modules/clf { };
@@ -7151,6 +7155,8 @@ in {
71517155
71527156 pyx = callPackage ../development/python-modules/pyx { };
71537157
7158+ pyxbe = callPackage ../development/python-modules/pyxbe { };
7159+
71547160 pyxdg = callPackage ../development/python-modules/pyxdg { };
71557161
71567162 pyxeoma = callPackage ../development/python-modules/pyxeoma { };