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/development | |
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/development')
23 files changed, 55 insertions, 44 deletions
diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix index ae6af8dd4b4f..646963eedbca 100644 --- a/pkgs/development/compilers/ccl/default.nix +++ b/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 ''; diff --git a/pkgs/development/compilers/cmdstan/default.nix b/pkgs/development/compilers/cmdstan/default.nix index 3d9fe3a59cfd..960a54489da4 100644 --- a/pkgs/development/compilers/cmdstan/default.nix +++ b/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 diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix index 1c9bc0a30091..db3731c2fcaa 100644 --- a/pkgs/development/compilers/go/1.11.nix +++ b/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 diff --git a/pkgs/development/libraries/safefile/default.nix b/pkgs/development/libraries/safefile/default.nix index d09e45a2d1e9..daa499061c5b 100644 --- a/pkgs/development/libraries/safefile/default.nix +++ b/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 ''; diff --git a/pkgs/development/misc/avr8-burn-omat/default.nix b/pkgs/development/misc/avr8-burn-omat/default.nix index 4ddab380825d..c88b780d164a 100644 --- a/pkgs/development/misc/avr8-burn-omat/default.nix +++ b/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 ''; diff --git a/pkgs/development/pharo/vm/build-vm.nix b/pkgs/development/pharo/vm/build-vm.nix index 76e52692383f..47773c209545 100644 --- a/pkgs/development/pharo/vm/build-vm.nix +++ b/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 diff --git a/pkgs/development/pharo/vm/vms.nix b/pkgs/development/pharo/vm/vms.nix index 19065f972a41..0e65a9b990ed 100644 --- a/pkgs/development/pharo/vm/vms.nix +++ b/pkgs/development/pharo/vm/vms.nix @@ -17,6 +17,7 @@ , gcc48 , fetchFromGitHub , makeWrapper +, runtimeShell } @args: let @@ -62,4 +63,3 @@ rec { }; } - diff --git a/pkgs/development/python-modules/cmd2/old.nix b/pkgs/development/python-modules/cmd2/old.nix index c6ee1eaf8bc0..8f75170c58c4 100644 --- a/pkgs/development/python-modules/cmd2/old.nix +++ b/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 ''; diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 2562975e5922..1944e23f4b49 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/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 '' + '' diff --git a/pkgs/development/tools/analysis/jdepend/default.nix b/pkgs/development/tools/analysis/jdepend/default.nix index d2c27b9f4853..939ae10c089d 100644 --- a/pkgs/development/tools/analysis/jdepend/default.nix +++ b/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 chmod a+x $out/bin/jdepend diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix index 32d35f1421c8..eb9f0d106d10 100644 --- a/pkgs/development/tools/build-managers/bazel/default.nix +++ b/pkgs/development/tools/build-managers/bazel/default.nix @@ -6,6 +6,7 @@ # Allow to independently override the jdks used to build and run respectively , buildJdk, runJdk , buildJdkName +, runtimeShell # Always assume all markers valid (don't redownload dependencies). # Also, don't clean up environment variables. , enableNixHacks ? false @@ -281,7 +282,7 @@ stdenv.mkDerivation rec { mkdir -p tools cat > tools/bazel <<"EOF" - #!${stdenv.shell} -e + #!${runtimeShell} -e exit 1 EOF chmod +x tools/bazel @@ -290,7 +291,7 @@ stdenv.mkDerivation rec { ! hello_test cat > tools/bazel <<"EOF" - #!${stdenv.shell} -e + #!${runtimeShell} -e exec "$BAZEL_REAL" "$@" EOF diff --git a/pkgs/development/tools/build-managers/gup/default.nix b/pkgs/development/tools/build-managers/gup/default.nix index 7fd801488311..baa658b522a3 100644 --- a/pkgs/development/tools/build-managers/gup/default.nix +++ b/pkgs/development/tools/build-managers/gup/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, nix-update-source, lib, python, which, pychecker ? null }: +{ stdenv, fetchFromGitHub, nix-update-source, lib, python +, which, runtimeShell, pychecker ? null }: stdenv.mkDerivation rec { version = "0.7.0"; src = fetchFromGitHub { @@ -16,7 +17,7 @@ stdenv.mkDerivation rec { cp -r python/bin $out/bin ''; passthru.updateScript = '' - #!${stdenv.shell} + #!${runtimeShell} set -e echo cd ${toString ./.} diff --git a/pkgs/development/tools/haskell/hyper-haskell/default.nix b/pkgs/development/tools/haskell/hyper-haskell/default.nix index a2a049615b78..3b52c262c0c6 100644 --- a/pkgs/development/tools/haskell/hyper-haskell/default.nix +++ b/pkgs/development/tools/haskell/hyper-haskell/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, jshon, electron, hyper-haskell-server, extra-packages ? [] }: +{ stdenv, fetchFromGitHub, jshon, electron +, runtimeShell, hyper-haskell-server, extra-packages ? [] }: let binPath = stdenv.lib.makeBinPath ([ hyper-haskell-server ] ++ extra-packages); @@ -34,7 +35,7 @@ in stdenv.mkDerivation rec { # install electron wrapper script cat > $out/bin/hyper-haskell <<EOF - #!${stdenv.shell} + #!${runtimeShell} export PATH="${binPath}:\$PATH" exec ${electron}/bin/electron $out/app "\$@" EOF diff --git a/pkgs/development/tools/misc/ccls/default.nix b/pkgs/development/tools/misc/ccls/default.nix index 11e02eba5663..c8ab6b0fd963 100644 --- a/pkgs/development/tools/misc/ccls/default.nix +++ b/pkgs/development/tools/misc/ccls/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, makeWrapper -, cmake, llvmPackages, rapidjson }: +, cmake, llvmPackages, rapidjson, runtimeShell }: stdenv.mkDerivation rec { name = "ccls-${version}"; @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DSYSTEM_CLANG=ON" ]; - shell = stdenv.shell; + shell = runtimeShell; postFixup = '' # We need to tell ccls where to find the standard library headers. diff --git a/pkgs/development/tools/misc/cquery/default.nix b/pkgs/development/tools/misc/cquery/default.nix index f032a85173a5..54ad7ca7071c 100644 --- a/pkgs/development/tools/misc/cquery/default.nix +++ b/pkgs/development/tools/misc/cquery/default.nix @@ -1,5 +1,6 @@ { fetchFromGitHub, makeWrapper -, cmake, llvmPackages, ncurses }: +, cmake, llvmPackages, ncurses +, runtimeShell }: let src = fetchFromGitHub { @@ -28,7 +29,7 @@ stdenv.mkDerivation rec { "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12" ]; - shell = stdenv.shell; + shell = runtimeShell; postFixup = '' # We need to tell cquery where to find the standard library headers. diff --git a/pkgs/development/tools/misc/ctags/wrapped.nix b/pkgs/development/tools/misc/ctags/wrapped.nix index ed265b4489b3..869e7a61121d 100644 --- a/pkgs/development/tools/misc/ctags/wrapped.nix +++ b/pkgs/development/tools/misc/ctags/wrapped.nix @@ -14,7 +14,7 @@ with pkgs.stdenv.lib; # the derivation. use language extensions specified by args ctagsWrapped = makeOverridable ( {args, name} : pkgs.writeScriptBin name '' - #!${stdenv.shell} + #!${pkgs.runtimeShell} exec ${pkgs.ctags}/bin/ctags ${concatStringsSep " " (map escapeShellArg args)} "$@" '') { args = let x = pkgs.ctagsWrapped; in concatLists [ diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix index e80a37d37dd5..9891726c6633 100644 --- a/pkgs/development/tools/misc/distcc/default.nix +++ b/pkgs/development/tools/misc/distcc/default.nix @@ -1,5 +1,6 @@ { stdenv, fetchFromGitHub, popt, avahi, pkgconfig, python, gtk2, runCommand , gcc, autoconf, automake, which, procps, libiberty_static +, runtimeShell , sysconfDir ? "" # set this parameter to override the default value $out/etc , static ? false }: @@ -53,7 +54,7 @@ let mkdir -p $out/bin if [ -x "${gcc.cc}/bin/gcc" ]; then cat > $out/bin/gcc << EOF - #!${stdenv.shell} + #!${runtimeShell} ${extraConfig} exec ${distcc}/bin/distcc gcc "\$@" EOF @@ -61,7 +62,7 @@ let fi if [ -x "${gcc.cc}/bin/g++" ]; then cat > $out/bin/g++ << EOF - #!${stdenv.shell} + #!${runtimeShell} ${extraConfig} exec ${distcc}/bin/distcc g++ "\$@" EOF diff --git a/pkgs/development/tools/misc/opengrok/default.nix b/pkgs/development/tools/misc/opengrok/default.nix index f7b77cdc418d..874aa04157dc 100644 --- a/pkgs/development/tools/misc/opengrok/default.nix +++ b/pkgs/development/tools/misc/opengrok/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, jre, ctags, makeWrapper, coreutils, git }: +{ stdenv, fetchurl, jre, ctags, makeWrapper, coreutils, git, runtimeShell }: stdenv.mkDerivation rec { name = "opengrok-${version}"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { mkdir -p $out cp -a * $out/ substituteInPlace $out/bin/OpenGrok --replace "/bin/uname" "${coreutils}/bin/uname" - substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!${stdenv.shell}" + substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!${runtimeShell}" wrapProgram $out/bin/OpenGrok \ --prefix PATH : "${stdenv.lib.makeBinPath [ ctags git ]}" \ --set JAVA_HOME "${jre}" \ diff --git a/pkgs/development/tools/misc/saleae-logic/default.nix b/pkgs/development/tools/misc/saleae-logic/default.nix index c89492287db4..18ffc238f0d1 100644 --- a/pkgs/development/tools/misc/saleae-logic/default.nix +++ b/pkgs/development/tools/misc/saleae-logic/default.nix @@ -9,7 +9,7 @@ { stdenv, fetchurl, unzip, glib, libSM, libICE, gtk2, libXext, libXft , fontconfig, libXrender, libXfixes, libX11, libXi, libXrandr, libXcursor , freetype, libXinerama, libxcb, zlib, pciutils -, makeDesktopItem, xkeyboardconfig +, makeDesktopItem, xkeyboardconfig, runtimeShell }: let @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { # Make wrapper script that uses the LD_PRELOAD library mkdir -p "$out/bin" cat > "$out/bin/saleae-logic" << EOF - #!${stdenv.shell} + #!${runtimeShell} export LD_PRELOAD="$out/lib/preload.so" export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb" export PATH="${pciutils}/bin:\$PATH" diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix index 5a1c2364a777..a1f5e5769ae8 100644 --- a/pkgs/development/tools/rust/bindgen/default.nix +++ b/pkgs/development/tools/rust/bindgen/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, rustPlatform, clang, llvmPackages, rustfmt, writeScriptBin }: +{ stdenv, fetchFromGitHub, rustPlatform, clang, llvmPackages, rustfmt, writeScriptBin, + runtimeShell }: rustPlatform.buildRustPackage rec { name = "rust-bindgen-${version}"; @@ -32,7 +33,7 @@ rustPlatform.buildRustPackage rec { doCheck = true; checkInputs = let fakeRustup = writeScriptBin "rustup" '' - #!${stdenv.shell} + #!${runtimeShell} shift shift exec "$@" diff --git a/pkgs/development/tools/wp-cli/default.nix b/pkgs/development/tools/wp-cli/default.nix index e2250297c8eb..211f71693976 100644 --- a/pkgs/development/tools/wp-cli/default.nix +++ b/pkgs/development/tools/wp-cli/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, writeScript, writeText, php }: +{ stdenv, lib, fetchurl, writeScript, writeText, php, runtimeShell }: let version = "2.0.1"; @@ -22,7 +22,7 @@ in stdenv.mkDerivation rec { mkdir -p $out/bin $dir cat <<_EOF > $out/bin/wp -#!${stdenv.shell} +#!${runtimeShell} set -euo pipefail diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix index b2455095a01a..959c79405e86 100644 --- a/pkgs/development/tools/xcbuild/wrapper.nix +++ b/pkgs/development/tools/xcbuild/wrapper.nix @@ -1,5 +1,6 @@ { stdenv, lib, buildPackages, makeWrapper, writeText, runCommand , CoreServices, ImageIO, CoreGraphics +, runtimeShell , xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX" , xcodeVer ? stdenv.targetPlatform.xcodeVer or "9.4.1" , sdkVer ? stdenv.targetPlatform.sdkVer or "10.10" }: @@ -35,7 +36,7 @@ let ''; xcode-select = writeText "xcode-select" '' -#!${stdenv.shell} +#!${runtimeShell} while [ $# -gt 0 ]; do case "$1" in -h | --help) ;; # noop @@ -50,7 +51,7 @@ done ''; xcrun = writeText "xcrun" '' -#!${stdenv.shell} +#!${runtimeShell} while [ $# -gt 0 ]; do case "$1" in --sdk | -sdk) shift ;; diff --git a/pkgs/development/web/nodejs/update.nix b/pkgs/development/web/nodejs/update.nix index bf6951dc6882..7b5a4710aa09 100644 --- a/pkgs/development/web/nodejs/update.nix +++ b/pkgs/development/web/nodejs/update.nix @@ -9,10 +9,11 @@ , common-updater-scripts , majorVersion , nix +, runtimeShell }: writeScript "update-nodejs" '' - #!${stdenv.shell} + #!${runtimeShell} PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep jq gnupg nix ]} HOME=`mktemp -d` |