From 0f6979f5b9dbb9db0b5ea605b40025f96346ab90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 1 Nov 2011 22:10:51 +0000 Subject: [PATCH] Move GNU/Hurd package attributes under `os-specific/gnu/default.nix'. svn path=/nixpkgs/trunk/; revision=30173 --- .../libraries/glibc-2.12/common.nix | 6 +- .../libraries/glibc-2.12/default.nix | 6 +- pkgs/os-specific/gnu/default.nix | 89 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 93 +++---------------- 4 files changed, 106 insertions(+), 88 deletions(-) create mode 100644 pkgs/os-specific/gnu/default.nix diff --git a/pkgs/development/libraries/glibc-2.12/common.nix b/pkgs/development/libraries/glibc-2.12/common.nix index 2836267bc107..0d56d8770189 100644 --- a/pkgs/development/libraries/glibc-2.12/common.nix +++ b/pkgs/development/libraries/glibc-2.12/common.nix @@ -5,7 +5,7 @@ cross : { name, fetchurl, stdenv, installLocales ? false , gccCross ? null, kernelHeaders ? null -, machHeaders ? null, hurdHeaders ? null, hurdLibpthreadHeaders ? null +, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null , mig ? null, fetchgit ? null , profilingLibraries ? false, meta , preConfigure ? "", ... }@args : @@ -32,7 +32,7 @@ assert (cross != null) -> (gccCross != null); assert (mig != null) -> (machHeaders != null); assert (machHeaders != null) -> (hurdHeaders != null); -assert (hurdHeaders != null) -> (hurdLibpthreadHeaders != null); +assert (hurdHeaders != null) -> (libpthreadHeaders != null); assert (hurdHeaders != null) -> (fetchgit != null); stdenv.mkDerivation ({ @@ -201,7 +201,7 @@ stdenv.mkDerivation ({ # Work around the fact that the configure snippet that looks for # does not honor `--with-headers=$sysheaders' and that # glibc expects Mach, Hurd, and pthread headers to be in the same place. - CPATH = "${hurdHeaders}/include:${machHeaders}/include:${hurdLibpthreadHeaders}/include"; + CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include"; # `fetchgit' is a function and thus should not be passed to the # `derivation' primitive. diff --git a/pkgs/development/libraries/glibc-2.12/default.nix b/pkgs/development/libraries/glibc-2.12/default.nix index 251caaede6d3..a57996ff35d7 100644 --- a/pkgs/development/libraries/glibc-2.12/default.nix +++ b/pkgs/development/libraries/glibc-2.12/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, kernelHeaders -, machHeaders ? null, hurdHeaders ? null, hurdLibpthreadHeaders ? null +, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null , mig ? null, fetchgit ? null , installLocales ? true , profilingLibraries ? false @@ -41,9 +41,9 @@ in (if hurdHeaders != null then rec { - inherit machHeaders hurdHeaders hurdLibpthreadHeaders mig fetchgit; + inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit; - propagatedBuildInputs = [ machHeaders hurdHeaders hurdLibpthreadHeaders ]; + propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ]; passthru = { # When building GCC itself `propagatedBuildInputs' above is not diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix new file mode 100644 index 000000000000..3978979d7020 --- /dev/null +++ b/pkgs/os-specific/gnu/default.nix @@ -0,0 +1,89 @@ +# Packages that make up the GNU/Hurd operating system (aka. GNU). + +args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool +, texinfo, glibcCross, hurdPartedCross, libuuid +, gccCrossStageStatic, gccCrossStageFinal +, forceBuildDrv, callPackage, platform, config, crossSystem }: + +with args; + +rec { + 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 + (if stdenv.isLinux + then { + # Build natively, but force use of a 32-bit environment because we're + # targeting `i586-pc-gnu'. + stdenv = (import ../../stdenv { + system = "i686-linux"; + stdenvType = "i686-linux"; + allPackages = args: + import ../../top-level/all-packages.nix ({ inherit config; } // args); + inherit platform; + }).stdenv; + } + else { }); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d522b505e05..1bb7cfc495bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1118,14 +1118,14 @@ let patchutils = callPackage ../tools/text/patchutils { }; - parted = callPackage ../tools/misc/parted { }; - parted_2_3 = callPackage ../tools/misc/parted/2.3.nix { }; + parted = callPackage ../tools/misc/parted { hurd = null; }; + parted_2_3 = callPackage ../tools/misc/parted/2.3.nix { hurd = null; }; hurdPartedCross = if crossSystem != null && crossSystem.config == "i586-pc-gnu" then (callPackage ../tools/misc/parted { # Needs the Hurd's libstore. - hurd = hurdCrossIntermediate; + hurd = gnu.hurdCrossIntermediate; # The Hurd wants a libparted.a. enableStatic = true; @@ -1808,7 +1808,7 @@ let libpthreadCross = # FIXME: Don't explicitly refer to `i586-pc-gnu'. if crossSystem != null && crossSystem.config == "i586-pc-gnu" - then hurdLibpthreadCross + then gnu.libpthreadCross else null; }); libc = libcCross; @@ -2928,21 +2928,6 @@ let ltrace = callPackage ../development/tools/misc/ltrace { }; - mig = callPackage ../os-specific/gnu/mig - (if stdenv.isLinux - then { - # Build natively, but force use of a 32-bit environment because we're - # targeting `i586-pc-gnu'. - stdenv = (import ../stdenv { - system = "i686-linux"; - stdenvType = "i686-linux"; - allPackages = args: - import ./all-packages.nix ({ inherit config; } // args); - inherit platform; - }).stdenv; - } - else { }); - mk = callPackage ../development/tools/build-managers/mk { }; noweb = callPackage ../development/tools/literate-programming/noweb { }; @@ -3426,7 +3411,7 @@ let in ({ inherit stdenv fetchurl; gccCross = gccCrossStageStatic; - kernelHeaders = if crossGNU then hurdHeaders else linuxHeadersCross; + kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross; installLocales = getConfig [ "glibc" "locales" ] false; } @@ -3434,7 +3419,8 @@ let (if crossGNU then { - inherit machHeaders hurdHeaders hurdLibpthreadHeaders mig fetchgit; + inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig; + inherit fetchgit; } else { })))); @@ -5185,55 +5171,10 @@ let htop = callPackage ../os-specific/linux/htop { }; - hurdCross = forceBuildDrv(import ../os-specific/gnu/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 ../os-specific/gnu/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 ../os-specific/gnu/hurd { - automake = automake111x; - headersOnly = true; - gccCross = null; - glibcCross = null; - libuuid = null; - hurdPartedCross = null; - }; - - hurdLibpthreadHeaders = callPackage ../os-specific/gnu/libpthread { - headersOnly = true; - hurd = null; - }; - - hurdLibpthreadCross = forceBuildDrv(import ../os-specific/gnu/libpthread { - inherit fetchgit stdenv autoconf automake libtool - machHeaders hurdHeaders glibcCross; - hurd = hurdCrossIntermediate; - gccCross = gccCrossStageStatic; - cross = assert crossSystem != null; crossSystem; + # GNU/Hurd core packages. + gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { + callPackage = newScope pkgs.gnu; + inherit platform crossSystem; }); hwdata = callPackage ../os-specific/linux/hwdata { }; @@ -5879,18 +5820,6 @@ let lvm2 = callPackage ../os-specific/linux/lvm2 { }; - # 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 ../os-specific/gnu/mach { - automake = automake111x; }; - - machHeaders = callPackage ../os-specific/gnu/mach { - automake = automake111x; - headersOnly = true; - mig = null; - }; - mdadm = callPackage ../os-specific/linux/mdadm { }; mingetty = callPackage ../os-specific/linux/mingetty { };