top-level: crossSystem is no longer exposed to packages. Use *Platform.

This commit is contained in:
John Ericson 2017-01-15 17:31:52 -05:00
parent 1c0365bd88
commit a1a798f017
6 changed files with 42 additions and 41 deletions

View File

@ -1,5 +1,6 @@
{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils { stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
, autoconf, automake, happy, alex, python3, crossSystem, selfPkgs, cross ? null , autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
, selfPkgs, cross ? null
}: }:
let let
@ -68,9 +69,9 @@ in stdenv.mkDerivation (rec {
passthru = { passthru = {
inherit bootPkgs; inherit bootPkgs;
} // stdenv.lib.optionalAttrs (crossSystem != null) { } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
crossCompiler = selfPkgs.ghc.override { crossCompiler = selfPkgs.ghc.override {
cross = crossSystem; cross = targetPlatform;
bootPkgs = selfPkgs; bootPkgs = selfPkgs;
}; };
}; };

View File

@ -3,7 +3,8 @@
args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
, texinfo, glibcCross, hurdPartedCross, libuuid, samba , texinfo, glibcCross, hurdPartedCross, libuuid, samba
, gccCrossStageStatic, gccCrossStageFinal , gccCrossStageStatic, gccCrossStageFinal
, forcedNativePackages, forceSystem, newScope, platform, config, crossSystem , forcedNativePackages, forceSystem, newScope, platform, config
, targetPlatform, buildPlatform
, overrides ? {} }: , overrides ? {} }:
with args; with args;
@ -19,7 +20,7 @@ let
libuuid = libuuid.crossDrv; libuuid = libuuid.crossDrv;
automake = automake111x; automake = automake111x;
headersOnly = false; headersOnly = false;
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
gccCross = gccCrossStageFinal; gccCross = gccCrossStageFinal;
}; };
@ -30,7 +31,7 @@ let
libuuid = null; libuuid = null;
automake = automake111x; automake = automake111x;
headersOnly = false; headersOnly = false;
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
# The "final" GCC needs glibc and the Hurd libraries (libpthread in # The "final" GCC needs glibc and the Hurd libraries (libpthread in
# particular) so we first need an intermediate Hurd built with the # particular) so we first need an intermediate Hurd built with the
@ -63,7 +64,7 @@ let
inherit (gnu) machHeaders hurdHeaders; inherit (gnu) machHeaders hurdHeaders;
hurd = gnu.hurdCrossIntermediate; hurd = gnu.hurdCrossIntermediate;
gccCross = gccCrossStageStatic; gccCross = gccCrossStageStatic;
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
}; };
# In theory GNU Mach doesn't have to be cross-compiled. However, since it # In theory GNU Mach doesn't have to be cross-compiled. However, since it

View File

