summary refs log tree commit diff
path: root/pkgs/os-specific/gnu/default.nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-04-04 20:25:51 +0000
committerLudovic Courtès <ludo@gnu.org>2012-04-04 20:25:51 +0000
commit3226d8b91db01e3a0cf3ae28671cb9b336c554e0 (patch)
treecd4212f3a35c3d884085e1933833d5ef1d1d47af /pkgs/os-specific/gnu/default.nix
parent1663ca33447165932b3305c1e9a3ab0f8c353c8b (diff)
downloadnixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar.gz
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar.bz2
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar.lz
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar.xz
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.tar.zst
nixlib-3226d8b91db01e3a0cf3ae28671cb9b336c554e0.zip
GNU: Avoid `__overrides' altogether, by using a non-recursive attrset.
Thanks to Eelco for the suggestion.

svn path=/nixpkgs/trunk/; revision=33587
Diffstat (limited to 'pkgs/os-specific/gnu/default.nix')
-rw-r--r--pkgs/os-specific/gnu/default.nix182
1 files changed, 94 insertions, 88 deletions
diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix
index d46038c8ea5f..19bdf8c0d343 100644
--- a/pkgs/os-specific/gnu/default.nix
+++ b/pkgs/os-specific/gnu/default.nix
@@ -3,96 +3,102 @@
 args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
 , texinfo, glibcCross, hurdPartedCross, libuuid, samba_light
 , gccCrossStageStatic, gccCrossStageFinal
-, forceBuildDrv, forceSystem, callPackage, platform, config, crossSystem
+, forceBuildDrv, forceSystem, newScope, platform, config, crossSystem
 , overrides ? {} }:
 
 with args;
 
-rec {
+let
+  callPackage = newScope gnu;
+
+  gnu = {
+    hurdCross = forceBuildDrv(import ./hurd {
+      inherit fetchgit stdenv autoconf libtool texinfo
+        glibcCross hurdPartedCross;
+      inherit (gnu) machHeaders mig;
+      libuuid = libuuid.hostDrv;
+      automake = automake111x;
+      headersOnly = false;
+      cross = assert crossSystem != null; crossSystem;
+      gccCross = gccCrossStageFinal;
+    });
+
+    hurdCrossIntermediate = forceBuildDrv(import ./hurd {
+      inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
+      inherit (gnu) machHeaders mig;
+      automake = automake111x;
+      headersOnly = false;
+      cross = assert crossSystem != null; crossSystem;
+
+      # The "final" GCC needs glibc and the Hurd libraries (libpthread in
+      # particular) so we first need an intermediate Hurd built with the
+      # intermediate GCC.
+      gccCross = gccCrossStageStatic;
+
+      # This intermediate Hurd is only needed to build libpthread, which needs
+      # libihash, and to build Parted, which needs libstore and
+      # libshouldbeinlibc.
+      buildTarget = "libihash libstore libshouldbeinlibc";
+      installTarget = "libihash-install libstore-install libshouldbeinlibc-install";
+    });
+
+    hurdHeaders = callPackage ./hurd {
+      automake = automake111x;
+      headersOnly = true;
+      gccCross = null;
+      glibcCross = null;
+      libuuid = null;
+      hurdPartedCross = null;
+    };
+
+    libpthreadHeaders = callPackage ./libpthread {
+      headersOnly = true;
+      hurd = null;
+    };
+
+    libpthreadCross = forceBuildDrv(import ./libpthread {
+      inherit fetchgit stdenv autoconf automake libtool glibcCross;
+      inherit (gnu) machHeaders hurdHeaders;
+      hurd = gnu.hurdCrossIntermediate;
+      gccCross = gccCrossStageStatic;
+      cross = assert crossSystem != null; crossSystem;
+    });
+
+    # In theory GNU Mach doesn't have to be cross-compiled.  However, since it
+    # has to be built for i586 (it doesn't work on x86_64), one needs a cross
+    # compiler for that host.
+    mach = callPackage ./mach {
+      automake = automake111x;
+    };
+
+    machHeaders = callPackage ./mach {
+      automake = automake111x;
+      headersOnly = true;
+      mig = null;
+    };
+
+    mig = callPackage ./mig {
+      # Build natively, but force use of a 32-bit environment because we're
+      # targeting `i586-pc-gnu'.
+      stdenv = (forceSystem "i686-linux").stdenv;
+    };
+
+    # XXX: Use this one for its `.hostDrv'.  Using the one above from
+    # `x86_64-linux' leads to building a different cross-toolchain because of
+    # the `forceSystem'.
+    mig_raw = callPackage ./mig {};
+
+    smbfs = callPackage ./smbfs {
+      samba = samba_light;
+      hurd = hurdCross;
+    };
+
+    unionfs = callPackage ./unionfs {
+      hurd = hurdCross;
+    };
+  }
+
   # Allow callers to override elements of this attribute set.
