From 48034046bf6271d44f7dea4c1ba97196b3b105a7 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 22 Mar 2022 19:20:58 +0100 Subject: [PATCH] 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. --- pkgs/build-support/trivial-builders.nix | 10 +++++++--- pkgs/top-level/all-packages.nix | 1 + 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 { };