Browse Source

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.
nim-0.20.0
Jörg Thalheim 4 years ago
parent
commit
dadc7eb329
No known key found for this signature in database
GPG Key ID: B3F5D81B0C6967C4
  1. 4
      doc/functions/dockertools.xml
  2. 4
      pkgs/applications/audio/spotifywm/default.nix
  3. 4
      pkgs/applications/editors/standardnotes/default.nix
  4. 4
      pkgs/applications/editors/sublime/3/common.nix
  5. 21
      pkgs/applications/editors/vim/configurable.nix
  6. 4
      pkgs/applications/graphics/alchemy/default.nix
  7. 7
      pkgs/applications/graphics/autotrace/default.nix
  8. 4
      pkgs/applications/graphics/swingsane/default.nix
  9. 5
      pkgs/applications/graphics/wings/default.nix
  10. 4
      pkgs/applications/graphics/zgrviewer/default.nix
  11. 4
      pkgs/applications/misc/avrdudess/default.nix
  12. 4
      pkgs/applications/misc/curabydagoma/default.nix
  13. 4
      pkgs/applications/misc/glava/default.nix
  14. 4
      pkgs/applications/misc/hello-unfree/default.nix
  15. 4
      pkgs/applications/misc/jbidwatcher/default.nix
  16. 4
      pkgs/applications/misc/multibootusb/default.nix
  17. 4
      pkgs/applications/misc/nix-tour/default.nix
  18. 4
      pkgs/applications/misc/openjump/default.nix
  19. 4
      pkgs/applications/misc/terminal-notifier/default.nix
  20. 10
      pkgs/applications/misc/thinking-rock/default.nix
  21. 4
      pkgs/applications/misc/vue/default.nix
  22. 3
      pkgs/applications/networking/browsers/firefox-bin/update.nix
  23. 3
      pkgs/applications/networking/browsers/firefox/update.nix
  24. 7
      pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix
  25. 4
      pkgs/applications/networking/irc/weechat/wrapper.nix
  26. 4
      pkgs/applications/networking/mailreaders/msgviewer/default.nix
  27. 4
      pkgs/applications/networking/mailreaders/neomutt/default.nix
  28. 3
      pkgs/applications/office/mendeley/default.nix
  29. 4
      pkgs/applications/office/mendeley/update.nix
  30. 5
      pkgs/applications/office/moneyplex/default.nix
  31. 6
      pkgs/applications/science/electronics/alliance/default.nix
  32. 4
      pkgs/applications/science/electronics/eagle/eagle7.nix
  33. 4
      pkgs/applications/science/logic/hol_light/default.nix
  34. 4
      pkgs/applications/science/logic/leo3/binary.nix
  35. 3
      pkgs/applications/science/math/sage/sage-src.nix
  36. 4
      pkgs/applications/video/dvd-slideshow/default.nix
  37. 7
      pkgs/build-support/docker/default.nix
  38. 2
      pkgs/build-support/release/ant-build.nix
  39. 3
      pkgs/build-support/singularity-tools/default.nix
  40. 14
      pkgs/build-support/trivial-builders.nix
  41. 3
      pkgs/build-support/vm/windows/controller/default.nix
  42. 4
      pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix
  43. 4
      pkgs/development/compilers/ccl/default.nix
  44. 4
      pkgs/development/compilers/cmdstan/default.nix
  45. 6
      pkgs/development/compilers/go/1.11.nix
  46. 4
      pkgs/development/libraries/safefile/default.nix
  47. 6
      pkgs/development/misc/avr8-burn-omat/default.nix
  48. 3
      pkgs/development/pharo/vm/build-vm.nix
  49. 2
      pkgs/development/pharo/vm/vms.nix
  50. 5
      pkgs/development/python-modules/cmd2/old.nix
  51. 5
      pkgs/development/python-modules/pandas/default.nix
  52. 4
      pkgs/development/tools/analysis/jdepend/default.nix
  53. 5
      pkgs/development/tools/build-managers/bazel/default.nix
  54. 5
      pkgs/development/tools/build-managers/gup/default.nix
  55. 5
      pkgs/development/tools/haskell/hyper-haskell/default.nix
  56. 4
      pkgs/development/tools/misc/ccls/default.nix
  57. 5
      pkgs/development/tools/misc/cquery/default.nix
  58. 2
      pkgs/development/tools/misc/ctags/wrapped.nix
  59. 5
      pkgs/development/tools/misc/distcc/default.nix
  60. 4
      pkgs/development/tools/misc/opengrok/default.nix
  61. 4
      pkgs/development/tools/misc/saleae-logic/default.nix
  62. 5
      pkgs/development/tools/rust/bindgen/default.nix
  63. 4
      pkgs/development/tools/wp-cli/default.nix
  64. 5
      pkgs/development/tools/xcbuild/wrapper.nix
  65. 3
      pkgs/development/web/nodejs/update.nix
  66. 4
      pkgs/games/andyetitmoves/default.nix
  67. 4
      pkgs/games/astromenace/default.nix
  68. 4
      pkgs/games/cataclysm-dda/common.nix
  69. 4
      pkgs/games/eduke32/default.nix
  70. 5
      pkgs/games/fsg/default.nix
  71. 8
      pkgs/games/oilrush/default.nix
  72. 4
      pkgs/games/openttd/default.nix
  73. 6
      pkgs/games/sauerbraten/default.nix
  74. 4
      pkgs/games/scummvm/games.nix
  75. 5
      pkgs/games/simutrans/default.nix
  76. 4
      pkgs/games/speed-dreams/default.nix
  77. 9
      pkgs/games/steam/chrootenv.nix
  78. 4
      pkgs/games/steam/steam.nix
  79. 4
      pkgs/games/tcl2048/default.nix
  80. 4
      pkgs/games/tibia/default.nix
  81. 4
      pkgs/games/tremulous/default.nix
  82. 5
      pkgs/games/trigger/default.nix
  83. 18
      pkgs/games/vessel/default.nix
  84. 17
      pkgs/games/worldofgoo/default.nix
  85. 4
      pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix
  86. 9
      pkgs/misc/emulators/higan/default.nix
  87. 4
      pkgs/misc/emulators/kega-fusion/default.nix
  88. 4
      pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix
  89. 4
      pkgs/misc/emulators/retrofe/default.nix
  90. 4
      pkgs/misc/vim-plugins/vim-utils.nix
  91. 4
      pkgs/misc/vscode-extensions/cpptools/default.nix
  92. 4
      pkgs/os-specific/darwin/stubs/default.nix
  93. 6
      pkgs/os-specific/linux/bbswitch/default.nix
  94. 4
      pkgs/os-specific/linux/pam_usb/default.nix
  95. 4
      pkgs/os-specific/linux/rfkill/udev.nix
  96. 4
      pkgs/os-specific/linux/tp_smapi/update.nix
  97. 4
      pkgs/servers/mail/system-sendmail/default.nix
  98. 4
      pkgs/servers/meteor/default.nix
  99. 5
      pkgs/servers/monitoring/plugins/default.nix
  100. 4
      pkgs/servers/nosql/eventstore/default.nix
  101. Some files were not shown because too many files have changed in this diff Show More

