git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit6c74ee68b9d985a9a5b26eb9e6ee1bfc06283bee authorJohn Ericson <John.Ericson@Obsidian.Systems> dateMon 18 Sep 2017, 21:12 (9 years ago) parent6d423da
3 files changed+6−15
pkgs/build-support/cc-wrapper/default.nix+2−5 pkgs/build-support/gcc-wrapper-old/default.nix+2−8 pkgs/top-level/all-packages.nix+2−2
pkgs/build-support/cc-wrapper/default.nix+2−5
@@ -86,7 +86,8 @@ stdenv.mkDerivation {
8686
8787 preferLocalBuild = true;
8888
89− inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
89+ inherit cc libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
90+ shell = getBin shell + shell.shellPath or "";
9091 gnugrep_bin = if nativeTools then "" else gnugrep;
9192
9293 binPrefix = prefix;
@@ -384,10 +385,6 @@ stdenv.mkDerivation {
384385 # for substitution in utils.sh
385386 expandResponseParams = "${expand-response-params}/bin/expand-response-params";
386387
387− crossAttrs = {
388− shell = shell.crossDrv + shell.crossDrv.shellPath;
389− };
390−
391388 meta =
392389 let cc_ = if cc != null then cc else {}; in
393390 (if cc_ ? meta then removeAttrs cc.meta ["priority"] else {}) //
pkgs/build-support/gcc-wrapper-old/default.nix+2−8
@@ -6,7 +6,7 @@
66# variables so that the compiler and the linker just "work".
77
88{ name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? ""
9−, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
9+, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
1010, zlib ? null
1111, hostPlatform, targetPlatform
1212}:
@@ -56,15 +56,9 @@ stdenv.mkDerivation {
5656 langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
5757 langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
5858 zlib = if gcc != null && gcc ? langVhdl then zlib else null;
59− shell = if shell == "" then stdenv.shell else
60− if builtins.isAttrs shell then (shell + shell.shellPath)
61− else shell;
59+ shell = shell + shell.shellPath or "";
6260
6361 crossAttrs = {
64− shell = shell.crossDrv + shell.crossDrv.shellPath;
65− coreutils = coreutils.crossDrv;
66− binutils = binutils.crossDrv;
67− gcc = gcc.crossDrv;
6862 #
6963 # This is not the best way to do this. I think the reference should be
7064 # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
pkgs/top-level/all-packages.nix+2−2
@@ -6230,7 +6230,7 @@ with pkgs;
62306230 };
62316231
62326232 wrapCCCross =
6233− {cc, libc, binutils, shell ? "", name ? "gcc-cross-wrapper"}:
6233+ {cc, libc, binutils, name ? "gcc-cross-wrapper"}:
62346234
62356235 forcedNativePackages.ccWrapperFun {
62366236 nativeTools = false;
@@ -6240,7 +6240,7 @@ with pkgs;
62406240 isGNU = cc.isGNU or false;
62416241 isClang = cc.isClang or false;
62426242
6243− inherit cc binutils libc shell name;
6243+ inherit cc binutils libc name;
62446244 };
62456245
62466246 # prolog