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, fetchurl, pkgsi686Linux, dpkg, makeWrapper, coreutils, gnused, gawk, file, cups, utillinux, xxd
{ stdenv, fetchurl, pkgsi686Linux, dpkg, makeWrapper, coreutils, gnused, gawk, file, cups, utillinux, xxd, runtimeShell
, ghostscript, a2ps }:
# Why:
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
unpackPhase = "true";
brprintconf_mfcj6510dw_script = ''
#!${stdenv.shell}
#!${runtimeShell}
cd $(mktemp -d)
ln -s @out@/usr/bin/brprintconf_mfcj6510dw_patched brprintconf_mfcj6510dw_patched
ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc brmfcj6510dwfunc

View File

@@ -4,7 +4,8 @@
, udev
, libGLU_combined, SDL
, libao, openal, libpulseaudio
, gtk2, gtksourceview }:
, gtk2, gtksourceview
, runtimeShell }:
with stdenv.lib;
stdenv.mkDerivation rec {
@@ -55,7 +56,7 @@ stdenv.mkDerivation rec {
# stuff needed by higan at runtime
cat <<EOF > $out/bin/higan-init.sh
#!${stdenv.shell}
#!${runtimeShell}
cp --recursive --update $out/share/higan/*.sys \$HOME/.local/share/higan/
@@ -69,8 +70,8 @@ stdenv.mkDerivation rec {
longDescription = ''
higan (formerly bsnes) is a multi-system game console emulator.
It currently supports the following systems:
- Nintendo's Famicom, Super Famicom (with subsystems:
Super Game Boy, BS-X Satellaview, Sufami Turbo);
- Nintendo's Famicom, Super Famicom (with subsystems:
Super Game Boy, BS-X Satellaview, Sufami Turbo);
Game Boy, Game Boy Color, Game Boy Advance;
- Sega's Master System, Game Gear, Mega Drive;
- NEC's PC Engine, SuperGrafx;

View File

@@ -1,4 +1,4 @@
{ stdenv, lib, writeText, fetchurl, upx, libGLU, glib, gtk2, alsaLib, libSM, libX11, gdk_pixbuf, pango, libXinerama, mpg123 }:
{ stdenv, lib, writeText, fetchurl, upx, libGLU, glib, gtk2, alsaLib, libSM, libX11, gdk_pixbuf, pango, libXinerama, mpg123, runtimeShell }:
let
libPath = lib.makeLibraryPath [ stdenv.cc.cc libGLU glib gtk2 alsaLib libSM libX11 gdk_pixbuf pango libXinerama ];
@@ -18,7 +18,7 @@ in stdenv.mkDerivation rec {
};
runner = writeText "kega-fusion" ''
#!${stdenv.shell} -ex
#!${runtimeShell} -ex
kega_libdir="@out@/lib/kega-fusion"
kega_localdir="$HOME/.Kega Fusion"

View File

@@ -1,4 +1,4 @@
{ stdenv, pkgs, cores }:
{ stdenv, pkgs, cores, runtimeShell }:
assert cores != [];
@@ -7,7 +7,7 @@ with pkgs.lib;
let
script = exec: ''
#!${stdenv.shell}
#!${runtimeShell}
nohup sh -c "pkill -SIGTSTP kodi" &
# https://forum.kodi.tv/showthread.php?tid=185074&pid=1622750#pid1622750
nohup sh -c "sleep 10 && ${exec} '$@' -f;pkill -SIGCONT kodi"

View File

@@ -1,5 +1,5 @@
{ stdenv, fetchhg, cmake, glib, gst_all_1, makeWrapper, pkgconfig
, python, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, sqlite, zlib
, python, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, sqlite, zlib, runtimeShell
}:
stdenv.mkDerivation rec {
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
mv $out/share/retrofe/example/retrofe $out/bin/
cat > $out/bin/retrofe-init << EOF
#!${stdenv.shell}
#!${runtimeShell}
echo "This will install retrofe's example files into this directory"
echo "Example files location: $out/share/retrofe/example/"

View File

@@ -1,6 +1,6 @@
{ stdenv, vim, vimPlugins, vim_configurable, neovim, buildEnv, writeText, writeScriptBin
, nix-prefetch-hg, nix-prefetch-git
, fetchFromGitHub
, fetchFromGitHub, runtimeShell
}:
/*
@@ -374,7 +374,7 @@ rec {
let
rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
vimWrapperScript = writeScriptBin vimExecutableName ''
#!${stdenv.shell}
#!${runtimeShell}
exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
'';
gvimWrapperScript = writeScriptBin gvimExecutableName ''

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchzip, vscode-utils, jq, mono, clang-tools, writeScript
{ stdenv, fetchzip, vscode-utils, jq, mono, clang-tools, writeScript, runtimeShell
, gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise.
}:
@@ -53,7 +53,7 @@ let
};
openDebugAD7Script = writeScript "OpenDebugAD7" ''
#!${stdenv.shell}
#!${runtimeShell}
BIN_DIR="$(cd "$(dirname "$0")" && pwd -P)"
${if gdbUseFixed
then ''