4
doc/functions/dockertools.xml

@ -47,7 +47,7 @@ buildImage {
contents = pkgs.redis; <co xml:id='ex-dockerTools-buildImage-6' />
runAsRoot = '' <co xml:id='ex-dockerTools-buildImage-runAsRoot' />
#!${stdenv.shell}
#!${pkgs.runtimeShell}
mkdir -p /data
'';
@ -544,7 +544,7 @@ buildImage {
name = "shadow-basic";
runAsRoot = ''
#!${stdenv.shell}
#!${pkgs.runtimeShell}
${shadowSetup}
groupadd -r redis
useradd -r -g redis redis

4
pkgs/applications/audio/spotifywm/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, spotify, xorg }:
{ stdenv, fetchFromGitHub, spotify, xorg, runtimeShell }:
stdenv.mkDerivation rec {
name = "spotifywm-unstable-${version}";
version = "2016-11-28";
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ spotify ];
installPhase = ''
echo "#!${stdenv.shell}" > spotifywm
echo "#!${runtimeShell}" > spotifywm
echo "LD_PRELOAD="$out/lib/spotifywm.so" ${spotify}/bin/spotify \$*" >> spotifywm
install -Dm644 spotifywm.so $out/lib/spotifywm.so
install -Dm755 spotifywm $out/bin/spotifywm

4
pkgs/applications/editors/standardnotes/default.nix

@ -1,4 +1,4 @@
{ stdenv, appimage-run, fetchurl }:
{ stdenv, appimage-run, fetchurl, runtimeShell }:
let
version = "3.0.6";
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out/{bin,share}
cp $src $out/share/standardNotes.AppImage
echo "#!${stdenv.shell}" > $out/bin/standardnotes
echo "#!${runtimeShell}" > $out/bin/standardnotes
echo "${appimage-run}/bin/appimage-run $out/share/standardNotes.AppImage" >> $out/bin/standardnotes
chmod +x $out/bin/standardnotes $out/share/standardNotes.AppImage
'';

4
pkgs/applications/editors/sublime/3/common.nix

@ -1,6 +1,6 @@
{buildVersion, x32sha256, x64sha256}:
{ fetchurl, stdenv, glib, xorg, cairo, gtk2, gtk3, pango, makeWrapper, wrapGAppsHook, openssl, bzip2,
{ fetchurl, stdenv, glib, xorg, cairo, gtk2, gtk3, pango, makeWrapper, wrapGAppsHook, openssl, bzip2, runtimeShell,
pkexecPath ? "/run/wrappers/bin/pkexec", libredirect,
gksuSupport ? false, gksu, unzip, zip, bash}:
@ -115,7 +115,7 @@ in stdenv.mkDerivation (rec {
mkdir -p $out/bin
cat > $out/bin/subl <<-EOF
#!${stdenv.shell}
#!${runtimeShell}
exec $sublime/sublime_text "\$@"
EOF
chmod +x $out/bin/subl

21
pkgs/applications/editors/vim/configurable.nix

@ -7,6 +7,7 @@
, vimPlugins
, makeWrapper
, wrapGAppsHook
, runtimeShell
# apple frameworks
, CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private
@ -157,22 +158,22 @@ in stdenv.mkDerivation rec {
rewrap () {
rm -f "$out/bin/$1"
echo -e '#!${stdenv.shell}\n"'"$out/bin/vim"'" '"$2"' "$@"' > "$out/bin/$1"
echo -e '#!${runtimeShell}\n"'"$out/bin/vim"'" '"$2"' "$@"' > "$out/bin/$1"
chmod a+x "$out/bin/$1"
}
rewrap ex -e
rewrap view -R
rewrap gvim -g
rewrap gex -eg
rewrap gview -Rg
rewrap rvim -Z
rewrap rview -RZ
rewrap rgvim -gZ
rewrap ex -e
rewrap view -R
rewrap gvim -g
rewrap gex -eg
rewrap gview -Rg
rewrap rvim -Z
rewrap rview -RZ
rewrap rgvim -gZ
rewrap rgview -RgZ
rewrap evim -y
rewrap eview -yR
rewrap vimdiff -d
rewrap vimdiff -d
rewrap gvimdiff -gd
'';

4
pkgs/applications/graphics/alchemy/default.nix

@ -1,4 +1,4 @@
{stdenv, fetchurl, jre}:
{ stdenv, fetchurl, jre, runtimeShell }:
stdenv.mkDerivation rec {
name = "alchemy-${version}";
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin $out/share
cp -a . $out/share/alchemy
cat >> $out/bin/alchemy << EOF
#!${stdenv.shell}
#!${runtimeShell}
cd $out/share/alchemy
${jre}/bin/java -jar Alchemy.jar "$@"
EOF

7
pkgs/applications/graphics/autotrace/default.nix

@ -1,5 +1,6 @@
{ stdenv, fetchurl, callPackage, libpng12, imagemagick,
autoreconfHook, glib, pstoedit, pkgconfig, gettext, gd, darwin }:
{ stdenv, fetchurl, callPackage, libpng12, imagemagick
, autoreconfHook, glib, pstoedit, pkgconfig, gettext, gd, darwin
, runtimeShell }:
# TODO: Figure out why the resultant binary is somehow linked against
# libpng16.so.16 rather than libpng12.
@ -51,7 +52,7 @@ stdenv.mkDerivation rec {
# pstoedit-config no longer exists, it was replaced with pkg-config
mkdir wrappers
cat >wrappers/pstoedit-config <<'EOF'
#!${stdenv.shell}
#!${runtimeShell}
# replace --version with --modversion for pkg-config
args=''${@/--version/--modversion}
exec pkg-config pstoedit "''${args[@]}"

4
pkgs/applications/graphics/swingsane/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeDesktopItem, unzip, jre }:
{ stdenv, fetchurl, makeDesktopItem, unzip, jre, runtimeShell }:
stdenv.mkDerivation rec {
name = "swingsane-${version}";
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
installPhase = let
execWrapper = ''
#!${stdenv.shell}
#!${runtimeShell}
exec ${jre}/bin/java -jar $out/share/java/swingsane/swingsane-${version}.jar "$@"
'';

5
pkgs/applications/graphics/wings/default.nix

@ -1,4 +1,4 @@
{ fetchurl, stdenv, erlang, cl, libGL, libGLU }:
{ fetchurl, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
stdenv.mkDerivation rec {
name = "wings-2.2.1";
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
cp ebin/* $out/lib/${name}/ebin
cp -R textures shaders plugins $out/lib/$name
cat << EOF > $out/bin/wings
#!${stdenv.shell}
#!${runtimeShell}
${erlang}/bin/erl \
-pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
EOF
@ -43,4 +43,3 @@ stdenv.mkDerivation rec {
platforms = with stdenv.lib.platforms; linux;
};
}

4
pkgs/applications/graphics/zgrviewer/default.nix

@ -1,4 +1,4 @@
{stdenv, fetchurl, jre, unzip}:
{ stdenv, fetchurl, jre, unzip, runtimeShell }:
stdenv.mkDerivation rec {
version = "0.9.0";
pname = "zgrviewer";
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
cp -r target/* "$out/share/java/zvtm/"
echo '#!${stdenv.shell}' > "$out/bin/zgrviewer"
echo '#!${runtimeShell}' > "$out/bin/zgrviewer"
echo "${jre}/lib/openjdk/jre/bin/java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar' \"\$@\"" >> "$out/bin/zgrviewer"
chmod a+x "$out/bin/zgrviewer"
'';

4
pkgs/applications/misc/avrdudess/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, unzip, mono, avrdude, gtk2, xdg_utils }:
{ stdenv, runtimeShell, fetchurl, unzip, mono, avrdude, gtk2, xdg_utils }:
stdenv.mkDerivation rec {
name = "avrdudess-2.2.20140102";
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
unzip "$src" -d "$out/avrdudess"
cat >> "$out/bin/avrdudess" << __EOF__
#!${stdenv.shell}
#!${runtimeShell}
export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [gtk2 mono]}"
# We need PATH from user env for xdg-open to find its tools, which
# typically depend on the currently running desktop environment.

4
pkgs/applications/misc/curabydagoma/default.nix

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, python, pythonPackages, unzip }:
{ stdenv, runtimeShell, lib, fetchurl, python, pythonPackages, unzip }:
# This package uses a precompiled "binary" distribution of CuraByDagoma,
# distributed by the editor.
@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
mkdir $out/bin
cat > $out/bin/curabydago <<EOF
#!${stdenv.shell}
#!${runtimeShell}
export PYTHONPATH=$PYTHONPATH
${python.out}/bin/python $out/curabydago/cura.py
EOF

4
pkgs/applications/misc/glava/default.nix

@ -1,12 +1,12 @@
{ stdenv, writeScript, fetchFromGitHub
, libGL, libX11, libXext, python3, libXrandr, libXrender, libpulseaudio, libXcomposite
, enableGlfw ? false, glfw }:
, enableGlfw ? false, glfw, runtimeShell }:
let
inherit (stdenv.lib) optional makeLibraryPath;
wrapperScript = writeScript "glava" ''
#!${stdenv.shell}
#!${runtimeShell}
case "$1" in
--copy-config)
# The binary would symlink it, which won't work in Nix because the

4
pkgs/applications/misc/hello-unfree/default.nix

@ -1,4 +1,4 @@
{ stdenv }:
{ stdenv, runtimeShell }:
stdenv.mkDerivation rec {
name = "example-unfree-package-${version}";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/hello-unfree << EOF
#!${stdenv.shell}
#!${runtimeShell}
echo "Hello, you are running an unfree system!"
EOF
chmod +x $out/bin/hello-unfree

4
pkgs/applications/misc/jbidwatcher/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, java }:
{ stdenv, fetchurl, java, runtimeShell }:
stdenv.mkDerivation rec {
pname = "jbidwatcher";
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p "$out/bin"
echo > "$out/bin/${pname}" "#!${stdenv.shell}"
echo > "$out/bin/${pname}" "#!${runtimeShell}"
echo >>"$out/bin/${pname}" "${java}/bin/java -Xmx512m -jar ${jarfile}"
chmod +x "$out/bin/${pname}"
install -D -m644 ${src} ${jarfile}

4
pkgs/applications/misc/multibootusb/default.nix

@ -1,4 +1,4 @@
{ stdenv, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5 }:
{ stdenv, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5, runtimeShell }:
python36Packages.buildPythonApplication rec {
pname = "multibootusb";
name = "${pname}-${version}";
@ -40,7 +40,7 @@ python36Packages.buildPythonApplication rec {
mkdir "$out/bin"
cat > "$out/bin/${pname}" <<EOF
#!${stdenv.shell}
#!${runtimeShell}
cd "$share"
export PYTHONPATH="$PYTHONPATH:$share"
export PATH="$PATH:${parted}/bin:${procps}/bin"

4
pkgs/applications/misc/nix-tour/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchgit, electron } :
{ stdenv, fetchgit, electron, runtimeShell } :
stdenv.mkDerivation rec {
name = "nix-tour-${version}";
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/share
cp -R * $out/share
chmod 0755 $out/share/ -R
echo "#!${stdenv.shell}" > $out/bin/nix-tour
echo "#!${runtimeShell}" > $out/bin/nix-tour
echo "cd $out/share/" >> $out/bin/nix-tour
echo "${electron}/bin/electron $out/share/electron-main.js" >> $out/bin/nix-tour
chmod 0755 $out/bin/nix-tour

4
pkgs/applications/misc/openjump/default.nix

@ -1,4 +1,4 @@
{stdenv, fetchurl, unzip}:
{ stdenv, fetchurl, unzip, runtimeShell }:
stdenv.mkDerivation {
name = "openjump-1.3.1";
@ -17,7 +17,7 @@ stdenv.mkDerivation {
s=$out/bin/OpenJump
dir=$(echo $out/openjump-*)
cat >> $s << EOF
#!${stdenv.shell}
#!${runtimeShell}
cd $dir/bin
exec ${stdenv.shell} openjump.sh
EOF

4
pkgs/applications/misc/terminal-notifier/default.nix

@ -1,4 +1,4 @@
{ stdenv, lib, fetchzip }:
{ stdenv, runtimeShell, lib, fetchzip }:
stdenv.mkDerivation rec {
name = "terminal-notifier-${version}";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin
cp -r terminal-notifier.app $out/Applications
cat >$out/bin/terminal-notifier <<EOF
#!${stdenv.shell}
#!${runtimeShell}
cd $out/Applications/terminal-notifier.app
exec ./Contents/MacOS/terminal-notifier "\$@"
EOF

10
pkgs/applications/misc/thinking-rock/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, runtimeShell }:
stdenv.mkDerivation {
name = "thinkingrock-binary-2.2.1";
@ -11,7 +11,7 @@ stdenv.mkDerivation {
/* it would be a really bad idea to put thinkingrock tr executable in PATH!
the tr.sh script does use the coreutils tr itself
That's why I've renamed the wrapper and called it thinkingrock
However you may not rename the bin/tr script cause it will notice and throw an
However you may not rename the bin/tr script cause it will notice and throw an
"java.lang.IllegalArgumentException: Malformed branding token: thinkingrock"
exception. I hope that's fine
*/
@ -24,15 +24,15 @@ stdenv.mkDerivation {
mkdir -p $out/{nix-support/tr-files,bin}
cp -r . $out/nix-support/tr-files
cat >> $out/bin/thinkingrock << EOF
#!${stdenv.shell}
#!${runtimeShell}
exec $out/nix-support/tr-files/bin/tr "$@"
EOF
chmod +x $out/bin/thinkingrock
'';
installPhase = ":";
meta = {
meta = {
description = "Task management system";
homepage = http://www.thinkingrock.com.au/;
license = "CDDL"; # Common Development and Distribution License

4
pkgs/applications/misc/vue/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre }:
{ stdenv, fetchurl, jre, runtimeShell }:
stdenv.mkDerivation rec {
name = "vue-${version}";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p "$out"/{share/vue,bin}
cp ${src} "$out/share/vue/vue.jar"
echo '#!${stdenv.shell}' >> "$out/bin/vue"
echo '#!${runtimeShell}' >> "$out/bin/vue"
echo '${jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue"
chmod a+x "$out/bin/vue"
'';

3
pkgs/applications/networking/browsers/firefox-bin/update.nix

@ -8,6 +8,7 @@
, gnugrep
, curl
, gnupg
, runtimeShell
, baseName ? "firefox"
, basePath ? "pkgs/applications/networking/browsers/firefox-bin"
, baseUrl
@ -18,7 +19,7 @@ let
channel != "release";
in writeScript "update-${name}" ''
#!${stdenv.shell}
#!${runtimeShell}
PATH=${coreutils}/bin:${gnused}/bin:${gnugrep}/bin:${xidel}/bin:${curl}/bin:${gnupg}/bin
set -eux
pushd ${basePath}

3
pkgs/applications/networking/browsers/firefox/update.nix

@ -8,13 +8,14 @@
, gnugrep
, curl
, attrPath
, runtimeShell
, baseUrl ? "http://archive.mozilla.org/pub/firefox/releases/"
, versionSuffix ? ""
, versionKey ? "version"
}:
writeScript "update-${attrPath}" ''
#!${stdenv.shell}
#!${runtimeShell}
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnused xidel ]}
url=${baseUrl}

7
pkgs/applications/networking/instant-messengers/telegram/telegram-cli/default.nix

@ -1,5 +1,6 @@
{ stdenv, fetchgit, bash, libconfig, libevent, openssl,
readline, zlib, lua5_2, python, pkgconfig, jansson
{ stdenv, fetchgit, bash, libconfig, libevent, openssl
, readline, zlib, lua5_2, python, pkgconfig, jansson
, runtimeShell
}:
stdenv.mkDerivation rec {
@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
cp ./bin/telegram-cli $out/bin/telegram-wo-key
cp ./tg-server.pub $out/
cat > $out/bin/telegram-cli <<EOF
#!${stdenv.shell}
#!${runtimeShell}
$out/bin/telegram-wo-key -k $out/tg-server.pub "\$@"
EOF
chmod +x $out/bin/telegram-cli

4
pkgs/applications/networking/irc/weechat/wrapper.nix

@ -1,5 +1,5 @@
{ stdenv, lib, runCommand, writeScriptBin, buildEnv
, pythonPackages, perlPackages
, pythonPackages, perlPackages, runtimeShell
}:
weechat:
@ -60,7 +60,7 @@ let
in "${scripts};${init}";
mkWeechat = bin: (writeScriptBin bin ''
#!${stdenv.shell}
#!${runtimeShell}
export WEECHAT_EXTRA_LIBDIR=${pluginsDir}
${lib.concatMapStringsSep "\n" (p: lib.optionalString (p ? extraEnv) p.extraEnv) plugins}
exec ${weechat}/bin/${bin} "$@" --run-command ${lib.escapeShellArg init}

4
pkgs/applications/networking/mailreaders/msgviewer/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, unzip, jre }:
{ stdenv, fetchurl, makeWrapper, unzip, jre, runtimeShell }:
let
version = "1.9";
@ -20,7 +20,7 @@ in stdenv.mkDerivation rec {
mv $dir/${uname}/* $dir
rmdir $dir/${uname}
cat <<_EOF > $out/bin/msgviewer
#!${stdenv.shell} -eu
#!${runtimeShell} -eu
exec ${stdenv.lib.getBin jre}/bin/java -jar $dir/MSGViewer.jar "\$@"
_EOF
chmod 755 $out/bin/msgviewer

4
pkgs/applications/networking/mailreaders/neomutt/default.nix

@ -1,11 +1,11 @@
{ stdenv, fetchFromGitHub, gettext, makeWrapper, tcl, which, writeScript
, ncurses, perl , cyrus_sasl, gss, gpgme, kerberos, libidn, libxml2, notmuch, openssl
, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42, mailcap
, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42, mailcap, runtimeShell
}:
let
muttWrapper = writeScript "mutt" ''
#!${stdenv.shell} -eu
#!${runtimeShell} -eu
echo 'The neomutt project has renamed the main binary from `mutt` to `neomutt`.'
echo ""

3
pkgs/applications/office/mendeley/default.nix

@ -32,6 +32,7 @@
, autorunLinkHandler ? true
# Update script
, writeScript
, runtimeShell
}:
let
@ -130,7 +131,7 @@ stdenv.mkDerivation {
dontStrip = true;
dontPatchElf = true;
updateScript = import ./update.nix { inherit stdenv writeScript; };
updateScript = import ./update.nix { inherit stdenv writeScript runtimeShell; };
meta = with stdenv.lib; {
homepage = http://www.mendeley.com;

4
pkgs/applications/office/mendeley/update.nix

@ -1,7 +1,7 @@
{ stdenv, writeScript }:
{ stdenv, writeScript, runtimeShell }:
writeScript "update-mendeley" ''
#!${stdenv.shell}
#!${runtimeShell}
function follow() {
local URL=$1
while true; do

5
pkgs/applications/office/moneyplex/default.nix

@ -1,5 +1,6 @@
{ stdenv, fetchurl, patchelf, coreutils, pcsclite
, zlib, glib, gdk_pixbuf, gtk2, cairo, pango, libX11, atk, openssl }:
, zlib, glib, gdk_pixbuf, gtk2, cairo, pango, libX11, atk, openssl
, runtimeShell }:
let
libPath = stdenv.lib.makeLibraryPath [
@ -38,7 +39,7 @@ stdenv.mkDerivation rec {
mkdir "$out/bin"
cat > $out/bin/moneyplex <<EOF
#!${stdenv.shell}
#!${runtimeShell}
if [ -z "\$XDG_DATA_HOME" ]; then
MDIR=\$HOME/.local/share/moneyplex

6
pkgs/applications/science/electronics/alliance/default.nix

@ -1,6 +1,6 @@
{ stdenv, fetchurl
, xorgproto, motif, libX11, libXt, libXpm, bison
, flex, automake, autoconf, libtool
, flex, automake, autoconf, libtool, runtimeShell
}:
stdenv.mkDerivation rec {
@ -39,12 +39,12 @@ stdenv.mkDerivation rec {
'';
allianceInstaller = ''
#!${stdenv.shell}
#!${runtimeShell}
cp -v -r -n --no-preserve=mode $out/etc/* /etc/ > /etc/alliance-install.log
'';
allianceUnInstaller = ''
#!${stdenv.shell}
#!${runtimeShell}
awk '{print \$3}' /etc/alliance-install.log | xargs rm
awk '{print \$3}' /etc/alliance-install.log | xargs rmdir
rm /etc/alliance-install.log

4
pkgs/applications/science/electronics/eagle/eagle7.nix

@ -1,6 +1,6 @@
{ stdenv, fetchurl, makeDesktopItem, patchelf, zlib, freetype, fontconfig
, openssl, libXrender, libXrandr, libXcursor, libX11, libXext, libXi
, libxcb, cups, xkeyboardconfig
, libxcb, cups, xkeyboardconfig, runtimeShell
}:
let
@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
dynlinker="$(cat $NIX_CC/nix-support/dynamic-linker)"
mkdir -p "$out"/bin
cat > "$out"/bin/eagle << EOF
#!${stdenv.shell}
#!${runtimeShell}
export LD_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib:${libPath}"
export LD_PRELOAD="$out/lib/eagle_fixer.so"
export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"

4
pkgs/applications/science/logic/hol_light/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, ocaml, num, camlp5 }:
{ stdenv, runtimeShell, fetchFromGitHub, ocaml, num, camlp5 }:
let
load_num =
@ -11,7 +11,7 @@ let
start_script =
''
#!${stdenv.shell}
#!${runtimeShell}
cd $out/lib/hol_light
exec ${ocaml}/bin/ocaml \
-I \`${camlp5}/bin/camlp5 -where\` \

4
pkgs/applications/science/logic/leo3/binary.nix

@ -1,4 +1,4 @@
{stdenv, fetchurl, openjdk}:
{stdenv, fetchurl, openjdk, runtimeShell}:
stdenv.mkDerivation rec {
pname = "leo3";
version = "1.2";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p "$out"/{bin,lib/java/leo3}
cp "${jar}" "$out/lib/java/leo3/leo3.jar"
echo "#!${stdenv.shell}" > "$out/bin/leo3"
echo "#!${runtimeShell}" > "$out/bin/leo3"
echo "'${openjdk}/bin/java' -jar '$out/lib/java/leo3/leo3.jar' \"\$@\"" > "$out/bin/leo3"
chmod a+x "$out/bin/leo3"
'';

3
pkgs/applications/science/math/sage/sage-src.nix

@ -1,6 +1,7 @@
{ stdenv
, fetchFromGitHub
, fetchpatch
, runtimeShell
}:
# This file is responsible for fetching the sage source and adding necessary patches.
@ -121,7 +122,7 @@ stdenv.mkDerivation rec {
-e 's/sage-python23/python/g' \
-i {} \;
echo '#!${stdenv.shell}
echo '#!${runtimeShell}
python "$@"' > build/bin/sage-python23
# Do not use sage-env-config (generated by ./configure).

4
pkgs/applications/video/dvd-slideshow/default.nix

@ -1,10 +1,10 @@
{ stdenv, lib, fetchurl, writeScript, cdrtools, dvdauthor, ffmpeg, imagemagick, lame, mjpegtools, sox, transcode, vorbis-tools }:
{ stdenv, lib, fetchurl, writeScript, cdrtools, dvdauthor, ffmpeg, imagemagick, lame, mjpegtools, sox, transcode, vorbis-tools, runtimeShell }:
let
binPath = lib.makeBinPath [ cdrtools dvdauthor ffmpeg imagemagick lame mjpegtools sox transcode vorbis-tools ];
wrapper = writeScript "dvd-slideshow.sh" ''
#!${stdenv.shell}
#!${runtimeShell}
# wrapper script for dvd-slideshow programs
export PATH=${binPath}:$PATH

7
pkgs/build-support/docker/default.nix

@ -23,7 +23,8 @@
writeScript,
writeText,
closureInfo,
substituteAll
substituteAll,
runtimeShell
}:
# WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
@ -119,7 +120,7 @@ rec {
export PATH=${shadow}/bin:$PATH
mkdir -p /etc/pam.d
if [[ ! -f /etc/passwd ]]; then
echo "root:x:0:0::/root:${stdenv.shell}" > /etc/passwd
echo "root:x:0:0::/root:${runtimeShell}" > /etc/passwd
echo "root:!x:::::::" > /etc/shadow
fi
if [[ ! -f /etc/group ]]; then
@ -261,7 +262,7 @@ rec {
# things like `ls` or `echo` will be missing.
shellScript = name: text:
writeScript name ''
#!${stdenv.shell}
#!${runtimeShell}
set -e
export PATH=${coreutils}/bin:/bin
${text}

2
pkgs/build-support/release/ant-build.nix

@ -69,7 +69,7 @@ stdenv.mkDerivation (
mkdir -p $out/bin
cat >> $out/bin/${w.name} <<EOF
#!${stdenv.shell}
#!${pkgs.runtimeShell}
export JAVA_HOME=$jre
$jre/bin/java ${cp w} ${if w ? mainClass then w.mainClass else "-jar ${w.jar}"} \$@
EOF

3
pkgs/build-support/singularity-tools/default.nix

@ -8,12 +8,13 @@
, vmTools
, gawk
, utillinux
, runtimeShell
, e2fsprogs }:
rec {
shellScript = name: text:
writeScript name ''
#!${stdenv.shell}
#!${runtimeShell}
set -e
${text}
'';

14
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/";

3
pkgs/build-support/vm/windows/controller/default.nix

@ -1,5 +1,6 @@
{ stdenv, writeScript, vmTools, makeInitrd
, samba, vde2, openssh, socat, netcat-gnu, coreutils, gnugrep, gzip
, runtimeShell
}:
{ sshKey
@ -74,7 +75,7 @@ let
loopForever = "while :; do ${coreutils}/bin/sleep 1; done";
initScript = writeScript "init.sh" (''
#!${stdenv.shell}
#!${runtimeShell}
${coreutils}/bin/cp -L "${sshKey}" /ssh.key
${coreutils}/bin/chmod 600 /ssh.key
'' + (if installMode then ''

4
pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, substituteAll, writeScript, pantheon, gnome-keyring, gnome-session, wingpanel, orca, at-spi2-core, elementary-default-settings, writeTextFile, writeShellScriptBin, elementary-settings-daemon }:
{ stdenv, fetchFromGitHub, substituteAll, writeScript, pantheon, gnome-keyring, gnome-session, wingpanel, orca, at-spi2-core, elementary-default-settings, writeTextFile, writeShellScriptBin, elementary-settings-daemon, runtimeShell }:
let
@ -15,7 +15,7 @@ let
#
dockitems-script = writeScript "dockitems-script" ''
#!${stdenv.shell}
#!${runtimeShell}
elementary_default_settings="${elementary-default-settings}"
dock_items="$elementary_default_settings/share/elementary/config/plank/dock1/launchers"/*

4
pkgs/development/compilers/ccl/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, bootstrap_cmds, coreutils, glibc, m4 }:
{ stdenv, fetchurl, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }:
let
options = rec {
@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
cp -r . "$out/share/ccl-installation"
mkdir -p "$out/bin"
echo -e '#!${stdenv.shell}\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
echo -e '#!${runtimeShell}\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
chmod a+x "$out"/bin/"${CCL_RUNTIME}"
ln -s "$out"/bin/"${CCL_RUNTIME}" "$out"/bin/ccl
'';

4
pkgs/development/compilers/cmdstan/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python }:
{ stdenv, fetchurl, python, runtimeShell }:
stdenv.mkDerivation rec {
name = "cmdstan-2.17.1";
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
ln -s $out/opt/cmdstan/bin/stanc $out/bin/stanc
ln -s $out/opt/cmdstan/bin/stansummary $out/bin/stansummary
cat > $out/bin/stan <<EOF
#!${stdenv.shell}
#!${runtimeShell}
make -C $out/opt/cmdstan "\$(realpath "\$1")"
EOF
chmod a+x $out/bin/stan

6
pkgs/development/compilers/go/1.11.nix

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
, perl, which, pkgconfig, patch, procps, pcre, cacert, llvm, Security, Foundation
, mailcap
, mailcap, runtimeShell
, buildPackages, targetPackages }:
let
@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${stdenv.shell}'
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
# Patch the mimetype database location which is missing on NixOS.
substituteInPlace src/mime/type_unix.go \
@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
'' + optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
'' + optionalString stdenv.isAarch32 ''
echo '#!${stdenv.shell}' > misc/cgo/testplugin/test.bash
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
'' + optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true

4
pkgs/development/libraries/safefile/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, path }:
{ stdenv, fetchurl, path, runtimeShell }:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "safefile";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
passthru = {
updateScript = ''
#!${stdenv.shell}
#!${runtimeShell}
cd ${toString ./.}
${toString path}/pkgs/build-support/upstream-updater/update-walker.sh default.nix
'';

6
pkgs/development/misc/avr8-burn-omat/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchurl, unzip }:
{ stdenv, fetchurl, unzip, runtimeShell }:
stdenv.mkDerivation {
name = "avr8-burn-omat-2.1.2";
@ -18,8 +18,8 @@ stdenv.mkDerivation {
mkdir -p $out/{nix-support,bin}
mv *.jar license_gpl-3.0.txt lib *.xml *.png $out/nix-support
cat >> $out/bin/avr8-burn-omat << EOF
#!${stdenv.shell}
cd $out/nix-support; exec java -jar AVR8_Burn_O_Mat.jar
#!${runtimeShell}
cd $out/nix-support; exec java -jar AVR8_Burn_O_Mat.jar
EOF
chmod +x $out/bin/avr8-burn-omat
'';

3
pkgs/development/pharo/vm/build-vm.nix

@ -13,6 +13,7 @@
, libuuid
, autoreconfHook
, gcc48
, runtimeShell
, ... }:
{ name, src, version, source-date, source-url, ... }:
@ -114,7 +115,7 @@ stdenv.mkDerivation rec {
# Create the script
cat > "$out/bin/${cmd}" <<EOF
#!${stdenv.shell}
#!${runtimeShell}
set -f
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@"
EOF

2
pkgs/development/pharo/vm/vms.nix

@ -17,6 +17,7 @@
, gcc48
, fetchFromGitHub
, makeWrapper
, runtimeShell
} @args:
let
@ -62,4 +63,3 @@ rec {
};
}

5
pkgs/development/python-modules/cmd2/old.nix

@ -2,6 +2,7 @@
, pyperclip, six, pyparsing, vim
, contextlib2 ? null, subprocess32 ? null
, pytest, mock, which, fetchFromGitHub, glibcLocales
, runtimeShell
}:
buildPythonPackage rec {
pname = "cmd2";
@ -19,8 +20,8 @@ buildPythonPackage rec {
postPatch = stdenv.lib.optional stdenv.isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy
mkdir bin
echo '#${stdenv.shell}' > bin/pbpaste
echo '#${stdenv.shell}' > bin/pbcopy
echo '#${runtimeShell}' > bin/pbpaste
echo '#${runtimeShell}' > bin/pbcopy
chmod +x bin/{pbcopy,pbpaste}
export PATH=$(realpath bin):$PATH
'';

5
pkgs/development/python-modules/pandas/default.nix

@ -20,6 +20,7 @@
, openpyxl
, tables
, xlwt
, runtimeShell
, libcxx ? null
}:
@ -97,8 +98,8 @@ in buildPythonPackage rec {
# Until then we disable the tests.
+ optionalString isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy
echo "#!${stdenv.shell}" > pbcopy
echo "#!${stdenv.shell}" > pbpaste
echo "#!${runtimeShell}" > pbcopy
echo "#!${runtimeShell}" > pbpaste
chmod a+x pbcopy pbpaste
export PATH=$(pwd):$PATH
'' + ''

4
pkgs/development/tools/analysis/jdepend/default.nix

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, ant, jdk }:
{ stdenv, fetchFromGitHub, ant, jdk, runtimeShell }:
stdenv.mkDerivation rec {
name = "jdepend-${version}";
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
install dist/${name}.jar $out/share
cat > "$out/bin/jdepend" <<EOF
#!${stdenv.shell}
#!${runtimeShell}
exec ${jdk.jre}/bin/java -classpath "$out/share/*" "\$@"
EOF