diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2018-05-22 19:21:35 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-23 00:27:30 -0400 |
commit | 25e866a7fe36045470e27a9b320703a35266d889 (patch) | |
tree | 7ac4a419976304696b0394c52153cff83103cb83 /pkgs | |
parent | 07d73c4ab065ad0a06551b39cc6d1c7a874a6913 (diff) | |
download | nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar.gz nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar.bz2 nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar.lz nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar.xz nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.tar.zst nixpkgs-25e866a7fe36045470e27a9b320703a35266d889.zip |
treewide: Less {cc,bintools}-wrapper eta expansion
Also makes the LLVM ones more correct
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/compilers/llvm/3.7/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/3.8/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/3.9/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/4/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/5/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/6/default.nix | 10 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 44 |
7 files changed, 41 insertions, 63 deletions
diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix index 5cac04c044d..3003a773cc6 100644 --- a/pkgs/development/compilers/llvm/3.7/default.nix +++ b/pkgs/development/compilers/llvm/3.7/default.nix @@ -1,5 +1,5 @@ { newScope, stdenv, libstdcxxHook, cmake, libxml2, python2, isl, fetchurl -, overrideCC, wrapCC, ccWrapperFun, darwin +, overrideCC, wrapCCWith, darwin }: let @@ -27,17 +27,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/development/compilers/llvm/3.8/default.nix b/pkgs/development/compilers/llvm/3.8/default.nix index 9e37f93dbdd..6cb2c5676d0 100644 --- a/pkgs/development/compilers/llvm/3.8/default.nix +++ b/pkgs/development/compilers/llvm/3.8/default.nix @@ -1,4 +1,4 @@ -{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }: +{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -26,17 +26,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/development/compilers/llvm/3.9/default.nix b/pkgs/development/compilers/llvm/3.9/default.nix index a675bcceb1c..7d2ecd1a156 100644 --- a/pkgs/development/compilers/llvm/3.9/default.nix +++ b/pkgs/development/compilers/llvm/3.9/default.nix @@ -1,4 +1,4 @@ -{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }: +{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -26,17 +26,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix index 562f9e3457d..c92a1d84c0c 100644 --- a/pkgs/development/compilers/llvm/4/default.nix +++ b/pkgs/development/compilers/llvm/4/default.nix @@ -1,5 +1,5 @@ { lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook -, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun +, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith , darwin }: @@ -40,17 +40,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 13e1d2308f8..63fb9831651 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -1,5 +1,5 @@ { lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook -, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun +, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith , darwin }: @@ -40,17 +40,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index cfa9e9e15fc..61fee1542e7 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -1,5 +1,5 @@ { lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook -, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun +, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith , darwin }: @@ -40,17 +40,13 @@ let clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; - libstdcxxClang = ccWrapperFun { + libstdcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ libstdcxxHook ]; }; - libcxxClang = ccWrapperFun { + libcxxClang = wrapCCWith { cc = self.clang-unwrapped; - /* FIXME is this right? */ - inherit (stdenv.cc) bintools libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6c0d48780d3..c6d02b487f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6996,42 +6996,46 @@ with pkgs; wla-dx = callPackage ../development/compilers/wla-dx { }; - wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "" }: - ccWrapperFun rec { + wrapCCWith = + { cc + , # This should be the only bintools runtime dep with this sort of logic. The + # Others should instead delegate to the next stage's choice with + # `targetPackages.stdenv.cc.bintools`. This one is different just to + # provide the default choice, avoiding infinite recursion. + bintools ? if targetPlatform.isDarwin then darwin.binutils else binutils + , libc ? bintools.libc + , ... + } @ extraArgs: + callPackage ../build-support/cc-wrapper (let self = { nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false; nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false; nativePrefix = stdenv.cc.nativePrefix or ""; - noLibc = !nativeLibc && (libc == null); + noLibc = !self.nativeLibc && (self.libc == null); isGNU = cc.isGNU or false; isClang = cc.isClang or false; - inherit name cc bintools libc extraBuildCommands; - }; - - ccWrapperFun = callPackage ../build-support/cc-wrapper; - bintoolsWrapperFun = callPackage ../build-support/bintools-wrapper; + inherit cc bintools libc; + } // extraArgs; in self); wrapCC = cc: wrapCCWith { - name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper"; inherit cc; - # This should be the only bintools runtime dep with this sort of logic. The - # Others should instead delegate to the next stage's choice with - # `targetPackages.stdenv.cc.bintools`. This one is different just to - # provide the default choice, avoiding infinite recursion. - bintools = if targetPlatform.isDarwin then darwin.binutils else binutils; - libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; }; - wrapBintoolsWith = { bintools, libc, extraBuildCommands ? "" }: bintoolsWrapperFun { + wrapBintoolsWith = + { bintools + , libc ? if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc + , ... + } @ extraArgs: + callPackage ../build-support/bintools-wrapper (let self = { nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false; nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false; nativePrefix = stdenv.cc.nativePrefix or ""; - noLibc = (libc == null); + noLibc = (self.libc == null); - inherit bintools libc extraBuildCommands; - }; + inherit bintools libc; + } // extraArgs; in self); # prolog yap = callPackage ../development/compilers/yap { }; @@ -7637,11 +7641,9 @@ with pkgs; noSysDirs = (targetPlatform != buildPlatform) || noSysDirs; }; binutils = wrapBintoolsWith { - libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; bintools = binutils-unwrapped; }; binutils_nogold = lowPrio (wrapBintoolsWith { - libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; bintools = binutils-unwrapped.override { gold = false; }; |