cc-wrapper, cc-wrapper-old: Simplify shell logic
1. `crossDrv` is now the default so we don't need to worry about that in build != host builds. 2. shell is the build time shell, so `wrapCCCross` doesn't need to worry, as build == host. 3. `shell.shellPath` will always be appended where useful. 4. Complicated `shell == ""` logic served no purpose.
This commit is contained in:
parent
6d423da7cc
commit
6c74ee68b9
@ -86,7 +86,8 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
||||||
inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
|
inherit cc libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
|
||||||
|
shell = getBin shell + shell.shellPath or "";
|
||||||
gnugrep_bin = if nativeTools then "" else gnugrep;
|
gnugrep_bin = if nativeTools then "" else gnugrep;
|
||||||
|
|
||||||
binPrefix = prefix;
|
binPrefix = prefix;
|
||||||
@ -384,10 +385,6 @@ stdenv.mkDerivation {
|
|||||||
# for substitution in utils.sh
|
# for substitution in utils.sh
|
||||||
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
|
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
|
||||||
|
|
||||||
crossAttrs = {
|
|
||||||
shell = shell.crossDrv + shell.crossDrv.shellPath;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
let cc_ = if cc != null then cc else {}; in
|
let cc_ = if cc != null then cc else {}; in
|
||||||
(if cc_ ? meta then removeAttrs cc.meta ["priority"] else {}) //
|
(if cc_ ? meta then removeAttrs cc.meta ["priority"] else {}) //
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# variables so that the compiler and the linker just "work".
|
# variables so that the compiler and the linker just "work".
|
||||||
|
|
||||||
{ name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
|
{ name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
|
||||||
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
|
||||||
, zlib ? null
|
, zlib ? null
|
||||||
, hostPlatform, targetPlatform
|
, hostPlatform, targetPlatform
|
||||||
}:
|
}:
|
||||||
@ -56,15 +56,9 @@ stdenv.mkDerivation {
|
|||||||
langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
|
langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
|
||||||
langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
|
langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
|
||||||
zlib = if gcc != null && gcc ? langVhdl then zlib else null;
|
zlib = if gcc != null && gcc ? langVhdl then zlib else null;
|
||||||
shell = if shell == "" then stdenv.shell else
|
shell = shell + shell.shellPath or "";
|
||||||
if builtins.isAttrs shell then (shell + shell.shellPath)
|
|
||||||
else shell;
|
|
||||||
|
|
||||||
crossAttrs = {
|
crossAttrs = {
|
||||||
shell = shell.crossDrv + shell.crossDrv.shellPath;
|
|
||||||
coreutils = coreutils.crossDrv;
|
|
||||||
binutils = binutils.crossDrv;
|
|
||||||
gcc = gcc.crossDrv;
|
|
||||||
#
|
#
|
||||||
# This is not the best way to do this. I think the reference should be
|
# This is not the best way to do this. I think the reference should be
|
||||||
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
|
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
|
||||||
|
@ -6230,7 +6230,7 @@ with pkgs;
|
|||||||
};
|
};
|
||||||
|
|
||||||
wrapCCCross =
|
wrapCCCross =
|
||||||
{cc, libc, binutils, shell ? "", name ? "gcc-cross-wrapper"}:
|
{cc, libc, binutils, name ? "gcc-cross-wrapper"}:
|
||||||
|
|
||||||
forcedNativePackages.ccWrapperFun {
|
forcedNativePackages.ccWrapperFun {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
@ -6240,7 +6240,7 @@ with pkgs;
|
|||||||
isGNU = cc.isGNU or false;
|
isGNU = cc.isGNU or false;
|
||||||
isClang = cc.isClang or false;
|
isClang = cc.isClang or false;
|
||||||
|
|
||||||
inherit cc binutils libc shell name;
|
inherit cc binutils libc name;
|
||||||
};
|
};
|
||||||
|
|
||||||
# prolog
|
# prolog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user