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.
This commit is contained in:
Jörg Thalheim
2019-02-26 11:45:54 +00:00
parent 1233c8d9e9
commit dadc7eb329
131 changed files with 326 additions and 294 deletions

View File

@@ -1,4 +1,4 @@
{ stdenv, ncurses, buildGoPackage, fetchFromGitHub, writeText }:
{ stdenv, ncurses, buildGoPackage, fetchFromGitHub, writeText, runtimeShell }:
buildGoPackage rec {
name = "fzf-${version}";
@@ -47,7 +47,7 @@ buildGoPackage rec {
cp -R $src/shell $bin/share/fzf
cat <<SCRIPT > $bin/bin/fzf-share
#!${stdenv.shell}
#!${runtimeShell}
# Run this script to find the fzf shared folder where all the shell
# integration scripts are living.
echo $bin/share/fzf

View File

@@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, coreutils, ubootOdroidXU3 }:
{ stdenv, lib, fetchFromGitHub, coreutils, ubootOdroidXU3, runtimeShell }:
stdenv.mkDerivation {
name = "odroid-xu3-bootloader-2015-12-04";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
install -Dm755 $src/sd_fuse/hardkernel_1mb_uboot/sd_fusing.1M.sh $out/bin/sd_fuse-xu3
sed -i \
-e '1i#!${stdenv.shell}' \
-e '1i#!${runtimeShell}' \
-e '1iPATH=${lib.makeBinPath [ coreutils ]}:$PATH' \
-e '/set -x/d' \
-e 's,.\/sd_fusing\.sh,sd_fuse-xu3,g' \

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre }:
{ stdenv, fetchurl, jre, runtimeShell }:
stdenv.mkDerivation rec {
name = "smc-6.6.3";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
cp misc/smc.ico "$out/share/icons/"
cat > "$out/bin/smc" << EOF
#!${stdenv.shell}
#!${runtimeShell}
${jre}/bin/java -jar "$out/share/java/Smc.jar" "\$@"
EOF
chmod a+x "$out/bin/smc"

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre, unzip }:
{ stdenv, fetchurl, jre, unzip, runtimeShell }:
stdenv.mkDerivation rec {
major = "14";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
cp -R * "$out/lib"
cat > "$out/bin/umlet" << EOF
#!${stdenv.shell}
#!${runtimeShell}
programDir="$out/lib"
cd "\$programDir"

View File

@@ -1,4 +1,4 @@
{ stdenv, writeText, writeScriptBin, xorg, xkeyboard_config }:
{ stdenv, writeText, writeScriptBin, xorg, xkeyboard_config, runtimeShell }:
let
xorgConfig = writeText "dummy-xorg.conf" ''
@@ -73,7 +73,7 @@ let
'';
in writeScriptBin "xdummy" ''
#!${stdenv.shell}
#!${runtimeShell}
exec ${xorg.xorgserver.out}/bin/Xorg \
-noreset \
-logfile /dev/null \

View File

@@ -1,7 +1,7 @@
{ stdenv, acl, attr, autoconf, automake, bash, bc, coreutils, e2fsprogs
, fetchgit, fio, gawk, keyutils, killall, lib, libaio, libcap, libtool
, libuuid, libxfs, lvm2, openssl, perl, procps, quota
, time, utillinux, which, writeScript, xfsprogs }:
, time, utillinux, which, writeScript, xfsprogs, runtimeShell }:
stdenv.mkDerivation {
name = "xfstests-2018-04-11";
@@ -78,7 +78,7 @@ stdenv.mkDerivation {
# wants to write temporary files there. So create a temporary
# to run from and symlink the runtime files to it.
wrapperScript = writeScript "xfstests-check" ''
#!${stdenv.shell}
#!${runtimeShell}
set -e
export RESULT_BASE="$(pwd)/results"

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ stdenv, fetchFromGitHub, runtimeShell }:
stdenv.mkDerivation rec {
name = "zsh-autoenv-${version}";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
cp -R $src $out/share/zsh-autoenv
cat <<SCRIPT > $out/bin/zsh-autoenv-share
#!${stdenv.shell}
#!${runtimeShell}
# Run this script to find the fzf shared folder where all the shell
# integration scripts are living.
echo $out/share/zsh-autoenv