diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2019-02-26 11:45:54 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2019-02-26 14:10:49 +0000 |
commit | dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1 (patch) | |
tree | 9717b203342cd121abcdfde5ba8b66235c3ad67c /pkgs/build-support/trivial-builders.nix | |
parent | 1233c8d9e9bc463899ed6a8cf0232e6bf36475ee (diff) |
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
Diffstat (limited to 'pkgs/build-support/trivial-builders.nix')
-rw-r--r-- | pkgs/build-support/trivial-builders.nix | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 454ef8912b3b..58bc7147ede4 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, stdenvNoCC, lndir }: +{ lib, stdenv, stdenvNoCC, lndir, runtimeShell }: let @@ -15,12 +15,12 @@ rec { /* Run the shell command `buildCommand' to produce a store path named * `name'. The attributes in `env' are added to the environment * prior to running the command. By default `runCommand' runs using - * stdenv with no compiler environment. `runCommandCC` + * stdenv with no compiler environment. `runCommandCC` * * Examples: * runCommand "name" {envVariable = true;} ''echo hello'' * runCommandNoCC "name" {envVariable = true;} ''echo hello'' # equivalent to prior - * runCommandCC "name" {} ''gcc -o myfile myfile.c; cp myfile $out''; + * runCommandCC "name" {} ''gcc -o myfile myfile.c; cp myfile $out''; */ runCommand = runCommandNoCC; runCommandNoCC = runCommand' stdenvNoCC; @@ -145,11 +145,11 @@ rec { executable = true; destination = "/bin/${name}"; text = '' - #!${stdenv.shell} + #!${runtimeShell} ${text} ''; checkPhase = '' - ${stdenv.shell} -n $out/bin/${name} + ${runtimeShell} -n $out/bin/${name} ''; }; @@ -215,7 +215,7 @@ rec { * myhellohook = makeSetupHook { deps = [ hello ]; } ./myscript.sh; * * # wrotes a setup hook where @bash@ myscript.sh is substituted for the - * # bash interpreter. + * # bash interpreter. * myhellohookSub = makeSetupHook { * deps = [ hello ]; * substitutions = { bash = "${pkgs.bash}/bin/bash"; }; @@ -278,7 +278,7 @@ rec { * packages that cannot be built automatically. * * Examples: - * + * * requireFile { * name = "my-file"; * url = "http://example.com/download/"; |