Unverified Commit e7a01466 authored by Ivan Trubach's avatar Ivan Trubach Committed by GitHub
Browse files

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: default avatarGuillaume Maudoux <guillaume.maudoux@tweag.io>
parent 83fc4bfa
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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";
  };
}
+0 −1
Original line number Diff line number Diff line
@@ -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 { };