2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
2022-06-26 10:26:21 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2020-10-07 09:15:18 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, python
|
2022-06-26 10:26:21 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyelftools";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "0.28";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "eliben";
|
|
|
|
repo = pname;
|
2021-01-15 22:18:51 +00:00
|
|
|
rev = "v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-+T5C0ah2oj5E8fWaQbuzYRVgD5bSiUbaArrlxNLojvw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
doCheck = stdenv.hostPlatform.system == "x86_64-linux";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2020-10-07 09:15:18 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" test/external_tools/readelf
|
2020-04-24 23:36:52 +00:00
|
|
|
${python.interpreter} test/all_tests.py
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"elftools"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for analyzing ELF files and DWARF debugging information";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/eliben/pyelftools";
|
|
|
|
license = licenses.publicDomain;
|
2020-10-07 09:15:18 +00:00
|
|
|
maintainers = with maintainers; [ igsha pamplemousse ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|