treewide: use ${stdenv.shell} instead of /bin/sh where possible

This commit is contained in:
rnhmjoj 2019-01-15 23:41:31 +01:00
parent 3956a8421f
commit bcf54ce5bb
No known key found for this signature in database
GPG key ID: 91BE884FBA4B591A
92 changed files with 156 additions and 120 deletions

View file

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out/{bin,share} mkdir -p $out/{bin,share}
cp $src $out/share/standardNotes.AppImage cp $src $out/share/standardNotes.AppImage
echo "#!/bin/sh" > $out/bin/standardnotes echo "#!${stdenv.shell}" > $out/bin/standardnotes
echo "${appimage-run}/bin/appimage-run $out/share/standardNotes.AppImage" >> $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 chmod +x $out/bin/standardnotes $out/share/standardNotes.AppImage
''; '';

View file

@ -115,7 +115,7 @@ in stdenv.mkDerivation (rec {
mkdir -p $out/bin mkdir -p $out/bin
cat > $out/bin/subl <<-EOF cat > $out/bin/subl <<-EOF
#!/bin/sh #!${stdenv.shell}
exec $sublime/sublime_text "\$@" exec $sublime/sublime_text "\$@"
EOF EOF
chmod +x $out/bin/subl chmod +x $out/bin/subl

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin $out/share mkdir -p $out/bin $out/share
cp -a . $out/share/alchemy cp -a . $out/share/alchemy
cat >> $out/bin/alchemy << EOF cat >> $out/bin/alchemy << EOF
#!/bin/sh #!${stdenv.shell}
cd $out/share/alchemy cd $out/share/alchemy
${jre}/bin/java -jar Alchemy.jar "$@" ${jre}/bin/java -jar Alchemy.jar "$@"
EOF EOF

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
installPhase = let installPhase = let
execWrapper = '' execWrapper = ''
#!/bin/sh #!${stdenv.shell}
exec ${jre}/bin/java -jar $out/share/java/swingsane/swingsane-${version}.jar "$@" exec ${jre}/bin/java -jar $out/share/java/swingsane/swingsane-${version}.jar "$@"
''; '';

View file

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
cp ebin/* $out/lib/${name}/ebin cp ebin/* $out/lib/${name}/ebin
cp -R textures shaders plugins $out/lib/$name cp -R textures shaders plugins $out/lib/$name
cat << EOF > $out/bin/wings cat << EOF > $out/bin/wings
#!/bin/sh #!${stdenv.shell}
${erlang}/bin/erl \ ${erlang}/bin/erl \
-pa $out/lib/${name}/ebin -run wings_start start_halt "$@" -pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
EOF EOF

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
cp -r target/* "$out/share/java/zvtm/" cp -r target/* "$out/share/java/zvtm/"
echo '#!/bin/sh' > "$out/bin/zgrviewer" echo '#!${stdenv.shell}' > "$out/bin/zgrviewer"
echo "${jre}/lib/openjdk/jre/bin/java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar' \"\$@\"" >> "$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" chmod a+x "$out/bin/zgrviewer"
''; '';

View file

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
mkdir $out/bin mkdir $out/bin
cat > $out/bin/curabydago <<EOF cat > $out/bin/curabydago <<EOF
#!/bin/sh #!${stdenv.shell}
export PYTHONPATH=$PYTHONPATH export PYTHONPATH=$PYTHONPATH
${python.out}/bin/python $out/curabydago/cura.py ${python.out}/bin/python $out/curabydago/cura.py
EOF EOF

View file

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh
cat >$out/bin/freemind <<EOF cat >$out/bin/freemind <<EOF
#! /bin/sh #! ${stdenv.shell}
JAVA_HOME=${jre} $out/nix-support/dist/freemind.sh JAVA_HOME=${jre} $out/nix-support/dist/freemind.sh
EOF EOF
chmod +x $out/{bin/freemind,nix-support/dist/freemind.sh} chmod +x $out/{bin/freemind,nix-support/dist/freemind.sh}

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{ lib, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5 }: { stdenv, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5 }:
python36Packages.buildPythonApplication rec { python36Packages.buildPythonApplication rec {
pname = "multibootusb"; pname = "multibootusb";
name = "${pname}-${version}"; name = "${pname}-${version}";
@ -40,7 +40,7 @@ python36Packages.buildPythonApplication rec {
mkdir "$out/bin" mkdir "$out/bin"
cat > "$out/bin/${pname}" <<EOF cat > "$out/bin/${pname}" <<EOF
#!/bin/sh #!${stdenv.shell}
cd "$share" cd "$share"
export PYTHONPATH="$PYTHONPATH:$share" export PYTHONPATH="$PYTHONPATH:$share"
export PATH="$PATH:${parted}/bin:${procps}/bin" export PATH="$PATH:${parted}/bin:${procps}/bin"
@ -50,7 +50,7 @@ python36Packages.buildPythonApplication rec {
chmod +x "$out/bin/${pname}" chmod +x "$out/bin/${pname}"
''; '';
meta = with lib; { meta = with stdenv.lib; {
description = "Multiboot USB creator for Linux live disks"; description = "Multiboot USB creator for Linux live disks";
homepage = http://multibootusb.org/; homepage = http://multibootusb.org/;
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -17,9 +17,9 @@ stdenv.mkDerivation {
s=$out/bin/OpenJump s=$out/bin/OpenJump
dir=$(echo $out/openjump-*) dir=$(echo $out/openjump-*)
cat >> $s << EOF cat >> $s << EOF
#!/bin/sh #!${stdenv.shell}
cd $dir/bin cd $dir/bin
exec /bin/sh openjump.sh exec ${stdenv.shell} openjump.sh
EOF EOF
chmod +x $s chmod +x $s
ln -s /tmp/openjump.log $dir/bin/jump.log ln -s /tmp/openjump.log $dir/bin/jump.log

View file

@ -24,7 +24,7 @@ stdenv.mkDerivation {
mkdir -p $out/{nix-support/tr-files,bin} mkdir -p $out/{nix-support/tr-files,bin}
cp -r . $out/nix-support/tr-files cp -r . $out/nix-support/tr-files
cat >> $out/bin/thinkingrock << EOF cat >> $out/bin/thinkingrock << EOF
#!/bin/sh #!${stdenv.shell}
exec $out/nix-support/tr-files/bin/tr "$@" exec $out/nix-support/tr-files/bin/tr "$@"
EOF EOF
chmod +x $out/bin/thinkingrock chmod +x $out/bin/thinkingrock

View file

@ -21,7 +21,7 @@ in stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
# we do all patching from update.sh in preAutoreconf # we do all patching from update.sh in preAutoreconf
echo "#!/bin/sh" > update.sh echo "#!${stdenv.shell}" > update.sh
''; '';
preAutoreconf = '' preAutoreconf = ''

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
cp ./bin/telegram-cli $out/bin/telegram-wo-key cp ./bin/telegram-cli $out/bin/telegram-wo-key
cp ./tg-server.pub $out/ cp ./tg-server.pub $out/
cat > $out/bin/telegram-cli <<EOF cat > $out/bin/telegram-cli <<EOF
#!${bash}/bin/sh #!${stdenv.shell}
$out/bin/telegram-wo-key -k $out/tg-server.pub "\$@" $out/bin/telegram-wo-key -k $out/tg-server.pub "\$@"
EOF EOF
chmod +x $out/bin/telegram-cli chmod +x $out/bin/telegram-cli

View file

@ -11,7 +11,7 @@ let
start_script = start_script =
'' ''
#!/bin/sh #!${stdenv.shell}
cd $out/lib/hol_light cd $out/lib/hol_light
exec ${ocaml}/bin/ocaml \ exec ${ocaml}/bin/ocaml \
-I \`${camlp5}/bin/camlp5 -where\` \ -I \`${camlp5}/bin/camlp5 -where\` \

View file

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
mkdir -p "$out/share/${name}" mkdir -p "$out/share/${name}"
cp *.p "$out/share/${name}" cp *.p "$out/share/${name}"
echo -e "#! /bin/sh\\n$out/bin/iproveropt --clausifier \"${eprover}/bin/eprover\" --clausifier_options \" --tstp-format --silent --cnf \" \"\$@\"" > "$out"/bin/iprover echo -e "#! ${stdenv.shell}\\n$out/bin/iproveropt --clausifier \"${eprover}/bin/eprover\" --clausifier_options \" --tstp-format --silent --cnf \" \"\$@\"" > "$out"/bin/iprover
chmod a+x "$out"/bin/iprover chmod a+x "$out"/bin/iprover
''; '';

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, lib, makeWrapper { stdenv, fetchurl, lib, makeWrapper
, substituteAll
, jre , jre
, gtk2, glib , gtk2, glib
, libXtst , libXtst
@ -21,7 +22,10 @@ stdenv.mkDerivation rec {
buildCommand = let buildCommand = let
pkg_path = "$out/${name}"; pkg_path = "$out/${name}";
bin_path = "$out/bin"; bin_path = "$out/bin";
install_freedesktop_items = ./install_freedesktop_items.sh; install_freedesktop_items = substituteAll {
inherit (stdenv) shell;
src = ./install_freedesktop_items.sh;
};
runtime_paths = lib.makeBinPath [ runtime_paths = lib.makeBinPath [
jre jre
#git mercurial subversion # the paths are requested in configuration #git mercurial subversion # the paths are requested in configuration

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
inBinDir=$1 inBinDir=$1
out=$2 out=$2

View file

@ -21,7 +21,7 @@ mkDerivation rec {
install -m644 -t $out/share/licenses Copyright/{*.*,_copyright} install -m644 -t $out/share/licenses Copyright/{*.*,_copyright}
bin="$out/bin/mediathek" bin="$out/bin/mediathek"
cat >> "$bin" << EOF cat >> "$bin" << EOF
#!/bin/sh #!${stdenv.shell}
exec ${jre}/bin/java -cp "$out/lib/*" -Xms128M -Xmx1G -jar "$out/MediathekView.jar" "\$@" exec ${jre}/bin/java -cp "$out/lib/*" -Xms128M -Xmx1G -jar "$out/MediathekView.jar" "\$@"
EOF EOF
chmod +x "$bin" chmod +x "$bin"

View file

@ -86,14 +86,14 @@ stdenv.mkDerivation (rec {
# Fake git: just print what it wants and die # Fake git: just print what it wants and die
cat > fake-bin/wget << EOF cat > fake-bin/wget << EOF
#!/bin/sh -e #!${stdenv.shell} -e
echo ===== FAKE WGET: Not fetching \$* echo ===== FAKE WGET: Not fetching \$*
[ -e \$3 ] [ -e \$3 ]
EOF EOF
# Fake git: just print what it wants and die # Fake git: just print what it wants and die
cat > fake-bin/git << EOF cat > fake-bin/git << EOF
#!/bin/sh #!${stdenv.shell}
echo ===== FAKE GIT: Not cloning \$* echo ===== FAKE GIT: Not cloning \$*
[ -e \$3 ] [ -e \$3 ]
EOF EOF
@ -109,7 +109,7 @@ stdenv.mkDerivation (rec {
# (prefetched stuff has lots of files) # (prefetched stuff has lots of files)
find . -type f | xargs sed -i 's@/usr/bin/\(python\|perl\)@/usr/bin/env \1@g' find . -type f | xargs sed -i 's@/usr/bin/\(python\|perl\)@/usr/bin/env \1@g'
find . -type f -not -path "./tools/hotplug/Linux/xendomains.in" \ find . -type f -not -path "./tools/hotplug/Linux/xendomains.in" \
| xargs sed -i 's@/bin/bash@/bin/sh@g' | xargs sed -i 's@/bin/bash@${stdenv.shell}@g'
# Get prefetched stuff # Get prefetched stuff
${withXenfiles (name: x: '' ${withXenfiles (name: x: ''

View file

@ -22,7 +22,8 @@
referencesByPopularity, referencesByPopularity,
writeScript, writeScript,
writeText, writeText,
closureInfo closureInfo,
substituteAll
}: }:
# WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future. # WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
@ -279,6 +280,12 @@ rec {
# of room for extension # of room for extension
maxLayers ? 24 maxLayers ? 24
}: }:
let
storePathToLayer = substituteAll
{ inherit (stdenv) shell;
src = ./store-path-to-layer.sh;
};
in
runCommand "${name}-granular-docker-layers" { runCommand "${name}-granular-docker-layers" {
inherit maxLayers; inherit maxLayers;
paths = referencesByPopularity closure; paths = referencesByPopularity closure;
@ -298,9 +305,9 @@ rec {
# following head and tail call lines, double-check that your # following head and tail call lines, double-check that your
# code behaves properly when the number of layers equals: # code behaves properly when the number of layers equals:
# maxLayers-1, maxLayers, and maxLayers+1 # maxLayers-1, maxLayers, and maxLayers+1
head -n $((maxLayers - 1)) $paths | cat -n | xargs -P$NIX_BUILD_CORES -n2 ${./store-path-to-layer.sh} head -n $((maxLayers - 1)) $paths | cat -n | xargs -P$NIX_BUILD_CORES -n2 ${storePathToLayer}
if [ $(cat $paths | wc -l) -ge $maxLayers ]; then if [ $(cat $paths | wc -l) -ge $maxLayers ]; then
tail -n+$maxLayers $paths | xargs ${./store-path-to-layer.sh} $maxLayers tail -n+$maxLayers $paths | xargs ${storePathToLayer} $maxLayers
fi fi
echo "Finished building layer '$name'" echo "Finished building layer '$name'"

View file

@ -164,7 +164,7 @@ rec {
# Set up automatic kernel module loading. # Set up automatic kernel module loading.
export MODULE_DIR=${linux}/lib/modules/ export MODULE_DIR=${linux}/lib/modules/
${coreutils}/bin/cat <<EOF > /run/modprobe ${coreutils}/bin/cat <<EOF > /run/modprobe
#! /bin/sh #! ${bash}/bin/sh
export MODULE_DIR=$MODULE_DIR export MODULE_DIR=$MODULE_DIR
exec ${kmod}/bin/modprobe "\$@" exec ${kmod}/bin/modprobe "\$@"
EOF EOF

View file

@ -1,5 +1,3 @@
#!/bin/sh -e
source "$stdenv/setup" source "$stdenv/setup"
mkdir -p $out/share/GeoIP mkdir -p $out/share/GeoIP

View file

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

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
configurePhase = '' configurePhase = ''
sed -i '988d' src/FSharpSource.targets sed -i '988d' src/FSharpSource.targets
substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh" substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "${stdenv.shell}"
./autogen.sh --prefix $out ./autogen.sh --prefix $out
''; '';

View file

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
]; ];
configurePhase = '' configurePhase = ''
substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh" substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "${stdenv.shell}"
./autogen.sh --prefix $out ./autogen.sh --prefix $out
''; '';

View file

@ -1,4 +1,4 @@
{ stdenv { stdenv, substituteAll
, fetchurl, perl, gcc, llvm_39 , fetchurl, perl, gcc, llvm_39
, ncurses5, gmp, glibc, libiconv , ncurses5, gmp, glibc, libiconv
}: }:
@ -110,10 +110,16 @@ stdenv.mkDerivation rec {
''; '';
configurePlatforms = [ ]; configurePlatforms = [ ];
configureFlags = [ configureFlags =
"--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib" let
gcc-clang-wrapper = substituteAll {
inherit (stdenv) shell;
src = ./gcc-clang-wrapper.sh;
};
in
[ "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
"--with-gmp-includes=${stdenv.lib.getDev gmp}/include" "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${gcc-clang-wrapper}"
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
# Stripping combined with patchelf breaks the executables (they die # Stripping combined with patchelf breaks the executables (they die

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
inPreprocessorMode () { inPreprocessorMode () {
hasE=0 hasE=0

View file

@ -98,7 +98,7 @@ let
preConfigure = '' preConfigure = ''
chmod +x configure chmod +x configure
substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" substituteInPlace configure --replace /bin/bash "${bash}/bin/bash"
substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "$shell" substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}"
substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path" substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path"
'' ''
# https://bugzilla.redhat.com/show_bug.cgi?id=1306558 # https://bugzilla.redhat.com/show_bug.cgi?id=1306558

View file

@ -115,6 +115,6 @@
(stdenv.lib.optionalAttrs (!stdenv.isLinux) { (stdenv.lib.optionalAttrs (!stdenv.isLinux) {
# Work around <https://bugs.gnu.org/14201>. # Work around <https://bugs.gnu.org/14201>.
SHELL = "/bin/sh"; SHELL = "${stdenv.shell}";
CONFIG_SHELL = "/bin/sh"; CONFIG_SHELL = "${stdenv.shell}";
}) })

View file

@ -30,8 +30,8 @@ stdenv.mkDerivation rec {
prePatch = '' prePatch = ''
# build-time scripts # build-time scripts
substituteInPlace run.in --replace '#!/bin/bash' '#!/bin/sh' substituteInPlace run.in --replace '#!/bin/bash' '#!${stdenv.shell}'
substituteInPlace ocaml-link.sh --replace '#!/bin/bash' '#!/bin/sh' substituteInPlace ocaml-link.sh --replace '#!/bin/bash' '#!${stdenv.shell}'
# $(OCAMLLIB) is read-only "${ocamlPackages.ocaml}/lib/ocaml" # $(OCAMLLIB) is read-only "${ocamlPackages.ocaml}/lib/ocaml"
substituteInPlace ocaml/Makefile.am --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml' substituteInPlace ocaml/Makefile.am --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml'

View file

@ -41,7 +41,7 @@ let
mkdir -p "$(dirname "$launch_script")" mkdir -p "$(dirname "$launch_script")"
touch "$launch_script" touch "$launch_script"
chmod a+x "$launch_script" chmod a+x "$launch_script"
echo "#! /bin/sh" >> "$launch_script" echo "#! ${stdenv.shell}" >> "$launch_script"
echo "source '$config_script'" >> "$launch_script" echo "source '$config_script'" >> "$launch_script"
echo "test -n \"\$NIX_LISP_LD_LIBRARY_PATH\" export LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH\"" >> "$launch_script" echo "test -n \"\$NIX_LISP_LD_LIBRARY_PATH\" export LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH\"" >> "$launch_script"
echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script" echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation {
mkdir -p $out/{nix-support,bin} mkdir -p $out/{nix-support,bin}
mv *.jar license_gpl-3.0.txt lib *.xml *.png $out/nix-support mv *.jar license_gpl-3.0.txt lib *.xml *.png $out/nix-support
cat >> $out/bin/avr8-burn-omat << EOF cat >> $out/bin/avr8-burn-omat << EOF
#!/bin/sh #!${stdenv.shell}
cd $out/nix-support; exec java -jar AVR8_Burn_O_Mat.jar cd $out/nix-support; exec java -jar AVR8_Burn_O_Mat.jar
EOF EOF
chmod +x $out/bin/avr8-burn-omat chmod +x $out/bin/avr8-burn-omat

View file

@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
# Create the script # Create the script
cat > "$out/bin/${cmd}" <<EOF cat > "$out/bin/${cmd}" <<EOF
#!/bin/sh #!${stdenv.shell}
set -f set -f
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@" LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@"
EOF EOF

View file

@ -18,8 +18,8 @@ buildPythonPackage rec {
postPatch = stdenv.lib.optional stdenv.isDarwin '' postPatch = stdenv.lib.optional stdenv.isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy # Fake the impure dependencies pbpaste and pbcopy
mkdir bin mkdir bin
echo '#/bin/sh' > bin/pbpaste echo '#${stdenv.shell}' > bin/pbpaste
echo '#/bin/sh' > bin/pbcopy echo '#${stdenv.shell}' > bin/pbcopy
chmod +x bin/{pbcopy,pbpaste} chmod +x bin/{pbcopy,pbpaste}
export PATH=$(realpath bin):$PATH export PATH=$(realpath bin):$PATH
''; '';

View file

@ -19,8 +19,8 @@ buildPythonPackage rec {
postPatch = stdenv.lib.optional stdenv.isDarwin '' postPatch = stdenv.lib.optional stdenv.isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy # Fake the impure dependencies pbpaste and pbcopy
mkdir bin mkdir bin
echo '#/bin/sh' > bin/pbpaste echo '#${stdenv.shell}' > bin/pbpaste
echo '#/bin/sh' > bin/pbcopy echo '#${stdenv.shell}' > bin/pbcopy
chmod +x bin/{pbcopy,pbpaste} chmod +x bin/{pbcopy,pbpaste}
export PATH=$(realpath bin):$PATH export PATH=$(realpath bin):$PATH
''; '';

View file

@ -96,8 +96,8 @@ in buildPythonPackage rec {
# Until then we disable the tests. # Until then we disable the tests.
+ optionalString isDarwin '' + optionalString isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy # Fake the impure dependencies pbpaste and pbcopy
echo "#!/bin/sh" > pbcopy echo "#!${stdenv.shell}" > pbcopy
echo "#!/bin/sh" > pbpaste echo "#!${stdenv.shell}" > pbpaste
chmod a+x pbcopy pbpaste chmod a+x pbcopy pbpaste
export PATH=$(pwd):$PATH export PATH=$(pwd):$PATH
'' + '' '' + ''

View file

@ -14,7 +14,7 @@ with pkgs.stdenv.lib;
# the derivation. use language extensions specified by args # the derivation. use language extensions specified by args
ctagsWrapped = makeOverridable ( {args, name} : pkgs.writeScriptBin name '' ctagsWrapped = makeOverridable ( {args, name} : pkgs.writeScriptBin name ''
#!/bin/sh #!${stdenv.shell}
exec ${pkgs.ctags}/bin/ctags ${concatStringsSep " " (map escapeShellArg args)} "$@" exec ${pkgs.ctags}/bin/ctags ${concatStringsSep " " (map escapeShellArg args)} "$@"
'') { '') {
args = let x = pkgs.ctagsWrapped; in concatLists [ args = let x = pkgs.ctagsWrapped; in concatLists [

View file

@ -53,7 +53,7 @@ let
mkdir -p $out/bin mkdir -p $out/bin
if [ -x "${gcc.cc}/bin/gcc" ]; then if [ -x "${gcc.cc}/bin/gcc" ]; then
cat > $out/bin/gcc << EOF cat > $out/bin/gcc << EOF
#!/bin/sh #!${stdenv.shell}
${extraConfig} ${extraConfig}
exec ${distcc}/bin/distcc gcc "\$@" exec ${distcc}/bin/distcc gcc "\$@"
EOF EOF
@ -61,7 +61,7 @@ let
fi fi
if [ -x "${gcc.cc}/bin/g++" ]; then if [ -x "${gcc.cc}/bin/g++" ]; then
cat > $out/bin/g++ << EOF cat > $out/bin/g++ << EOF
#!/bin/sh #!${stdenv.shell}
${extraConfig} ${extraConfig}
exec ${distcc}/bin/distcc g++ "\$@" exec ${distcc}/bin/distcc g++ "\$@"
EOF EOF

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
mkdir -p $out mkdir -p $out
cp -a * $out/ cp -a * $out/
substituteInPlace $out/bin/OpenGrok --replace "/bin/uname" "${coreutils}/bin/uname" substituteInPlace $out/bin/OpenGrok --replace "/bin/uname" "${coreutils}/bin/uname"
substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!/bin/sh" substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!${stdenv.shell}"
wrapProgram $out/bin/OpenGrok \ wrapProgram $out/bin/OpenGrok \
--prefix PATH : "${stdenv.lib.makeBinPath [ ctags git ]}" \ --prefix PATH : "${stdenv.lib.makeBinPath [ ctags git ]}" \
--set JAVA_HOME "${jre}" \ --set JAVA_HOME "${jre}" \

View file

@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath $fullPath $out/opt/andyetitmoves/lib/$binName patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath $fullPath $out/opt/andyetitmoves/lib/$binName
cat > $out/bin/$binName << EOF cat > $out/bin/$binName << EOF
#!/bin/sh #!${stdenv.shell}
cd $out/opt/andyetitmoves cd $out/opt/andyetitmoves
exec ./lib/$binName exec ./lib/$binName
EOF EOF

View file

@ -45,7 +45,7 @@ in stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
# Make wrapper script # Make wrapper script
cat > eduke32-wrapper <<EOF cat > eduke32-wrapper <<EOF
#!/bin/sh #!${stdenv.shell}
if [ "$EDUKE32_DATA_DIR" = "" ]; then if [ "$EDUKE32_DATA_DIR" = "" ]; then
EDUKE32_DATA_DIR=/var/lib/games/eduke32 EDUKE32_DATA_DIR=/var/lib/games/eduke32

View file

@ -33,6 +33,7 @@ stdenv.mkDerivation rec {
--subst-var-by out "$out/" --subst-var-by out "$out/"
substitute ${./fix-paths.sh} $out/fixpaths/fix-paths \ substitute ${./fix-paths.sh} $out/fixpaths/fix-paths \
--subst-var-by libxsltBin ${libxslt.bin} \ --subst-var-by libxsltBin ${libxslt.bin} \
--subst-var-by shell ${stdenv.shell} \
--subst-var out --subst-var out
chmod +x $out/fixpaths/fix-paths chmod +x $out/fixpaths/fix-paths

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
if [ -e ~/.config/freeorion/config.xml ]; then if [ -e ~/.config/freeorion/config.xml ]; then
@libxsltBin@/bin/xsltproc -o ~/.config/freeorion/config.xml @out@/fixpaths/fix-paths.xslt ~/.config/freeorion/config.xml @libxsltBin@/bin/xsltproc -o ~/.config/freeorion/config.xml @out@/fixpaths/fix-paths.xslt ~/.config/freeorion/config.xml

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
set -e set -e

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, jam, cctools, pkgconfig { stdenv, fetchFromGitHub, substituteAll, jam, cctools, pkgconfig
, SDL, SDL_mixer, SDL_sound, cf-private, gtk2, libvorbis, smpeg }: , SDL, SDL_mixer, SDL_sound, cf-private, gtk2, libvorbis, smpeg }:
let let
@ -29,16 +29,19 @@ stdenv.mkDerivation {
sha256 = "0icwgc25gp7krq6zf66hljydc6vps6bb4knywnrfgnfcmcalqqx9"; sha256 = "0icwgc25gp7krq6zf66hljydc6vps6bb4knywnrfgnfcmcalqqx9";
}; };
nativeBuildInputs = [ jam pkgconfig ] ++ lib.optional stdenv.isDarwin cctools; nativeBuildInputs = [ jam pkgconfig ] ++ stdenv.lib.optional stdenv.isDarwin cctools;
buildInputs = [ SDL SDL_mixer SDL_sound gtk2 ] buildInputs = [ SDL SDL_mixer SDL_sound gtk2 ]
++ lib.optionals stdenv.isDarwin [ cf-private smpeg libvorbis ]; ++ stdenv.lib.optionals stdenv.isDarwin [ cf-private smpeg libvorbis ];
patches = [ ./darwin.patch ]; patches = [ ./darwin.patch ];
buildPhase = jamenv + "jam -j$NIX_BUILD_CORES"; buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
installPhase = if stdenv.isDarwin then (builtins.readFile ./darwin.sh) else jamenv + '' installPhase =
if stdenv.isDarwin then
(substituteAll { inherit (stdenv) shell; src = ./darwin.sh; })
else jamenv + ''
jam -j$NIX_BUILD_CORES install jam -j$NIX_BUILD_CORES install
mkdir -p "$out/bin" mkdir -p "$out/bin"
ln -s ../libexec/gargoyle/gargoyle "$out/bin" ln -s ../libexec/gargoyle/gargoyle "$out/bin"
@ -52,7 +55,7 @@ stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with lib; { meta = with stdenv.lib; {
homepage = http://ccxvii.net/gargoyle/; homepage = http://ccxvii.net/gargoyle/;
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
description = "Interactive fiction interpreter GUI"; description = "Interactive fiction interpreter GUI";

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
cp -rv data resources credits.txt license.txt "$out/share/mars/" cp -rv data resources credits.txt license.txt "$out/share/mars/"
cp -v mars "$out/bin/mars.bin" cp -v mars "$out/bin/mars.bin"
cat << EOF > "$out/bin/mars" cat << EOF > "$out/bin/mars"
#! /bin/sh #! ${stdenv.shell}
cd "$out/share/mars/" cd "$out/share/mars/"
exec "$out/bin/mars.bin" "\$@" exec "$out/bin/mars.bin" "\$@"
EOF EOF

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
cp -v $src $out/lib/minecraft/server.jar cp -v $src $out/lib/minecraft/server.jar
cat > $out/bin/minecraft-server << EOF cat > $out/bin/minecraft-server << EOF
#!/bin/sh #!${stdenv.shell}
exec ${jre}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui exec ${jre}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
EOF EOF

View file

@ -54,7 +54,7 @@ stdenv.mkDerivation {
cp -r * "$out/opt/oilrush" cp -r * "$out/opt/oilrush"
mkdir -p "$out/bin" mkdir -p "$out/bin"
cat << EOF > "$out/bin/oilrush" cat << EOF > "$out/bin/oilrush"
#! /bin/sh #!${stdenv.shell}
LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH
cd "$out/opt/oilrush" cd "$out/opt/oilrush"
exec ./launcher_$arch.sh "\$@" exec ./launcher_$arch.sh "\$@"

View file

@ -21,7 +21,7 @@ let
}; };
playmidi = writeScriptBin "playmidi" '' playmidi = writeScriptBin "playmidi" ''
#!/bin/sh #!${stdenv.shell}
trap "${procps}/bin/pkill fluidsynth" EXIT trap "${procps}/bin/pkill fluidsynth" EXIT
${fluidsynth}/bin/fluidsynth -a ${audioDriver} -i ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 $* ${fluidsynth}/bin/fluidsynth -a ${audioDriver} -i ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 $*
''; '';

View file

@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
for b in tremulous tremded for b in tremulous tremded
do do
cat << EOF > $out/bin/$b cat << EOF > $out/bin/$b
#!/bin/sh #!${stdenv.shell}
cd $out/opt/tremulous cd $out/opt/tremulous
exec ./$b.$arch "\$@" exec ./$b.$arch "\$@"
EOF EOF

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
mkdir -p $out/bin mkdir -p $out/bin
cat <<EOF > $out/bin/trigger-rally cat <<EOF > $out/bin/trigger-rally
#!/bin/sh #!${stdenv.shell}
exec $out/games/trigger-rally "$@" exec $out/games/trigger-rally "$@"
EOF EOF
chmod +x $out/bin/trigger-rally chmod +x $out/bin/trigger-rally

View file

@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
done done
cat > $out/bin/Vessel << EOW cat > $out/bin/Vessel << EOW
#!/bin/sh #!${stdenv.shell}
cd $out/libexec/strangeloop/vessel/ cd $out/libexec/strangeloop/vessel/
exec ./x86/vessel.x86 exec ./x86/vessel.x86
EOW EOW

View file

@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
#makeWrapper doesn't do cd. :( #makeWrapper doesn't do cd. :(
cat > $out/bin/WorldofGoo << EOF cat > $out/bin/WorldofGoo << EOF
#!/bin/sh #!${stdenv.shell}
cd $out/libexec/2dboy/WorldOfGoo cd $out/libexec/2dboy/WorldOfGoo
exec ./WorldOfGoo.bin64 exec ./WorldOfGoo.bin64
EOF EOF

View file

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
mv $out/bin/zangband $out/bin/.zangband.real mv $out/bin/zangband $out/bin/.zangband.real
echo '#! /bin/sh echo '#! ${stdenv.shell}
PATH="$PATH:${coreutils}/bin" PATH="$PATH:${coreutils}/bin"
ZANGBAND_PATH="$HOME/.zangband" ZANGBAND_PATH="$HOME/.zangband"

View file

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
unpackPhase = "true"; unpackPhase = "true";
brprintconf_mfcj6510dw_script = '' brprintconf_mfcj6510dw_script = ''
#!/bin/sh #!${stdenv.shell}
cd $(mktemp -d) cd $(mktemp -d)
ln -s @out@/usr/bin/brprintconf_mfcj6510dw_patched brprintconf_mfcj6510dw_patched ln -s @out@/usr/bin/brprintconf_mfcj6510dw_patched brprintconf_mfcj6510dw_patched
ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc brmfcj6510dwfunc ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc brmfcj6510dwfunc

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
preConfigure = preConfigure =
'' ''
substituteInPlace foomaticrip.c --replace /bin/bash /bin/sh substituteInPlace foomaticrip.c --replace /bin/bash ${stdenv.shell}
''; '';
installTargets = "install-cups"; installTargets = "install-cups";

View file

@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
mv $out/share/retrofe/example/retrofe $out/bin/ mv $out/share/retrofe/example/retrofe $out/bin/
cat > $out/bin/retrofe-init << EOF cat > $out/bin/retrofe-init << EOF
#!/bin/sh #!${stdenv.shell}
echo "This will install retrofe's example files into this directory" echo "This will install retrofe's example files into this directory"
echo "Example files location: $out/share/retrofe/example/" echo "Example files location: $out/share/retrofe/example/"

View file

@ -1,5 +1,3 @@
#!/bin/sh
## build described at http://wiki.winehq.org/Wine64 ## build described at http://wiki.winehq.org/Wine64
source $stdenv/setup source $stdenv/setup

View file

@ -362,7 +362,7 @@ rec {
vimWithRC = {vimExecutable, name ? null, vimrcFile ? null, gvimrcFile ? null}: vimWithRC = {vimExecutable, name ? null, vimrcFile ? null, gvimrcFile ? null}:
let rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}"; let rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
in writeScriptBin (if name == null then "vim" else name) '' in writeScriptBin (if name == null then "vim" else name) ''
#!/bin/sh #!${stdenv.shell}
exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@" exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
''; '';

View file

@ -1,5 +1,5 @@
{ writeScriptBin, stdenv, alsaPlugins }: { writeScriptBin, stdenv, alsaPlugins }:
writeScriptBin "ap${if stdenv.hostPlatform.system == "i686-linux" then "32" else "64"}" '' writeScriptBin "ap${if stdenv.hostPlatform.system == "i686-linux" then "32" else "64"}" ''
#/bin/sh #${stdenv.shell}
ALSA_PLUGIN_DIRS=${alsaPlugins}/lib/alsa-lib "$@" ALSA_PLUGIN_DIRS=${alsaPlugins}/lib/alsa-lib "$@"
'' ''

View file

@ -36,12 +36,12 @@ stdenv.mkDerivation {
mkdir -p $out/bin mkdir -p $out/bin
tee $out/bin/discrete_vga_poweroff << EOF tee $out/bin/discrete_vga_poweroff << EOF
#!/bin/sh #!${stdenv.shell}
echo -n OFF > /proc/acpi/bbswitch echo -n OFF > /proc/acpi/bbswitch
EOF EOF
tee $out/bin/discrete_vga_poweron << EOF tee $out/bin/discrete_vga_poweron << EOF
#!/bin/sh #!${stdenv.shell}
echo -n ON > /proc/acpi/bbswitch echo -n ON > /proc/acpi/bbswitch
EOF EOF

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace configure.ac --replace m4_esyscmd m4_esyscmd_s substituteInPlace configure.ac --replace m4_esyscmd m4_esyscmd_s
substituteInPlace scripts/git_hash.sh --replace /bin/bash /bin/sh substituteInPlace scripts/git_hash.sh --replace /bin/bash ${stdenv.shell}
echo ${version} > .scmversion echo ${version} > .scmversion
''; '';

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
# Executes a hook in case of a change to the # Executes a hook in case of a change to the
# rfkill state. The hook can be passed as # rfkill state. The hook can be passed as

View file

@ -1,4 +1,4 @@
{ stdenv }: { stdenv, substituteAll }:
# Provides a facility to hook into rfkill changes. # Provides a facility to hook into rfkill changes.
# #
@ -10,7 +10,7 @@
# Add a hook script in the managed etc directory, e.g.: # Add a hook script in the managed etc directory, e.g.:
# etc = [ # etc = [
# { source = pkgs.writeScript "rtfkill.hook" '' # { source = pkgs.writeScript "rtfkill.hook" ''
# #!/bin/sh # #!${stdenv.shell}
# #
# if [ "$RFKILL_STATE" -eq "1" ]; then # if [ "$RFKILL_STATE" -eq "1" ]; then
# exec ${config.system.build.upstart}/sbin/initctl emit -n antenna-on # exec ${config.system.build.upstart}/sbin/initctl emit -n antenna-on
@ -24,7 +24,13 @@
# Note: this package does not need the binaries # Note: this package does not need the binaries
# in the rfkill package. # in the rfkill package.
stdenv.mkDerivation { let
rfkillHook =
substituteAll {
inherit (stdenv) shell;
src = ./rfkill-hook.sh;
};
in stdenv.mkDerivation {
name = "rfkill-udev"; name = "rfkill-udev";
unpackPhase = "true"; unpackPhase = "true";
@ -37,7 +43,7 @@ stdenv.mkDerivation {
EOF EOF
mkdir -p "$out/bin/"; mkdir -p "$out/bin/";
cp ${./rfkill-hook.sh} "$out/bin/rfkill-hook.sh" cp ${rfkillHook} "$out/bin/rfkill-hook.sh"
chmod +x "$out/bin/rfkill-hook.sh"; chmod +x "$out/bin/rfkill-hook.sh";
''; '';
@ -46,4 +52,4 @@ stdenv.mkDerivation {
description = "Rules+hook for udev to catch rfkill state changes"; description = "Rules+hook for udev to catch rfkill state changes";
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ lib, runCommand, substituteAll, coreutils }: { stdenv, runCommand, substituteAll, coreutils }:
let let
name = "service-wrapper-${version}"; name = "service-wrapper-${version}";
@ -7,10 +7,11 @@ in
runCommand "${name}" { runCommand "${name}" {
script = substituteAll { script = substituteAll {
src = ./service-wrapper.sh; src = ./service-wrapper.sh;
inherit (stdenv) shell;
inherit coreutils; inherit coreutils;
}; };
meta = with lib; { meta = with stdenv.lib; {
description = "A convenient wrapper for the systemctl commands, borrow from Ubuntu"; description = "A convenient wrapper for the systemctl commands, borrow from Ubuntu";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
########################################################################### ###########################################################################
# /usr/bin/service # /usr/bin/service

View file

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
makeFlags = [ makeFlags = [
"KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}" "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
"SHELL=/bin/sh" "SHELL=${stdenv.shell}"
"HDAPS=1" "HDAPS=1"
]; ];

View file

@ -1,7 +1,7 @@
{ stdenv, writeText }: { stdenv, writeText }:
let script = writeText "script" '' let script = writeText "script" ''
#!/bin/sh #!${stdenv.shell}
if command -v sendmail > /dev/null 2>&1 && [ "$(command -v sendmail)" != "{{MYPATH}}" ]; then if command -v sendmail > /dev/null 2>&1 && [ "$(command -v sendmail)" != "{{MYPATH}}" ]; then
exec sendmail "$@" exec sendmail "$@"

View file

@ -126,7 +126,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cat > $out/bin/codimd <<EOF cat > $out/bin/codimd <<EOF
#!${stdenv.shell}/bin/sh #!${stdenv.shell}
${nodejs-6_x}/bin/node $out/app.js ${nodejs-6_x}/bin/node $out/app.js
EOF EOF
cp -R {app.js,bin,lib,locales,package.json,public} $out/ cp -R {app.js,bin,lib,locales,package.json,public} $out/

View file

@ -123,6 +123,7 @@ in stdenv.mkDerivation {
cp ${./startx} $out/bin/startx cp ${./startx} $out/bin/startx
substituteInPlace $out/bin/startx \ substituteInPlace $out/bin/startx \
--replace "@shell@" "${stdenv.shell}" \
--replace "@PATH@" "$out/bin:${env}" \ --replace "@PATH@" "$out/bin:${env}" \
--replace "@XAUTH@" "${xorg.xauth}/bin/xauth" \ --replace "@XAUTH@" "${xorg.xauth}/bin/xauth" \
--replace "@FONT_CACHE@" "$out/bin/font_cache" \ --replace "@FONT_CACHE@" "$out/bin/font_cache" \
@ -153,12 +154,14 @@ in stdenv.mkDerivation {
mkdir -p $out/lib/X11/xinit/privileged_startx.d mkdir -p $out/lib/X11/xinit/privileged_startx.d
cp ${./privileged} $out/lib/X11/xinit/privileged_startx.d/privileged cp ${./privileged} $out/lib/X11/xinit/privileged_startx.d/privileged
substituteInPlace $out/lib/X11/xinit/privileged_startx.d/privileged \ substituteInPlace $out/lib/X11/xinit/privileged_startx.d/privileged \
--replace "@shell@" "${stdenv.shell}" \
--replace "@PATH@" "$out/bin:${env}" \ --replace "@PATH@" "$out/bin:${env}" \
--replace "@FONTCONFIG_FILE@" "$fontsConfPath" \ --replace "@FONTCONFIG_FILE@" "$fontsConfPath" \
--replace "@FONT_CACHE@" "$out/bin/font_cache" --replace "@FONT_CACHE@" "$out/bin/font_cache"
cp ${./font_cache} $out/bin/font_cache cp ${./font_cache} $out/bin/font_cache
substituteInPlace $out/bin/font_cache \ substituteInPlace $out/bin/font_cache \
--replace "@shell@" "${stdenv.shell}" \
--replace "@PATH@" "$out/bin:${env}" \ --replace "@PATH@" "$out/bin:${env}" \
--replace "@ENCODINGSDIR@" "${xorg.encodings}/share/fonts/X11/encodings" \ --replace "@ENCODINGSDIR@" "${xorg.encodings}/share/fonts/X11/encodings" \
--replace "@MKFONTDIR@" "${xorg.mkfontdir}/bin/mkfontdir" \ --replace "@MKFONTDIR@" "${xorg.mkfontdir}/bin/mkfontdir" \
@ -168,6 +171,7 @@ in stdenv.mkDerivation {
cp ${./xinitrc} $out/etc/X11/xinit/xinitrc cp ${./xinitrc} $out/etc/X11/xinit/xinitrc
substituteInPlace $out/etc/X11/xinit/xinitrc \ substituteInPlace $out/etc/X11/xinit/xinitrc \
--replace "@shell@" "${stdenv.shell}" \
--replace "@PATH@" "$out/bin:${env}" \ --replace "@PATH@" "$out/bin:${env}" \
--replace "@XSET@" "${xorg.xset}/bin/xset" \ --replace "@XSET@" "${xorg.xset}/bin/xset" \
--replace "@XMODMAP@" "${xorg.xmodmap}/bin/xmodmap" \ --replace "@XMODMAP@" "${xorg.xmodmap}/bin/xmodmap" \
@ -178,6 +182,7 @@ in stdenv.mkDerivation {
cp ${./X11} $out/Applications/XQuartz.app/Contents/MacOS/X11 cp ${./X11} $out/Applications/XQuartz.app/Contents/MacOS/X11
substituteInPlace $out/Applications/XQuartz.app/Contents/MacOS/X11 \ substituteInPlace $out/Applications/XQuartz.app/Contents/MacOS/X11 \
--replace "@shell@" "${stdenv.shell}" \
--replace "@DEFAULT_SHELL@" "${shell}" \ --replace "@DEFAULT_SHELL@" "${shell}" \
--replace "@DEFAULT_STARTX@" "$defaultStartX" \ --replace "@DEFAULT_STARTX@" "$defaultStartX" \
--replace "@DEFAULT_CLIENT@" "${xterm}/bin/xterm" \ --replace "@DEFAULT_CLIENT@" "${xterm}/bin/xterm" \

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
export PATH=@PATH@:$PATH export PATH=@PATH@:$PATH
export FONTCONFIG_FILE="@FONTCONFIG_FILE@" export FONTCONFIG_FILE="@FONTCONFIG_FILE@"

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
# vim :set ts=4 sw=4 sts=4 et : # vim :set ts=4 sw=4 sts=4 et :

View file

@ -1,4 +1,4 @@
#!/bin/sh #!@shell@
export PATH=@PATH@:$PATH export PATH=@PATH@:$PATH

View file

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
patchPhase = patchPhase =
'' for i in `find cnee/test -name \*.sh` '' for i in `find cnee/test -name \*.sh`
do do
sed -i "$i" -e's|/bin/bash|/bin/sh|g ; s|/usr/bin/env bash|/bin/sh|g' sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g ; s|/usr/bin/env bash|${stdenv.shell}|g'
done done
''; '';

View file

@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
script = substituteAll { script = substituteAll {
src = ./rpmextract.sh; src = ./rpmextract.sh;
inherit rpm cpio; inherit rpm cpio;
inherit (stdenv) shell;
}; };
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -1,4 +1,4 @@
#!/bin/sh -e #!@shell@ -e
if [ "$1" = "" ]; then if [ "$1" = "" ]; then
echo "usage: rpmextract package_name..." 1>&2 echo "usage: rpmextract package_name..." 1>&2

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
cp ./libflockit.so $out/lib cp ./libflockit.so $out/lib
(cat <<EOI (cat <<EOI
#!/bin/sh #!${stdenv.shell}
env LD_PRELOAD="$out/lib/libflockit.so" FLOCKIT_FILE_PREFIX=\$1 \''${@:2} env LD_PRELOAD="$out/lib/libflockit.so" FLOCKIT_FILE_PREFIX=\$1 \''${@:2}
EOI EOI
) > $out/bin/flockit ) > $out/bin/flockit

View file

@ -9,7 +9,7 @@
# known impurity: test cases seem to bu using /tmp/storeBackup.lock .. # known impurity: test cases seem to bu using /tmp/storeBackup.lock ..
let dummyMount = writeScriptBin "mount" "#!/bin/sh"; let dummyMount = writeScriptBin "mount" "#!${stdenv.shell}";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {

View file

@ -18,7 +18,7 @@ in stdenv.mkDerivation {
mkdir -p "$out/bin"; mkdir -p "$out/bin";
mkdir -p "$out/share"; mkdir -p "$out/share";
install -D -m444 -t "$out/share" *.jar install -D -m444 -t "$out/share" *.jar
echo "#!/bin/sh" > "$out/bin/briss" echo "#!${stdenv.shell}" > "$out/bin/briss"
echo "${jre}/bin/java -Xms128m -Xmx1024m -cp \"$out/share/\" -jar \"$out/share/briss-${version}.jar\"" >> "$out/bin/briss" echo "${jre}/bin/java -Xms128m -Xmx1024m -cp \"$out/share/\" -jar \"$out/share/briss-${version}.jar\"" >> "$out/bin/briss"
chmod +x "$out/bin/briss" chmod +x "$out/bin/briss"
''; '';

View file

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
preInstall = '' preInstall = ''
mkdir "$TMP/bin" mkdir "$TMP/bin"
for i in chown chgrp; do for i in chown chgrp; do
echo '#!/bin/sh' >> "$TMP/bin/$i" echo '#!${stdenv.shell}' >> "$TMP/bin/$i"
chmod +x "$TMP/bin/$i" chmod +x "$TMP/bin/$i"
PATH="$TMP/bin:$PATH" PATH="$TMP/bin:$PATH"
done done

View file

@ -47,7 +47,7 @@ buildGoPackage rec {
cp -R $src/shell $bin/share/fzf cp -R $src/shell $bin/share/fzf
cat <<SCRIPT > $bin/bin/fzf-share cat <<SCRIPT > $bin/bin/fzf-share
#!/bin/sh #!${stdenv.shell}
# Run this script to find the fzf shared folder where all the shell # Run this script to find the fzf shared folder where all the shell
# integration scripts are living. # integration scripts are living.
echo $bin/share/fzf echo $bin/share/fzf

View file

@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
preConfigure = preConfigure =
'' for i in "tests/util/"*.in '' for i in "tests/util/"*.in
do do
sed -i "$i" -e's|/bin/bash|/bin/sh|g' sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g'
done done
# Apparently, the QEMU executable is no longer called # Apparently, the QEMU executable is no longer called

View file

@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
preConfigure = preConfigure =
'' for i in "tests/util/"*.in '' for i in "tests/util/"*.in
do do
sed -i "$i" -e's|/bin/bash|/bin/sh|g' sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g'
done done
# Apparently, the QEMU executable is no longer called # Apparently, the QEMU executable is no longer called

View file

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = [ "-lX11" ]; NIX_LDFLAGS = [ "-lX11" ];
patchPhase = '' patchPhase = ''
cd src cd src
substituteInPlace config --replace /bin/bash /bin/sh substituteInPlace config --replace /bin/bash ${stdenv.shell}
mkdir -p $out mkdir -p $out
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${libX11}/lib" export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${libX11}/lib"
''; '';

View file

@ -78,7 +78,7 @@ stdenv.mkDerivation {
# wants to write temporary files there. So create a temporary # wants to write temporary files there. So create a temporary
# to run from and symlink the runtime files to it. # to run from and symlink the runtime files to it.
wrapperScript = writeScript "xfstests-check" '' wrapperScript = writeScript "xfstests-check" ''
#!/bin/sh #!${stdenv.shell}
set -e set -e
export RESULT_BASE="$(pwd)/results" export RESULT_BASE="$(pwd)/results"

View file

@ -49,7 +49,7 @@ in stdenv.mkDerivation {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cat >$out/bin/airfield <<EOF cat >$out/bin/airfield <<EOF
#!${stdenv.shell}/bin/sh #!${stdenv.shell}
${nodejs}/bin/node ${src}/airfield.js ${nodejs}/bin/node ${src}/airfield.js
EOF EOF
''; '';

View file

@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
mkdir -p "$out/share" mkdir -p "$out/share"
tar xvf "ZAP_${version}_Linux.tar.gz" -C "$out/share/" tar xvf "ZAP_${version}_Linux.tar.gz" -C "$out/share/"
mkdir -p "$out/bin" mkdir -p "$out/bin"
echo "#!/bin/sh" > "$out/bin/zap" echo "#!${stdenv.shell}" > "$out/bin/zap"
echo \"$out/share/ZAP_${version}/zap.sh\" >> "$out/bin/zap" echo \"$out/share/ZAP_${version}/zap.sh\" >> "$out/bin/zap"
chmod +x "$out/bin/zap" chmod +x "$out/bin/zap"
''; '';

View file

@ -3,7 +3,8 @@
, gtk3, nssTools, pcsclite , gtk3, nssTools, pcsclite
, libxml2, libproxy , libxml2, libproxy
, openssl, curl , openssl, curl
, makeWrapper }: , makeWrapper
, substituteAll }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "eid-mw-${version}"; name = "eid-mw-${version}";
@ -32,8 +33,15 @@ stdenv.mkDerivation rec {
configureFlags = [ "--enable-dialogs=yes" ]; configureFlags = [ "--enable-dialogs=yes" ];
postInstall = '' postInstall =
install -D ${./eid-nssdb.in} $out/bin/eid-nssdb let
eid-nssdb-in = substituteAll {
inherit (stdenv) shell;
src = ./eid-nssdb.in;
};
in
''
install -D ${eid-nssdb-in} $out/bin/eid-nssdb
substituteInPlace $out/bin/eid-nssdb \ substituteInPlace $out/bin/eid-nssdb \
--replace "modutil" "${nssTools}/bin/modutil" --replace "modutil" "${nssTools}/bin/modutil"

View file

@ -1,5 +1,3 @@
#!/bin/sh
# Prepare a makefile specifying the appropriate output directories. # Prepare a makefile specifying the appropriate output directories.
# #
# Written by Ludovic Courtès <ludo@gnu.org>. # Written by Ludovic Courtès <ludo@gnu.org>.

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
# change sudoers dir from /var/google-sudoers.d to /run/google-sudoers.d (managed through systemd-tmpfiles) # change sudoers dir from /var/google-sudoers.d to /run/google-sudoers.d (managed through systemd-tmpfiles)
substituteInPlace pam_module/pam_oslogin_admin.cc --replace /var/google-sudoers.d /run/google-sudoers.d substituteInPlace pam_module/pam_oslogin_admin.cc --replace /var/google-sudoers.d /run/google-sudoers.d
# fix "User foo not allowed because shell /bin/bash does not exist" # fix "User foo not allowed because shell /bin/bash does not exist"
substituteInPlace utils/oslogin_utils.cc --replace /bin/bash /bin/sh substituteInPlace utils/oslogin_utils.cc --replace /bin/bash ${stdenv.shell}
''; '';
buildInputs = [ curl.dev pam ]; buildInputs = [ curl.dev pam ];