about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2022-03-22 19:20:58 +0100
committerOPNA2608 <christoph.neidahl@gmail.com>2022-03-22 19:55:46 +0100
commit48034046bf6271d44f7dea4c1ba97196b3b105a7 (patch)
tree9532130153229d20ee15f681aef5f7dc6e508497
parent80180c339e5e8c7e4b9e440df777ae2fb76b1811 (diff)
downloadnixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar.gz
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar.bz2
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar.lz
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar.xz
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.tar.zst
nixlib-48034046bf6271d44f7dea4c1ba97196b3b105a7.zip
autoPatchelfHook: Make Linux-exclusive
After being rewritten in https://github.com/NixOS/nixpkgs/pull/149731, this hook
can fail on Mach-O binaries. Since patching ELF files on Darwin doesn't make
much sense anyway, we'll mark this as Linux-exclusive.
-rw-r--r--pkgs/build-support/trivial-builders.nix10
-rw-r--r--pkgs/top-level/all-packages.nix1
2 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 68f0f1bc4ddc..b1237180ed39 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -516,15 +516,19 @@ rec {
    * # setup hook that depends on the hello package and runs ./myscript.sh
    * myhellohook = makeSetupHook { deps = [ hello ]; } ./myscript.sh;
    *
-   * # wrotes a setup hook where @bash@ myscript.sh is substituted for the
+   * # writes a Linux-exclusive setup hook where @bash@ myscript.sh is substituted for the
    * # bash interpreter.
    * myhellohookSub = makeSetupHook {
    *                 deps = [ hello ];
    *                 substitutions = { bash = "${pkgs.bash}/bin/bash"; };
+   *                 meta.platforms = lib.platforms.linux;
    *               } ./myscript.sh;
    */
-  makeSetupHook = { name ? "hook", deps ? [], substitutions ? {} }: script:
-    runCommand name substitutions
+  makeSetupHook = { name ? "hook", deps ? [], substitutions ? {}, meta ? {} }: script:
+    runCommand name
+      (substitutions // {
+        inherit meta;
+      })
       (''
         mkdir -p $out/nix-support
         cp ${script} $out/nix-support/setup-hook
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1b87117176b9..b706080cc087 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -154,6 +154,7 @@ with pkgs;
       pythonInterpreter = "${python3.withPackages (ps: [ ps.pyelftools ])}/bin/python";
       autoPatchelfScript = ../build-support/setup-hooks/auto-patchelf.py;
     };
+    meta.platforms = lib.platforms.linux;
   } ../build-support/setup-hooks/auto-patchelf.sh;
 
   appflowy = callPackage ../applications/office/appflowy { };