2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyelftools";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.31";
|
|
|
|
pyproject = true;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "eliben";
|
2024-05-15 15:35:15 +00:00
|
|
|
repo = "pyelftools";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-kX89fMXqrEvhMAAjqKHzHmrYizKBt1uCWMOJtFNNhy4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
doCheck = stdenv.hostPlatform.system == "x86_64-linux" && stdenv.hostPlatform.isGnu;
|
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
|
2023-01-20 10:41:00 +00:00
|
|
|
${python.interpreter} test/run_all_unittests.py
|
|
|
|
${python.interpreter} test/run_examples_test.py
|
|
|
|
${python.interpreter} test/run_readelf_tests.py --parallel
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "elftools" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta = {
|
2021-01-15 22:18:51 +00:00
|
|
|
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";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/eliben/pyelftools/blob/v${version}/CHANGES";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = with lib.licenses; [
|
|
|
|
# Public domain with Unlicense waiver.
|
|
|
|
unlicense
|
|
|
|
# pyelftools bundles construct library that is licensed under MIT license.
|
|
|
|
# See elftools/construct/{LICENSE,README} in the source code.
|
|
|
|
mit
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
igsha
|
|
|
|
pamplemousse
|
|
|
|
];
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "readelf.py";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|