From dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Tue, 26 Feb 2019 11:45:54 +0000 Subject: 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. --- pkgs/applications/graphics/alchemy/default.nix | 4 ++-- pkgs/applications/graphics/autotrace/default.nix | 7 ++++--- pkgs/applications/graphics/swingsane/default.nix | 4 ++-- pkgs/applications/graphics/wings/default.nix | 5 ++--- pkgs/applications/graphics/zgrviewer/default.nix | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'pkgs/applications/graphics') diff --git a/pkgs/applications/graphics/alchemy/default.nix b/pkgs/applications/graphics/alchemy/default.nix index 30223658f535..09664889f35b 100644 --- a/pkgs/applications/graphics/alchemy/default.nix +++ b/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 diff --git a/pkgs/applications/graphics/autotrace/default.nix b/pkgs/applications/graphics/autotrace/default.nix index 7af7c8986f2f..cc08dce906c3 100644 --- a/pkgs/applications/graphics/autotrace/default.nix +++ b/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[@]}" diff --git a/pkgs/applications/graphics/swingsane/default.nix b/pkgs/applications/graphics/swingsane/default.nix index ac3de4a4e141..d0f2a48c589d 100644 --- a/pkgs/applications/graphics/swingsane/default.nix +++ b/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 "$@" ''; diff --git a/pkgs/applications/graphics/wings/default.nix b/pkgs/applications/graphics/wings/default.nix index e27f074b21ba..891f3586fa59 100644 --- a/pkgs/applications/graphics/wings/default.nix +++ b/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; }; } - diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix index c60d4b7b904d..ac3d303a7a60 100644 --- a/pkgs/applications/graphics/zgrviewer/default.nix +++ b/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" ''; -- cgit 1.4.1