git.iko.soy/typeable/nixpkgs
on master help sign in
treewide: Less {cc,bintools}-wrapper eta expansion

Also makes the LLVM ones more correct

commit25e866a7fe36045470e27a9b320703a35266d889 authorJohn Ericson <Ericson2314@Yahoo.com> dateTue 22 May 2018, 19:21 (9 years ago) parent07d73c4
7 files changed+41−63
pkgs/development/compilers/llvm/3.7/default.nix+3−7 pkgs/development/compilers/llvm/3.8/default.nix+3−7 pkgs/development/compilers/llvm/3.9/default.nix+3−7 pkgs/development/compilers/llvm/4/default.nix+3−7 pkgs/development/compilers/llvm/5/default.nix+3−7 pkgs/development/compilers/llvm/6/default.nix+3−7 pkgs/top-level/all-packages.nix+23−21
pkgs/development/compilers/llvm/3.7/default.nix+3−7
@@ -1,5 +1,5 @@
11{ newScope, stdenv, libstdcxxHook, cmake, libxml2, python2, isl, fetchurl
2−, overrideCC, wrapCC, ccWrapperFun, darwin
2+, overrideCC, wrapCCWith, darwin
33}:
44
55let
@@ -27,17 +27,13 @@ let
2727
2828 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
2929
30− libstdcxxClang = ccWrapperFun {
30+ libstdcxxClang = wrapCCWith {
3131 cc = self.clang-unwrapped;
32− /* FIXME is this right? */
33− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3432 extraPackages = [ libstdcxxHook ];
3533 };
3634
37− libcxxClang = ccWrapperFun {
35+ libcxxClang = wrapCCWith {
3836 cc = self.clang-unwrapped;
39− /* FIXME is this right? */
40− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4137 extraPackages = [ self.libcxx self.libcxxabi ];
4238 };
4339
pkgs/development/compilers/llvm/3.8/default.nix+3−7
@@ -1,4 +1,4 @@
1−{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }:
1+{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin }:
22let
33 callPackage = newScope (self // { inherit stdenv isl version fetch; });
44
@@ -26,17 +26,13 @@ let
2626
2727 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
2828
29− libstdcxxClang = ccWrapperFun {
29+ libstdcxxClang = wrapCCWith {
3030 cc = self.clang-unwrapped;
31− /* FIXME is this right? */
32− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3331 extraPackages = [ libstdcxxHook ];
3432 };
3533
36− libcxxClang = ccWrapperFun {
34+ libcxxClang = wrapCCWith {
3735 cc = self.clang-unwrapped;
38− /* FIXME is this right? */
39− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4036 extraPackages = [ self.libcxx self.libcxxabi ];
4137 };
4238
pkgs/development/compilers/llvm/3.9/default.nix+3−7
@@ -1,4 +1,4 @@
1−{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }:
1+{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin }:
22let
33 callPackage = newScope (self // { inherit stdenv isl version fetch; });
44
@@ -26,17 +26,13 @@ let
2626
2727 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
2828
29− libstdcxxClang = ccWrapperFun {
29+ libstdcxxClang = wrapCCWith {
3030 cc = self.clang-unwrapped;
31− /* FIXME is this right? */
32− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3331 extraPackages = [ libstdcxxHook ];
3432 };
3533
36− libcxxClang = ccWrapperFun {
34+ libcxxClang = wrapCCWith {
3735 cc = self.clang-unwrapped;
38− /* FIXME is this right? */
39− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4036 extraPackages = [ self.libcxx self.libcxxabi ];
4137 };
4238
pkgs/development/compilers/llvm/4/default.nix+3−7
@@ -1,5 +1,5 @@
11{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
2−, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
2+, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith
33, darwin
44}:
55
@@ -40,17 +40,13 @@ let
4040
4141 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
4242
43− libstdcxxClang = ccWrapperFun {
43+ libstdcxxClang = wrapCCWith {
4444 cc = self.clang-unwrapped;
45− /* FIXME is this right? */
46− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4745 extraPackages = [ libstdcxxHook ];
4846 };
4947
50− libcxxClang = ccWrapperFun {
48+ libcxxClang = wrapCCWith {
5149 cc = self.clang-unwrapped;
52− /* FIXME is this right? */
53− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
5450 extraPackages = [ self.libcxx self.libcxxabi ];
5551 };
5652
pkgs/development/compilers/llvm/5/default.nix+3−7
@@ -1,5 +1,5 @@
11{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
2−, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
2+, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith
33, darwin
44}:
55
@@ -40,17 +40,13 @@ let
4040
4141 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
4242
43− libstdcxxClang = ccWrapperFun {
43+ libstdcxxClang = wrapCCWith {
4444 cc = self.clang-unwrapped;
45− /* FIXME is this right? */
46− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4745 extraPackages = [ libstdcxxHook ];
4846 };
4947
50− libcxxClang = ccWrapperFun {
48+ libcxxClang = wrapCCWith {
5149 cc = self.clang-unwrapped;
52− /* FIXME is this right? */
53− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
5450 extraPackages = [ self.libcxx self.libcxxabi ];
5551 };
5652
pkgs/development/compilers/llvm/6/default.nix+3−7
@@ -1,5 +1,5 @@
11{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
2−, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
2+, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith
33, darwin
44}:
55
@@ -40,17 +40,13 @@ let
4040
4141 clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
4242
43− libstdcxxClang = ccWrapperFun {
43+ libstdcxxClang = wrapCCWith {
4444 cc = self.clang-unwrapped;
45− /* FIXME is this right? */
46− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4745 extraPackages = [ libstdcxxHook ];
4846 };
4947
50− libcxxClang = ccWrapperFun {
48+ libcxxClang = wrapCCWith {
5149 cc = self.clang-unwrapped;
52− /* FIXME is this right? */
53− inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
5450 extraPackages = [ self.libcxx self.libcxxabi ];
5551 };
5652
pkgs/top-level/all-packages.nix+23−21
@@ -6996,42 +6996,46 @@ with pkgs;
69966996
69976997 wla-dx = callPackage ../development/compilers/wla-dx { };
69986998
6999− wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "" }:
7000− ccWrapperFun rec {
6999+ wrapCCWith =
7000+ { cc
7001+ , # This should be the only bintools runtime dep with this sort of logic. The
7002+ # Others should instead delegate to the next stage's choice with
7003+ # `targetPackages.stdenv.cc.bintools`. This one is different just to
7004+ # provide the default choice, avoiding infinite recursion.
7005+ bintools ? if targetPlatform.isDarwin then darwin.binutils else binutils
7006+ , libc ? bintools.libc
7007+ , ...
7008+ } @ extraArgs:
7009+ callPackage ../build-support/cc-wrapper (let self = {
70017010 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
70027011 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
70037012 nativePrefix = stdenv.cc.nativePrefix or "";
7004− noLibc = !nativeLibc && (libc == null);
7013+ noLibc = !self.nativeLibc && (self.libc == null);
70057014
70067015 isGNU = cc.isGNU or false;
70077016 isClang = cc.isClang or false;
70087017
7009− inherit name cc bintools libc extraBuildCommands;
7010− };
7011−
7012− ccWrapperFun = callPackage ../build-support/cc-wrapper;
7013− bintoolsWrapperFun = callPackage ../build-support/bintools-wrapper;
7018+ inherit cc bintools libc;
7019+ } // extraArgs; in self);
70147020
70157021 wrapCC = cc: wrapCCWith {
7016− name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
70177022 inherit cc;
7018− # This should be the only bintools runtime dep with this sort of logic. The
7019− # Others should instead delegate to the next stage's choice with
7020− # `targetPackages.stdenv.cc.bintools`. This one is different just to
7021− # provide the default choice, avoiding infinite recursion.
7022− bintools = if targetPlatform.isDarwin then darwin.binutils else binutils;
7023− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
70247023 };
70257024
7026− wrapBintoolsWith = { bintools, libc, extraBuildCommands ? "" }: bintoolsWrapperFun {
7025+ wrapBintoolsWith =
7026+ { bintools
7027+ , libc ? if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc
7028+ , ...
7029+ } @ extraArgs:
7030+ callPackage ../build-support/bintools-wrapper (let self = {
70277031 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
70287032 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
70297033 nativePrefix = stdenv.cc.nativePrefix or "";
70307034
7031− noLibc = (libc == null);
7035+ noLibc = (self.libc == null);
70327036
7033− inherit bintools libc extraBuildCommands;
7034− };
7037+ inherit bintools libc;
7038+ } // extraArgs; in self);
70357039
70367040 # prolog
70377041 yap = callPackage ../development/compilers/yap { };
@@ -7637,11 +7641,9 @@ with pkgs;
76377641 noSysDirs = (targetPlatform != buildPlatform) || noSysDirs;
76387642 };
76397643 binutils = wrapBintoolsWith {
7640− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
76417644 bintools = binutils-unwrapped;
76427645 };
76437646 binutils_nogold = lowPrio (wrapBintoolsWith {
7644− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
76457647 bintools = binutils-unwrapped.override {
76467648 gold = false;
76477649 };