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