2021-01-15 06:26:07 +00:00
|
|
|
{ lib
|
2018-10-26 14:28:07 +01:00
|
|
|
, buildPythonPackage
|
2020-09-30 23:18:16 +01:00
|
|
|
, fetchFromGitHub
|
2018-10-26 14:28:07 +01:00
|
|
|
, python
|
2021-01-15 06:26:07 +00:00
|
|
|
, stdenv
|
2018-10-26 14:28:07 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyelftools";
|
2021-01-15 06:26:07 +00:00
|
|
|
version = "0.27";
|
2018-10-26 14:28:07 +01:00
|
|
|
|
2020-09-30 23:18:16 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "eliben";
|
|
|
|
repo = pname;
|
2021-01-15 06:26:07 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "09igdym2qj2fvfcazbz25qybmgz7ccrn25xn3havfkdkka0z0i3p";
|
2018-10-26 14:28:07 +01:00
|
|
|
};
|
|
|
|
|
2021-04-05 13:55:37 +01:00
|
|
|
doCheck = stdenv.hostPlatform.system == "x86_64-linux";
|
2020-09-30 23:18:16 +01:00
|
|
|
|
2018-10-26 14:28:07 +01:00
|
|
|
checkPhase = ''
|
2020-09-30 23:18:16 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" test/external_tools/readelf
|
2018-10-26 14:28:07 +01:00
|
|
|
${python.interpreter} test/all_tests.py
|
|
|
|
'';
|
|
|
|
|
2020-09-30 23:18:16 +01:00
|
|
|
pythonImportsCheck = [ "elftools" ];
|
2018-10-26 14:28:07 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 06:26:07 +00:00
|
|
|
description = "Python library for analyzing ELF files and DWARF debugging information";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/eliben/pyelftools";
|
2018-10-26 14:28:07 +01:00
|
|
|
license = licenses.publicDomain;
|
2020-09-30 23:18:16 +01:00
|
|
|
maintainers = with maintainers; [ igsha pamplemousse ];
|
2018-10-26 14:28:07 +01:00
|
|
|
};
|
|
|
|
}
|