From 57542662e9f1b8bc1c4e42bde908a9b968971f35 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 29 Mar 2021 10:25:40 +0200 Subject: [PATCH] python3Packages.cle: init at 9.0.6281 --- .../python-modules/cle/default.nix | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 pkgs/development/python-modules/cle/default.nix diff --git a/pkgs/development/python-modules/cle/default.nix b/pkgs/development/python-modules/cle/default.nix new file mode 100644 index 000000000000..436a364b2b5a --- /dev/null +++ b/pkgs/development/python-modules/cle/default.nix @@ -0,0 +1,77 @@ +{ lib +, buildPythonPackage +, cffi +, fetchFromGitHub +, minidump +, nose +, pefile +, pyelftools +, pytestCheckHook +, pythonOlder +, pyvex +, pyxbe +, sortedcontainers +}: + +let + # The binaries are following the argr projects release cycle + version = "9.0.6281"; + + # Binary files from https://github.com/angr/binaries (only used for testing and only here) + binaries = fetchFromGitHub { + owner = "angr"; + repo = "binaries"; + rev = "v${version}"; + sha256 = "1qlrxfj1n34xvwkac6mbcc7zmixxbp34fj7lkf0fvp7zcz1rpla1"; + }; + +in +buildPythonPackage rec { + pname = "cle"; + inherit version; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "angr"; + repo = pname; + rev = "v${version}"; + sha256 = "0f2zc02dljmgp6ny6ja6917j08kqhwckncan860dq4xv93g61rmg"; + }; + + propagatedBuildInputs = [ + cffi + minidump + pefile + pyelftools + pyvex + pyxbe + sortedcontainers + ]; + + checkInputs = [ + nose + 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" + ]; + + pythonImportsCheck = [ "cle" ]; + + meta = with lib; { + description = "Python loader for many binary formats"; + homepage = "https://github.com/angr/cle"; + license = with licenses; [ bsd2 ]; + maintainers = with maintainers; [ fab ]; + }; +}