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.
This commit is contained in:
committed by
John Ericson
parent
70d71bbbe4
commit
655a29ff9c
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user