treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user