summary refs log tree commit diff
path: root/pkgs/development/python-modules/cle/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/development/python-modules/cle/default.nix
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/development/python-modules/cle/default.nix')
-rw-r--r--pkgs/development/python-modules/cle/default.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cle/default.nix b/pkgs/development/python-modules/cle/default.nix
new file mode 100644
index 00000000000..0110625eba8
--- /dev/null
+++ b/pkgs/development/python-modules/cle/default.nix
@@ -0,0 +1,79 @@
+{ 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.9166";
+
+  # 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 = "1mvdcwzim52mc7vjrr2cq8xwwi0v0ai3z608mg5nfbbf4zjji76c";
+  };
+
+  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"
+    # Binary not found, seems to be missing in the current binaries release
+    "test_plt_full_relro"
+  ];
+
+  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 ];
+  };
+}