From e7a014667537b2809d53110089da5891be476dae Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Mon, 13 May 2024 13:48:02 +0300 Subject: [PATCH] autoPatchelfHook: allow building on all platforms (#308994) * python3.pkgs.pyelftools: fix license metadata * autoPatchelfHook: allow building on all platforms This change allows using autoPatchelfHook in nativeBuildInputs when cross-compiling from non-Linux platform. Technically, the hook is platform-independent and only limited by the dependencies, namely patchelf (`platforms = all`) and pyelftools (inherits from python, that is, `platforms = linux ++ darwin ++ windows`). --------- Co-authored-by: Guillaume Maudoux --- .../python-modules/pyelftools/default.nix | 12 +++++++++--- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/pyelftools/default.nix b/pkgs/development/python-modules/pyelftools/default.nix index 063215f5bc6e..85110fdf94aa 100644 --- a/pkgs/development/python-modules/pyelftools/default.nix +++ b/pkgs/development/python-modules/pyelftools/default.nix @@ -38,12 +38,18 @@ buildPythonPackage rec { "elftools" ]; - meta = with lib; { + meta = { description = "Python library for analyzing ELF files and DWARF debugging information"; homepage = "https://github.com/eliben/pyelftools"; changelog = "https://github.com/eliben/pyelftools/blob/v${version}/CHANGES"; - license = licenses.publicDomain; - maintainers = with maintainers; [ igsha pamplemousse ]; + 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 + ]; + maintainers = with lib.maintainers; [ igsha pamplemousse ]; mainProgram = "readelf.py"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 323c8fba6fcc..46c50a685d25 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -193,7 +193,6 @@ with pkgs; pythonInterpreter = "${python3.withPackages (ps: [ ps.pyelftools ])}/bin/python"; autoPatchelfScript = ../build-support/setup-hooks/auto-patchelf.py; }; - meta.platforms = lib.platforms.linux ++ lib.platforms.freebsd; } ../build-support/setup-hooks/auto-patchelf.sh; tomato-c = callPackage ../applications/misc/tomato-c { };