2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
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
|
2021-01-15 22:18:51 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyelftools";
|
2021-01-15 22:18:51 +00:00
|
|
|
version = "0.27";
|
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}";
|
|
|
|
sha256 = "09igdym2qj2fvfcazbz25qybmgz7ccrn25xn3havfkdkka0z0i3p";
|
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
|
|
|
|
'';
|
|
|
|
|
2020-10-07 09:15:18 +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
|
|
|
};
|
|
|
|
}
|