@ -116,7 +116,7 @@ rec {
stdenv.mkDerivation { stdenv.mkDerivation {
name = "stdenv-bootstrap-tools-cross"; name = "stdenv-bootstrap-tools-cross";
crossConfig = pkgsUnspliced.crossSystem.config; crossConfig = pkgsUnspliced.hostPlatform.config;
buildInputs = [nukeReferences cpio binutilsCross]; buildInputs = [nukeReferences cpio binutilsCross];

View File

@ -27,7 +27,7 @@ with pkgs;
callPackage_i686 = pkgsi686Linux.callPackage; callPackage_i686 = pkgsi686Linux.callPackage;
forcedNativePackages = if crossSystem == null then pkgs else buildPackages; forcedNativePackages = if hostPlatform == buildPlatform then pkgs else buildPackages;
# A stdenv capable of building 32-bit binaries. On x86_64-linux, # A stdenv capable of building 32-bit binaries. On x86_64-linux,
# it uses GCC compiled with multilib support; on i686-linux, it's # it uses GCC compiled with multilib support; on i686-linux, it's
@ -3246,7 +3246,7 @@ with pkgs;
pngout = callPackage ../tools/graphics/pngout { }; pngout = callPackage ../tools/graphics/pngout { };
hurdPartedCross = hurdPartedCross =
if crossSystem != null && crossSystem.config == "i586-pc-gnu" if targetPlatform != buildPlatform && targetPlatform.config == "i586-pc-gnu"
then (makeOverridable then (makeOverridable
({ hurd }: ({ hurd }:
(parted.override { (parted.override {
@ -4751,14 +4751,14 @@ with pkgs;
gccApple = throw "gccApple is no longer supported"; gccApple = throw "gccApple is no longer supported";
gccCrossStageStatic = assert crossSystem != null; let gccCrossStageStatic = assert targetPlatform != buildPlatform; let
libcCross1 = libcCross1 =
if stdenv.cross.libc == "msvcrt" then windows.mingw_w64_headers if stdenv.cross.libc == "msvcrt" then windows.mingw_w64_headers
else if stdenv.cross.libc == "libSystem" then darwin.xcode else if stdenv.cross.libc == "libSystem" then darwin.xcode
else null; else null;
in wrapGCCCross { in wrapGCCCross {
gcc = forcedNativePackages.gcc.cc.override { gcc = forcedNativePackages.gcc.cc.override {
cross = crossSystem; cross = targetPlatform;
crossStageStatic = true; crossStageStatic = true;
langCC = false; langCC = false;
libcCross = libcCross1; libcCross = libcCross1;
@ -4768,31 +4768,31 @@ with pkgs;
}; };
libc = libcCross1; libc = libcCross1;
binutils = binutilsCross; binutils = binutilsCross;
cross = crossSystem; cross = targetPlatform;
}; };
# Only needed for mingw builds # Only needed for mingw builds
gccCrossMingw2 = assert crossSystem != null; wrapGCCCross { gccCrossMingw2 = assert targetPlatform != buildPlatform; wrapGCCCross {
gcc = gccCrossStageStatic.gcc; gcc = gccCrossStageStatic.gcc;
libc = windows.mingw_headers2; libc = windows.mingw_headers2;
binutils = binutilsCross; binutils = binutilsCross;
cross = assert crossSystem != null; crossSystem; cross = targetPlatform;
}; };
gccCrossStageFinal = assert crossSystem != null; wrapGCCCross { gccCrossStageFinal = assert targetPlatform != buildPlatform; wrapGCCCross {
gcc = forcedNativePackages.gcc.cc.override { gcc = forcedNativePackages.gcc.cc.override {
cross = crossSystem; cross = targetPlatform;
crossStageStatic = false; crossStageStatic = false;
# XXX: We have troubles cross-compiling libstdc++ on MinGW (see # XXX: We have troubles cross-compiling libstdc++ on MinGW (see
# <http://hydra.nixos.org/build/4268232>), so don't even try. # <http://hydra.nixos.org/build/4268232>), so don't even try.
langCC = crossSystem.config != "i686-pc-mingw32"; langCC = targetPlatform.config != "i686-pc-mingw32";
# Why is this needed? # Why is this needed?
inherit (forcedNativePackages) binutilsCross; inherit (forcedNativePackages) binutilsCross;
}; };
libc = libcCross; libc = libcCross;
binutils = binutilsCross; binutils = binutilsCross;
cross = crossSystem; cross = targetPlatform;
}; };
gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 { gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
@ -4810,7 +4810,7 @@ with pkgs;
# and host != build), `cross' must be null but the cross-libc must still # and host != build), `cross' must be null but the cross-libc must still
# be passed. # be passed.
cross = null; cross = null;
libcCross = if crossSystem != null then libcCross else null; libcCross = if targetPlatform != buildPlatform then libcCross else null;
})); }));
gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 { gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 {
@ -4823,7 +4823,7 @@ with pkgs;
# and host != build), `cross' must be null but the cross-libc must still # and host != build), `cross' must be null but the cross-libc must still
# be passed. # be passed.
cross = null; cross = null;
libcCross = if crossSystem != null then libcCross else null; libcCross = if targetPlatform != buildPlatform then libcCross else null;
isl = if !stdenv.isDarwin then isl_0_14 else null; isl = if !stdenv.isDarwin then isl_0_14 else null;
cloog = if !stdenv.isDarwin then cloog else null; cloog = if !stdenv.isDarwin then cloog else null;
@ -4840,7 +4840,7 @@ with pkgs;
# and host != build), `cross' must be null but the cross-libc must still # and host != build), `cross' must be null but the cross-libc must still
# be passed. # be passed.
cross = null; cross = null;
libcCross = if crossSystem != null then libcCross else null; libcCross = if targetPlatform != buildPlatform then libcCross else null;
isl = if !stdenv.isDarwin then isl_0_11 else null; isl = if !stdenv.isDarwin then isl_0_11 else null;
@ -4857,7 +4857,7 @@ with pkgs;
# and host != build), `cross' must be null but the cross-libc must still # and host != build), `cross' must be null but the cross-libc must still
# be passed. # be passed.
cross = null; cross = null;
libcCross = if crossSystem != null then libcCross else null; libcCross = if targetPlatform != buildPlatform then libcCross else null;
isl = if !stdenv.isDarwin then isl_0_14 else null; isl = if !stdenv.isDarwin then isl_0_14 else null;
})); }));
@ -4872,7 +4872,7 @@ with pkgs;
# and host != build), `cross' must be null but the cross-libc must still # and host != build), `cross' must be null but the cross-libc must still
# be passed. # be passed.
cross = null; cross = null;
libcCross = if crossSystem != null then libcCross else null; libcCross = if targetPlatform != buildPlatform then libcCross else null;
isl = if !stdenv.isDarwin then isl_0_14 else null; isl = if !stdenv.isDarwin then isl_0_14 else null;
})); }));
@ -5005,7 +5005,7 @@ with pkgs;
# Haskell and GHC # Haskell and GHC
haskell = callPackage ./haskell-packages.nix { inherit crossSystem; }; haskell = callPackage ./haskell-packages.nix { };
haskellPackages = haskell.packages.ghc801.override { haskellPackages = haskell.packages.ghc801.override {
overrides = config.haskellPackageOverrides or (self: super: {}); overrides = config.haskellPackageOverrides or (self: super: {});
@ -6068,11 +6068,11 @@ with pkgs;
gold = false; gold = false;
}); });
binutilsCross = assert crossSystem != null; lowPrio ( binutilsCross = assert targetPlatform != buildPlatform; lowPrio (
if crossSystem.libc == "libSystem" then darwin.cctools_cross if targetPlatform.libc == "libSystem" then darwin.cctools_cross
else forcedNativePackages.binutils.override { else forcedNativePackages.binutils.override {
noSysDirs = true; noSysDirs = true;
cross = crossSystem; cross = targetPlatform;
}); });
bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { }; bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { };
@ -6718,7 +6718,7 @@ with pkgs;
gdbGuile = lowPrio (gdb.override { inherit guile; }); gdbGuile = lowPrio (gdb.override { inherit guile; });
gdbCross = lowPrio (callPackage ../development/tools/misc/gdb { gdbCross = lowPrio (callPackage ../development/tools/misc/gdb {
target = crossSystem; target = if targetPlatform != buildPlatform then targetPlatform else null;
}); });
gdb-multitarget = lowPrio (gdb.override { multitarget = true; }); gdb-multitarget = lowPrio (gdb.override { multitarget = true; });
@ -7332,7 +7332,7 @@ with pkgs;
else if name == "libSystem" then darwin.xcode else if name == "libSystem" then darwin.xcode
else throw "Unknown libc"; else throw "Unknown libc";
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc; libcCross = assert targetPlatform != buildPlatform; libcCrossChooser targetPlatform.libc;
# Only supported on Linux # Only supported on Linux
glibcLocales = if stdenv.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null; glibcLocales = if stdenv.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null;
@ -10895,7 +10895,7 @@ with pkgs;
apple-source-releases = callPackage ../os-specific/darwin/apple-source-releases { }; apple-source-releases = callPackage ../os-specific/darwin/apple-source-releases { };
in apple-source-releases // rec { in apple-source-releases // rec {
cctools_cross = callPackage (forcedNativePackages.callPackage ../os-specific/darwin/cctools/port.nix {}).cross { cctools_cross = callPackage (forcedNativePackages.callPackage ../os-specific/darwin/cctools/port.nix {}).cross {
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
inherit maloader; inherit maloader;
xctoolchain = xcode.toolchain; xctoolchain = xcode.toolchain;
}; };
@ -10968,7 +10968,7 @@ with pkgs;
libossp_uuid = callPackage ../development/libraries/libossp-uuid { }; libossp_uuid = callPackage ../development/libraries/libossp-uuid { };
libuuid = libuuid =
if crossSystem != null && crossSystem.config == "i586-pc-gnu" if targetPlatform != buildPlatform && targetPlatform.config == "i586-pc-gnu"
then (utillinuxMinimal // { then (utillinuxMinimal // {
crossDrv = lib.overrideDerivation utillinuxMinimal.crossDrv (args: { crossDrv = lib.overrideDerivation utillinuxMinimal.crossDrv (args: {
# `libblkid' fails to build on GNU/Hurd. # `libblkid' fails to build on GNU/Hurd.
@ -11053,7 +11053,7 @@ with pkgs;
# GNU/Hurd core packages. # GNU/Hurd core packages.
gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { gnu = recurseIntoAttrs (callPackage ../os-specific/gnu {
inherit platform crossSystem; inherit platform;
}); });
hwdata = callPackage ../os-specific/linux/hwdata { }; hwdata = callPackage ../os-specific/linux/hwdata { };
@ -11133,11 +11133,11 @@ with pkgs;
linuxHeaders = linuxHeaders_4_4; linuxHeaders = linuxHeaders_4_4;
linuxHeaders24Cross = forcedNativePackages.callPackage ../os-specific/linux/kernel-headers/2.4.nix { linuxHeaders24Cross = forcedNativePackages.callPackage ../os-specific/linux/kernel-headers/2.4.nix {
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
}; };
linuxHeaders26Cross = forcedNativePackages.callPackage ../os-specific/linux/kernel-headers/4.4.nix { linuxHeaders26Cross = forcedNativePackages.callPackage ../os-specific/linux/kernel-headers/4.4.nix {
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
}; };
linuxHeaders_3_18 = callPackage ../os-specific/linux/kernel-headers/3.18.nix { }; linuxHeaders_3_18 = callPackage ../os-specific/linux/kernel-headers/3.18.nix { };
@ -11149,8 +11149,8 @@ with pkgs;
else if ver == "2.6" then linuxHeaders26Cross else if ver == "2.6" then linuxHeaders26Cross
else throw "Unknown linux kernel version"; else throw "Unknown linux kernel version";
linuxHeadersCross = assert crossSystem != null; linuxHeadersCross = assert targetPlatform != buildPlatform;
linuxHeadersCrossChooser crossSystem.platform.kernelMajor; linuxHeadersCrossChooser targetPlatform.platform.kernelMajor;
kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { }; kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
@ -11812,7 +11812,7 @@ with pkgs;
uclibcCross = lowPrio (callPackage ../os-specific/linux/uclibc { uclibcCross = lowPrio (callPackage ../os-specific/linux/uclibc {
linuxHeaders = linuxHeadersCross; linuxHeaders = linuxHeadersCross;
gccCross = gccCrossStageStatic; gccCross = gccCrossStageStatic;
cross = assert crossSystem != null; crossSystem; cross = assert targetPlatform != buildPlatform; targetPlatform;
}); });
udev = systemd; udev = systemd;

View File

@ -1,4 +1,4 @@
{ pkgs, callPackage, stdenv, crossSystem }: { pkgs, callPackage, stdenv, buildPlatform, targetPlatform }:
rec { rec {
@ -55,7 +55,7 @@ rec {
ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec { ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec {
bootPkgs = packages.ghc7103; bootPkgs = packages.ghc7103;
inherit (bootPkgs) alex happy; inherit (bootPkgs) alex happy;
inherit crossSystem; inherit buildPlatform targetPlatform;
selfPkgs = packages.ghcHEAD; selfPkgs = packages.ghcHEAD;
}; };
ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs { ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs {

View File

@ -101,7 +101,6 @@ let
cross = targetPlatform; cross = targetPlatform;
}; };
inherit (buildPlatform) system platform; inherit (buildPlatform) system platform;
crossSystem = if targetPlatform != buildPlatform then targetPlatform else null;
}; };
splice = self: super: import ./splice.nix lib self; splice = self: super: import ./splice.nix lib self;