diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-03-13 17:03:53 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-03-24 22:12:15 -0400 |
commit | 655a29ff9ccf9b27e52893de24f9535bda7e3cd2 (patch) | |
tree | fd2347e501b4bbf03c3470491a647b186cd4882f /pkgs/development/compilers | |
parent | 70d71bbbe46eecfefc920bb1a919960d5feb9fc4 (diff) | |
download | nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar.gz nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar.bz2 nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar.lz nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar.xz nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.tar.zst nixlib-655a29ff9ccf9b27e52893de24f9535bda7e3cd2.zip |
ghc, go, guile: Use new `pkgs*`
`pkgsBuildTarget` allows us to avoid repeated and confusing conditions. The others merely provide clarity for one the foreign package set's target platform matters.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/ghc/8.2.2.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.4.4.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.6.4.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/go/1.11.nix | 15 | ||||
-rw-r--r-- | pkgs/development/compilers/go/1.12.nix | 15 |
6 files changed, 28 insertions, 42 deletions
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 3e355dc302d6..a88cf9c01165 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -1,4 +1,4 @@ -{ stdenv, targetPackages +{ stdenv, pkgsBuildTarget, targetPackages # build-tools , bootPkgs @@ -70,11 +70,9 @@ let ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc") libiconv; - toolsForTarget = - if hostPlatform == buildPlatform then - [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm - else assert targetPlatform == hostPlatform; # build != host == target - [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; + toolsForTarget = [ + pkgsBuildTarget.targetPackages.stdenv.cc + ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; targetCC = builtins.head toolsForTarget; diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix index 874580c87aab..da72c351ec66 100644 --- a/pkgs/development/compilers/ghc/8.4.4.nix +++ b/pkgs/development/compilers/ghc/8.4.4.nix @@ -1,4 +1,4 @@ -{ stdenv, targetPackages +{ stdenv, pkgsBuildTarget, targetPackages # build-tools , bootPkgs @@ -72,11 +72,9 @@ let ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; - toolsForTarget = - if hostPlatform == buildPlatform then - [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm - else assert targetPlatform == hostPlatform; # build != host == target - [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; + toolsForTarget = [ + pkgsBuildTarget.targetPackages.stdenv.cc + ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; targetCC = builtins.head toolsForTarget; diff --git a/pkgs/development/compilers/ghc/8.6.4.nix b/pkgs/development/compilers/ghc/8.6.4.nix index 140cea22442e..f970836fd696 100644 --- a/pkgs/development/compilers/ghc/8.6.4.nix +++ b/pkgs/development/compilers/ghc/8.6.4.nix @@ -1,4 +1,4 @@ -{ stdenv, targetPackages +{ stdenv, pkgsBuildTarget, targetPackages # build-tools , bootPkgs @@ -72,11 +72,9 @@ let ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; - toolsForTarget = - if hostPlatform == buildPlatform then - [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm - else assert targetPlatform == hostPlatform; # build != host == target - [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; + toolsForTarget = [ + pkgsBuildTarget.targetPackages.stdenv.cc + ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; targetCC = builtins.head toolsForTarget; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 7e670743f7fc..087d5a2c678d 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -1,4 +1,4 @@ -{ stdenv, targetPackages +{ stdenv, pkgsBuildTarget, targetPackages # build-tools , bootPkgs @@ -69,11 +69,9 @@ let ++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; - toolsForTarget = - if hostPlatform == buildPlatform then - [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm - else assert targetPlatform == hostPlatform; # build != host == target - [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; + toolsForTarget = [ + pkgsBuildTarget.targetPackages.stdenv.cc + ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; targetCC = builtins.head toolsForTarget; diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix index db3731c2fcaa..355b2559e98d 100644 --- a/pkgs/development/compilers/go/1.11.nix +++ b/pkgs/development/compilers/go/1.11.nix @@ -1,7 +1,8 @@ { stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin , perl, which, pkgconfig, patch, procps, pcre, cacert, llvm, Security, Foundation , mailcap, runtimeShell -, buildPackages, targetPackages }: +, buildPackages, pkgsTargetTarget +}: let @@ -152,16 +153,12 @@ stdenv.mkDerivation rec { # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc" - else if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${stdenv.cc.targetPrefix}cc" + CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" else null; - CXX_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++" - else if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${stdenv.cc.targetPrefix}c++" + CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" else null; diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix index d7bbd4eaf0fc..bcd2eacc7ecf 100644 --- a/pkgs/development/compilers/go/1.12.nix +++ b/pkgs/development/compilers/go/1.12.nix @@ -1,7 +1,8 @@ { stdenv, fetchurl, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin , perl, which, pkgconfig, patch, procps, pcre, cacert, llvm, Security, Foundation , mailcap, runtimeShell -, buildPackages, targetPackages }: +, buildPackages, pkgsTargetTarget +}: let @@ -154,16 +155,12 @@ stdenv.mkDerivation rec { # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc" - else if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${stdenv.cc.targetPrefix}cc" + CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" else null; - CXX_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++" - else if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${stdenv.cc.targetPrefix}c++" + CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then + "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" else null; |