1# Packages that make up the GNU/Hurd operating system (aka. GNU).
2
3args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
4, texinfo, glibcCross, hurdPartedCross, libuuid, samba
5, gccCrossStageStatic, gccCrossStageFinal
6, forcedNativePackages, forceSystem, newScope, platform, config
7, targetPlatform, buildPlatform
8, overrides ? {} }:
9
10with args;
11
12let
13 callPackage = newScope gnu;
14
15 gnu = {
16 hurdCross = forcedNativePackages.callPackage ./hurd {
17 inherit fetchgit stdenv autoconf libtool texinfo
18 glibcCross hurdPartedCross;
19 inherit (gnu) machHeaders mig;
20 libuuid = libuuid.crossDrv;
21 automake = automake111x;
22 headersOnly = false;
23 cross = assert targetPlatform != buildPlatform; targetPlatform;
24 gccCross = gccCrossStageFinal;
25 };
26
27 hurdCrossIntermediate = forcedNativePackages.callPackage ./hurd {
28 inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
29 inherit (gnu) machHeaders mig;
30 hurdPartedCross = null;
31 libuuid = null;
32 automake = automake111x;
33 headersOnly = false;
34 cross = assert targetPlatform != buildPlatform; targetPlatform;
35
36 # The "final" GCC needs glibc and the Hurd libraries (libpthread in
37 # particular) so we first need an intermediate Hurd built with the
38 # intermediate GCC.
39 gccCross = gccCrossStageStatic;
40
41 # This intermediate Hurd is only needed to build libpthread, which needs
42 # libihash, and to build Parted, which needs libstore and
43 # libshouldbeinlibc.
44 buildTarget = "libihash libstore libshouldbeinlibc";
45 installTarget = "libihash-install libstore-install libshouldbeinlibc-install";
46 };
47
48 hurdHeaders = callPackage ./hurd {
49 automake = automake111x;
50 headersOnly = true;
51 gccCross = null;
52 glibcCross = null;
53 libuuid = null;
54 hurdPartedCross = null;
55 };
56
57 libpthreadHeaders = callPackage ./libpthread {
58 headersOnly = true;
59 hurd = null;
60 };
61
62 libpthreadCross = forcedNativePackages.callPackage ./libpthread {
63 inherit fetchgit stdenv autoconf automake libtool glibcCross;
64 inherit (gnu) machHeaders hurdHeaders;
65 hurd = gnu.hurdCrossIntermediate;
66 gccCross = gccCrossStageStatic;
67 cross = assert targetPlatform != buildPlatform; targetPlatform;
68 };
69
70 # In theory GNU Mach doesn't have to be cross-compiled. However, since it
71 # has to be built for i586 (it doesn't work on x86_64), one needs a cross
72 # compiler for that host.
73 mach = callPackage ./mach {
74 automake = automake111x;
75 };
76
77 machHeaders = callPackage ./mach {
78 automake = automake111x;
79 headersOnly = true;
80 mig = null;
81 };
82
83 mig = callPackage ./mig {
84 # Build natively, but force use of a 32-bit environment because we're
85 # targeting `i586-pc-gnu'.
86 stdenv = (forceSystem "i686-linux" "i386").stdenv;
87 };
88
89 # XXX: Use this one for its `.crossDrv'. Using the one above from
90 # `x86_64-linux' leads to building a different cross-toolchain because of
91 # the `forceSystem'.
92 mig_raw = callPackage ./mig {};
93
94 smbfs = callPackage ./smbfs {
95 hurd = gnu.hurdCross;
96 };
97
98 unionfs = callPackage ./unionfs {
99 hurd = gnu.hurdCross;
100 };
101 }
102
103 # Allow callers to override elements of this attribute set.
104 // overrides;
105
106in gnu # we trust!