-  __overrides = overrides;
-
-  hurdCross = forceBuildDrv(import ./hurd {
-    inherit fetchgit stdenv autoconf libtool texinfo machHeaders
-      mig glibcCross hurdPartedCross;
-    libuuid = libuuid.hostDrv;
-    automake = automake111x;
-    headersOnly = false;
-    cross = assert crossSystem != null; crossSystem;
-    gccCross = gccCrossStageFinal;
-  });
-
-  hurdCrossIntermediate = forceBuildDrv(import ./hurd {
-    inherit fetchgit stdenv autoconf libtool texinfo machHeaders
-      mig glibcCross;
-    automake = automake111x;
-    headersOnly = false;
-    cross = assert crossSystem != null; crossSystem;
-
-    # The "final" GCC needs glibc and the Hurd libraries (libpthread in
-    # particular) so we first need an intermediate Hurd built with the
-    # intermediate GCC.
-    gccCross = gccCrossStageStatic;
-
-    # This intermediate Hurd is only needed to build libpthread, which needs
-    # libihash, and to build Parted, which needs libstore and
-    # libshouldbeinlibc.
-    buildTarget = "libihash libstore libshouldbeinlibc";
-    installTarget = "libihash-install libstore-install libshouldbeinlibc-install";
-  });
-
-  hurdHeaders = callPackage ./hurd {
-    automake = automake111x;
-    headersOnly = true;
-    gccCross = null;
-    glibcCross = null;
-    libuuid = null;
-    hurdPartedCross = null;
-  };
-
-  libpthreadHeaders = callPackage ./libpthread {
-    headersOnly = true;
-    hurd = null;
-  };
-
-  libpthreadCross = forceBuildDrv(import ./libpthread {
-    inherit fetchgit stdenv autoconf automake libtool
-      machHeaders hurdHeaders glibcCross;
-    hurd = hurdCrossIntermediate;
-    gccCross = gccCrossStageStatic;
-    cross = assert crossSystem != null; crossSystem;
-  });
-
-  # In theory GNU Mach doesn't have to be cross-compiled.  However, since it
-  # has to be built for i586 (it doesn't work on x86_64), one needs a cross
-  # compiler for that host.
-  mach = callPackage ./mach {
-    automake = automake111x;
-  };
-
-  machHeaders = callPackage ./mach {
-    automake = automake111x;
-    headersOnly = true;
-    mig = null;
-  };
-
-  mig = callPackage ./mig {
-    # Build natively, but force use of a 32-bit environment because we're
-    # targeting `i586-pc-gnu'.
-    stdenv = (forceSystem "i686-linux").stdenv;
-  };
-
-  # XXX: Use this one for its `.hostDrv'.  Using the one above from
-  # `x86_64-linux' leads to building a different cross-toolchain because of
-  # the `forceSystem'.
-  mig_raw = callPackage ./mig {};
-
-  smbfs = callPackage ./smbfs {
-    samba = samba_light;
-    hurd = hurdCross;
-  };
-
-  unionfs = callPackage ./unionfs {
-    hurd = hurdCross;
-  };
-}
+  // overrides;
+
+in gnu # we trust!