More renames

This commit is contained in:
Eelco Dolstra 2012-12-28 19:42:10 +01:00
parent dcdef5a0fe
commit e2d505b24e
4 changed files with 25 additions and 25 deletions

View File

@ -3,7 +3,7 @@
args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
, texinfo, glibcCross, hurdPartedCross, libuuid, samba_light , texinfo, glibcCross, hurdPartedCross, libuuid, samba_light
, gccCrossStageStatic, gccCrossStageFinal , gccCrossStageStatic, gccCrossStageFinal
, forceBuildDrv, forceSystem, newScope, platform, config, crossSystem , forceNativeDrv, forceSystem, newScope, platform, config, crossSystem
, overrides ? {} }: , overrides ? {} }:
with args; with args;
@ -12,7 +12,7 @@ let
callPackage = newScope gnu; callPackage = newScope gnu;
gnu = { gnu = {
hurdCross = forceBuildDrv(callPackage ./hurd { hurdCross = forceNativeDrv (callPackage ./hurd {
inherit fetchgit stdenv autoconf libtool texinfo inherit fetchgit stdenv autoconf libtool texinfo
glibcCross hurdPartedCross; glibcCross hurdPartedCross;
inherit (gnu) machHeaders mig; inherit (gnu) machHeaders mig;
@ -23,7 +23,7 @@ let
gccCross = gccCrossStageFinal; gccCross = gccCrossStageFinal;
}); });
hurdCrossIntermediate = forceBuildDrv(callPackage ./hurd { hurdCrossIntermediate = forceNativeDrv (callPackage ./hurd {
inherit fetchgit stdenv autoconf libtool texinfo glibcCross; inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
inherit (gnu) machHeaders mig; inherit (gnu) machHeaders mig;
hurdPartedCross = null; hurdPartedCross = null;
@ -58,7 +58,7 @@ let
hurd = null; hurd = null;
}; };
libpthreadCross = forceBuildDrv(callPackage ./libpthread { libpthreadCross = forceNativeDrv (callPackage ./libpthread {
inherit fetchgit stdenv autoconf automake libtool glibcCross; inherit fetchgit stdenv autoconf automake libtool glibcCross;
inherit (gnu) machHeaders hurdHeaders; inherit (gnu) machHeaders hurdHeaders;
hurd = gnu.hurdCrossIntermediate; hurd = gnu.hurdCrossIntermediate;

View File

@ -130,13 +130,13 @@ rec {
# In nixpkgs, sometimes 'null' gets in as a buildInputs element, # In nixpkgs, sometimes 'null' gets in as a buildInputs element,
# and we handle that through isAttrs. # and we handle that through isAttrs.
getBuildDrv = drv: drv.nativeDrv or drv; getNativeDrv = drv: drv.nativeDrv or drv;
getHostDrv = drv: drv.crossDrv or drv; getCrossDrv = drv: drv.crossDrv or drv;
nativeBuildInputsDrvs = map getBuildDrv nativeBuildInputs; nativeBuildInputsDrvs = map getNativeDrv nativeBuildInputs;
buildInputsDrvs = map getHostDrv buildInputs; buildInputsDrvs = map getCrossDrv buildInputs;
buildInputsDrvsAsBuildInputs = map getBuildDrv buildInputs; buildInputsDrvsAsBuildInputs = map getNativeDrv buildInputs;
propagatedBuildInputsDrvs = map getHostDrv propagatedBuildInputs; propagatedBuildInputsDrvs = map getCrossDrv propagatedBuildInputs;
propagatedNativeBuildInputsDrvs = map getBuildDrv propagatedNativeBuildInputs; propagatedNativeBuildInputsDrvs = map getNativeDrv propagatedNativeBuildInputs;
# The base stdenv already knows that nativeBuildInputs and # The base stdenv already knows that nativeBuildInputs and
# buildInputs should be built with the usual gcc-wrapper # buildInputs should be built with the usual gcc-wrapper
@ -146,12 +146,12 @@ rec {
# Temporary expression until the cross_renaming, to handle the # Temporary expression until the cross_renaming, to handle the
# case of pkgconfig given as buildInput, but to be used as # case of pkgconfig given as buildInput, but to be used as
# nativeBuildInput. # nativeBuildInput.
hostAsBuildDrv = drv: hostAsNativeDrv = drv:
builtins.unsafeDiscardStringContext drv.nativeDrv.drvPath builtins.unsafeDiscardStringContext drv.nativeDrv.drvPath
== builtins.unsafeDiscardStringContext drv.crossDrv.drvPath; == builtins.unsafeDiscardStringContext drv.crossDrv.drvPath;
buildInputsNotNull = stdenv.lib.filter buildInputsNotNull = stdenv.lib.filter
(drv: builtins.isAttrs drv && drv ? nativeDrv) buildInputs; (drv: builtins.isAttrs drv && drv ? nativeDrv) buildInputs;
nativeInputsFromBuildInputs = stdenv.lib.filter hostAsBuildDrv buildInputsNotNull; nativeInputsFromBuildInputs = stdenv.lib.filter hostAsNativeDrv buildInputsNotNull;
# We should overwrite the input attributes in crossDrv, to overwrite # We should overwrite the input attributes in crossDrv, to overwrite
# the defaults for only-native builds in the base stdenv # the defaults for only-native builds in the base stdenv

View File

@ -222,7 +222,7 @@ let
else else
defaultStdenv; defaultStdenv;
forceBuildDrv = drv : if (crossSystem == null) then drv else forceNativeDrv = drv : if (crossSystem == null) then drv else
(drv // { crossDrv = drv.nativeDrv; }); (drv // { crossDrv = drv.nativeDrv; });
# A stdenv capable of building 32-bit binaries. On x86_64-linux, # A stdenv capable of building 32-bit binaries. On x86_64-linux,
@ -1992,7 +1992,7 @@ let
if isMingw then windows.mingw_headers1 else null; if isMingw then windows.mingw_headers1 else null;
in in
wrapGCCCross { wrapGCCCross {
gcc = forceBuildDrv (lib.addMetaAttrs { platforms = []; } ( gcc = forceNativeDrv (lib.addMetaAttrs { platforms = []; } (
gcc_realCross.override { gcc_realCross.override {
crossStageStatic = true; crossStageStatic = true;
langCC = false; langCC = false;
@ -2013,7 +2013,7 @@ let
}; };
gccCrossStageFinal = wrapGCCCross { gccCrossStageFinal = wrapGCCCross {
gcc = forceBuildDrv (gcc_realCross.override { gcc = forceNativeDrv (gcc_realCross.override {
libpthreadCross = libpthreadCross =
# FIXME: Don't explicitly refer to `i586-pc-gnu'. # FIXME: Don't explicitly refer to `i586-pc-gnu'.
if crossSystem != null && crossSystem.config == "i586-pc-gnu" if crossSystem != null && crossSystem.config == "i586-pc-gnu"
@ -2683,7 +2683,7 @@ let
wrapGCCCross = wrapGCCCross =
{gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}: {gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}:
forceBuildDrv (import ../build-support/gcc-cross-wrapper { forceNativeDrv (import ../build-support/gcc-cross-wrapper {
nativeTools = false; nativeTools = false;
nativeLibc = false; nativeLibc = false;
noLibc = (libc == null); noLibc = (libc == null);
@ -2967,7 +2967,7 @@ let
gold = true; gold = true;
}); });
binutilsCross = lowPrio (forceBuildDrv (import ../development/tools/misc/binutils { binutilsCross = lowPrio (forceNativeDrv (import ../development/tools/misc/binutils {
inherit stdenv fetchurl zlib; inherit stdenv fetchurl zlib;
noSysDirs = true; noSysDirs = true;
cross = assert crossSystem != null; crossSystem; cross = assert crossSystem != null; crossSystem;
@ -3182,7 +3182,7 @@ let
cross_renaming: we should make all programs use pkgconfig as cross_renaming: we should make all programs use pkgconfig as
nativeBuildInput after the renaming. nativeBuildInput after the renaming.
*/ */
pkgconfig = forceBuildDrv (callPackage ../development/tools/misc/pkgconfig { }); pkgconfig = forceNativeDrv (callPackage ../development/tools/misc/pkgconfig { });
pkgconfigUpstream = lowPrio (pkgconfig.override { vanilla = true; }); pkgconfigUpstream = lowPrio (pkgconfig.override { vanilla = true; });
premake = callPackage ../development/tools/misc/premake { }; premake = callPackage ../development/tools/misc/premake { };
@ -3636,7 +3636,7 @@ let
gccCross = null; gccCross = null;
}) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {}); }) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {});
glibc213Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.13) glibc213Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.13)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu"; (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
in { in {
inherit stdenv fetchurl; inherit stdenv fetchurl;
@ -5688,12 +5688,12 @@ let
linuxHeaders35 = callPackage ../os-specific/linux/kernel-headers/3.5.nix { }; linuxHeaders35 = callPackage ../os-specific/linux/kernel-headers/3.5.nix { };
linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix { linuxHeaders26Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix {
inherit stdenv fetchurl perl; inherit stdenv fetchurl perl;
cross = assert crossSystem != null; crossSystem; cross = assert crossSystem != null; crossSystem;
}); });
linuxHeaders24Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.4.nix { linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
inherit stdenv fetchurl perl; inherit stdenv fetchurl perl;
cross = assert crossSystem != null; crossSystem; cross = assert crossSystem != null; crossSystem;
}); });

View File

@ -3,7 +3,7 @@ let
nativePlatforms = linux; nativePlatforms = linux;
/* Basic list of packages to cross-build */ /* Basic list of packages to cross-build */
basicHostDrv = { basicCrossDrv = {
gccCrossStageFinal = nativePlatforms; gccCrossStageFinal = nativePlatforms;
bison.crossDrv = nativePlatforms; bison.crossDrv = nativePlatforms;
busybox.crossDrv = nativePlatforms; busybox.crossDrv = nativePlatforms;
@ -24,11 +24,11 @@ let
/* Basic list of packages to be natively built, /* Basic list of packages to be natively built,
but need a crossSystem defined to get meaning */ but need a crossSystem defined to get meaning */
basicBuildDrv = { basicNativeDrv = {
gdbCross = nativePlatforms; gdbCross = nativePlatforms;
}; };
basic = basicHostDrv // basicBuildDrv; basic = basicCrossDrv // basicNativeDrv;
in in
( (