Skip to content

Commit

Permalink
autoPatchelfHook: Make Linux-exclusive
Browse files Browse the repository at this point in the history
After being rewritten in NixOS#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.
  • Loading branch information
OPNA2608 committed Mar 22, 2022
1 parent 80180c3 commit 4803404
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkgs/build-support/trivial-builders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit 4803404

Please sign in to comment.