2021-03-29 10:25:40 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, cffi
|
|
|
|
, fetchFromGitHub
|
|
|
|
, minidump
|
|
|
|
, nose
|
|
|
|
, pefile
|
|
|
|
, pyelftools
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyvex
|
|
|
|
, pyxbe
|
|
|
|
, sortedcontainers
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# The binaries are following the argr projects release cycle
|
2021-10-05 22:07:58 +02:00
|
|
|
version = "9.0.10072";
|
2021-03-29 10:25:40 +02:00
|
|
|
|
|
|
|
# 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}";
|
2021-10-05 22:07:58 +02:00
|
|
|
sha256 = "sha256-uY0Pp+BssnkQvF8fsVlRW2Wj/JmMBSBudDf9AHekBtw=";
|
2021-03-29 10:25:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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"
|
2021-04-19 22:15:56 +02:00
|
|
|
# Binary not found, seems to be missing in the current binaries release
|
|
|
|
"test_plt_full_relro"
|
2021-03-29 10:25:40 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|