1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, python
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "pyelftools";
11 version = "0.28";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "eliben";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-+T5C0ah2oj5E8fWaQbuzYRVgD5bSiUbaArrlxNLojvw=";
21 };
22
23 doCheck = stdenv.hostPlatform.system == "x86_64-linux" && stdenv.hostPlatform.isGnu;
24
25 checkPhase = ''
26 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" test/external_tools/readelf
27 ${python.interpreter} test/all_tests.py
28 '';
29
30 pythonImportsCheck = [
31 "elftools"
32 ];
33
34 meta = with lib; {
35 description = "Python library for analyzing ELF files and DWARF debugging information";
36 homepage = "https://github.com/eliben/pyelftools";
37 license = licenses.publicDomain;
38 maintainers = with maintainers; [ igsha pamplemousse ];
39 };
40}