systemd: add missing patch for Musl
[NixPkgs.git] / pkgs / development / python-modules / pyelftools / default.nix
blob783951abde8b2b1e0e39bb675ce02e68227addab
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   python,
7   pythonOlder,
8   setuptools,
9 }:
11 buildPythonPackage rec {
12   pname = "pyelftools";
13   version = "0.31";
14   pyproject = true;
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "eliben";
20     repo = "pyelftools";
21     tag = "v${version}";
22     hash = "sha256-kX89fMXqrEvhMAAjqKHzHmrYizKBt1uCWMOJtFNNhy4=";
23   };
25   build-system = [ setuptools ];
27   doCheck = stdenv.hostPlatform.system == "x86_64-linux" && stdenv.hostPlatform.isGnu;
29   checkPhase = ''
30     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" test/external_tools/readelf
31     ${python.interpreter} test/run_all_unittests.py
32     ${python.interpreter} test/run_examples_test.py
33     ${python.interpreter} test/run_readelf_tests.py --parallel
34   '';
36   pythonImportsCheck = [ "elftools" ];
38   meta = {
39     description = "Python library for analyzing ELF files and DWARF debugging information";
40     homepage = "https://github.com/eliben/pyelftools";
41     changelog = "https://github.com/eliben/pyelftools/blob/v${version}/CHANGES";
42     license = with lib.licenses; [
43       # Public domain with Unlicense waiver.
44       unlicense
45       # pyelftools bundles construct library that is licensed under MIT license.
46       # See elftools/construct/{LICENSE,README} in the source code.
47       mit
48     ];
49     maintainers = with lib.maintainers; [
50       igsha
51       pamplemousse
52     ];
53     mainProgram = "readelf.py";
54   };