This has been not touched in 6 years. Let's remove it to cause less problems when adding new cross-compiling infrastructure. This also simplify gcc significantly.
···3636 cygwin = filterDoubles predicates.isCygwin;
3737 darwin = filterDoubles predicates.isDarwin;
3838 freebsd = filterDoubles predicates.isFreeBSD;
3939- # Should be better, but MinGW is unclear, and HURD is bit-rotted.
3939+ # Should be better, but MinGW is unclear.
4040 gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; });
4141 illumos = filterDoubles predicates.isSunOS;
4242 linux = filterDoubles predicates.isLinux;
+1-1
lib/systems/for-meta.nix
···2020 cygwin = [ patterns.isCygwin ];
2121 darwin = [ patterns.isDarwin ];
2222 freebsd = [ patterns.isFreeBSD ];
2323- # Should be better, but MinGW is unclear, and HURD is bit-rotted.
2323+ # Should be better, but MinGW is unclear.
2424 gnu = [
2525 { kernel = parse.kernels.linux; abi = abis.gnu; }
2626 { kernel = parse.kernels.linux; abi = abis.gnueabi; }
···11-# Packages that make up the GNU/Hurd operating system (aka. GNU).
22-33-args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
44-, texinfo, glibcCross, hurdPartedCross, libuuid, samba
55-, gccCrossStageStatic, gcc
66-, pkgsi686Linux, newScope, config
77-, targetPlatform, buildPlatform
88-, overrides ? {}
99-, buildPackages, pkgs
1010-}:
1111-1212-with args;
1313-1414-let
1515- callPackage = newScope gnu;
1616-1717- forcedNativePackages =
1818- if stdenv.hostPlatform == stdenv.buildPlatform
1919- then pkgs
2020- else buildPackages;
2121-2222- gnu = {
2323- hurdCross = forcedNativePackages.callPackage ./hurd {
2424- inherit fetchgit stdenv autoconf libtool texinfo
2525- glibcCross hurdPartedCross;
2626- inherit (gnu) machHeaders mig;
2727- libuuid = libuuid.crossDrv;
2828- automake = automake111x;
2929- headersOnly = false;
3030- cross = assert targetPlatform != buildPlatform; targetPlatform;
3131- gccCross = gcc;
3232- };
3333-3434- hurdCrossIntermediate = forcedNativePackages.callPackage ./hurd {
3535- inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
3636- inherit (gnu) machHeaders mig;
3737- hurdPartedCross = null;
3838- libuuid = null;
3939- automake = automake111x;
4040- headersOnly = false;
4141- cross = assert targetPlatform != buildPlatform; targetPlatform;
4242-4343- # The "final" GCC needs glibc and the Hurd libraries (libpthread in
4444- # particular) so we first need an intermediate Hurd built with the
4545- # intermediate GCC.
4646- gccCross = gccCrossStageStatic;
4747-4848- # This intermediate Hurd is only needed to build libpthread, which needs
4949- # libihash, and to build Parted, which needs libstore and
5050- # libshouldbeinlibc.
5151- buildTarget = "libihash libstore libshouldbeinlibc";
5252- installTarget = "libihash-install libstore-install libshouldbeinlibc-install";
5353- };
5454-5555- hurdHeaders = callPackage ./hurd {
5656- automake = automake111x;
5757- headersOnly = true;
5858- gccCross = null;
5959- glibcCross = null;
6060- libuuid = null;
6161- hurdPartedCross = null;
6262- };
6363-6464- libpthreadHeaders = callPackage ./libpthread {
6565- headersOnly = true;
6666- hurd = null;
6767- };
6868-6969- libpthreadCross = forcedNativePackages.callPackage ./libpthread {
7070- inherit fetchgit stdenv autoconf automake libtool glibcCross;
7171- inherit (gnu) machHeaders hurdHeaders;
7272- hurd = gnu.hurdCrossIntermediate;
7373- gccCross = gccCrossStageStatic;
7474- cross = assert targetPlatform != buildPlatform; targetPlatform;
7575- };
7676-7777- # In theory GNU Mach doesn't have to be cross-compiled. However, since it
7878- # has to be built for i586 (it doesn't work on x86_64), one needs a cross
7979- # compiler for that host.
8080- mach = callPackage ./mach {
8181- automake = automake111x;
8282- };
8383-8484- machHeaders = callPackage ./mach {
8585- automake = automake111x;
8686- headersOnly = true;
8787- mig = null;
8888- };
8989-9090- mig = callPackage ./mig {
9191- # Build natively, but force use of a 32-bit environment because we're
9292- # targeting `i586-pc-gnu'.
9393- stdenv = pkgsi686Linux.stdenv;
9494- };
9595-9696- # XXX: Use this one for its `.crossDrv'. Using the one above from
9797- # `x86_64-linux' leads to building a different cross-toolchain because of
9898- # the `forceSystem'.
9999- mig_raw = callPackage ./mig {};
100100-101101- smbfs = callPackage ./smbfs {
102102- hurd = gnu.hurdCross;
103103- };
104104-105105- unionfs = callPackage ./unionfs {
106106- hurd = gnu.hurdCross;
107107- };
108108- }
109109-110110- # Allow callers to override elements of this attribute set.
111111- // overrides;
112112-113113-in gnu # we trust!
-91
pkgs/os-specific/gnu/hurd/default.nix
···11-{ fetchgit, stdenv, autoconf, automake, libtool, texinfo
22-, machHeaders, mig, headersOnly ? true
33-, cross ? null, gccCross ? null, glibcCross ? null
44-, hurdPartedCross ? null, libuuid ? null
55-, buildTarget ? "all", installTarget ? "install" }:
66-77-assert (cross != null) -> (gccCross != null);
88-assert (hurdPartedCross != null) -> (libuuid != null);
99-1010-let
1111- # Unfortunately we can't use `master@{DATE}', see
1212- # <http://www.bramschoenmakers.nl/en/node/645>.
1313- date = "20111115";
1414- rev = "969fbb646ffd89a482302e303eaded79781c3331";
1515- suffix = if headersOnly
1616- then "-headers"
1717- else (if buildTarget != "all"
1818- then "-minimal"
1919- else "");
2020-in
2121-stdenv.mkDerivation ({
2222- name = "hurd${suffix}-${date}";
2323-2424- src = fetchgit {
2525- url = "git://git.sv.gnu.org/hurd/hurd.git";
2626- sha256 = "b7f57ec2c6dcaf35ec03fb7979eb5506180ce4c6e2edf60a587f12ac5b11f004";
2727- inherit rev;
2828- };
2929-3030- buildInputs = [ autoconf automake libtool texinfo mig ]
3131- ++ stdenv.lib.optional (hurdPartedCross != null) hurdPartedCross
3232- ++ stdenv.lib.optional (libuuid != null) libuuid
3333- ++ stdenv.lib.optional (gccCross != null) gccCross
3434- ++ stdenv.lib.optional (glibcCross != null) glibcCross;
3535-3636- propagatedBuildInputs = [ machHeaders ];
3737-3838- configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ]
3939- ++ (if hurdPartedCross != null
4040- then [ "--with-parted" ]
4141- else [ "--without-parted" ]);
4242-4343- # Use `preConfigure' only for `autoreconf', so that users know they can
4444- # simply clear it when the autoconf phase is unneeded.
4545- preConfigure = "autoreconf -vfi";
4646-4747- postConfigure =
4848- '' echo "removing \`-o root' from makefiles..."
4949- for mf in {utils,daemons}/Makefile
5050- do
5151- sed -i "$mf" -e's/-o root//g'
5252- done
5353- '';
5454-5555- # Not needed after https://github.com/NixOS/nixpkgs/pull/43833
5656- dontPatchShebangs = stdenv.hostPlatform != stdenv.buildPlatform;
5757-5858- meta = {
5959- description = "The GNU Hurd, GNU project's replacement for the Unix kernel";
6060-6161- longDescription =
6262- '' The GNU Hurd is the GNU project's replacement for the Unix kernel.
6363- It is a collection of servers that run on the Mach microkernel to
6464- implement file systems, network protocols, file access control, and
6565- other features that are implemented by the Unix kernel or similar
6666- kernels (such as Linux).
6767- '';
6868-6969- license = stdenv.lib.licenses.gpl2Plus;
7070-7171- homepage = http://www.gnu.org/software/hurd/;
7272-7373- maintainers = [ stdenv.lib.maintainers.ludo ];
7474- };
7575-}
7676-7777-//
7878-7979-stdenv.lib.optionalAttrs (!headersOnly && buildTarget != null) {
8080- # Use the default `buildPhase' and `installPhase' so that the usual hooks
8181- # can still be used.
8282- buildFlags = buildTarget;
8383- installTargets = assert installTarget != null; installTarget;
8484-}
8585-8686-//
8787-8888-stdenv.lib.optionalAttrs headersOnly {
8989- dontBuild = true;
9090- installPhase = "make install-headers";
9191-})
-81
pkgs/os-specific/gnu/libpthread/default.nix
···11-{ fetchgit, stdenv, autoconf, automake, libtool
22-, machHeaders, hurdHeaders, hurd, headersOnly ? false
33-, cross ? null, gccCross ? null, glibcCross ? null }:
44-55-assert (cross != null) -> (gccCross != null) && (glibcCross != null);
66-assert (!headersOnly) -> (hurd != null);
77-88-let
99- date = "20111020";
1010-1111- # Use the `tschwinge/Peter_Herbolzheimer' branch as prescribed in
1212- # <http://www.gnu.org/software/hurd/hurd/building/cross-compiling.html>.
1313- rev = "a7b82c3302bf9c47176648eb802a61ae2d9a16f5";
1414-in
1515-stdenv.mkDerivation ({
1616- name = "libpthread-hurd-${if headersOnly then "headers-" else ""}${date}";
1717-1818- src = fetchgit {
1919- url = "git://git.sv.gnu.org/hurd/libpthread.git";
2020- sha256 = "e8300762914d927c0da4168341a5982a1057613e1af363ee68942087b2570b3d";
2121- inherit rev;
2222- };
2323-2424- nativeBuildInputs = [ autoconf automake libtool ];
2525- buildInputs = [ machHeaders hurdHeaders ]
2626- ++ stdenv.lib.optional (!headersOnly) hurd
2727- ++ stdenv.lib.optional (gccCross != null) gccCross;
2828-2929- preConfigure = "autoreconf -vfi";
3030-3131- meta = {
3232- description = "GNU Hurd's libpthread";
3333-3434- license = stdenv.lib.licenses.lgpl2Plus;
3535-3636- maintainers = [ stdenv.lib.maintainers.ludo ];
3737- };
3838-}
3939-4040-//
4141-4242-(if headersOnly
4343- then {
4444- configureFlags =
4545- [ "--build=i586-pc-gnu"
4646- "ac_cv_lib_ihash_hurd_ihash_create=yes"
4747- ];
4848-4949- dontBuild = true;
5050- installPhase = "make install-data-local-headers";
5151- }
5252- else { })
5353-5454-//
5555-5656-(if cross != null
5757- then {
5858- # Tell gcc where to find `crt1.o' et al. This is specified in two
5959- # different ways: one for gcc as run from `configure', and one for linking
6060- # libpthread.so (by default `libtool --mode=link' swallows `-B', hence
6161- # this workaround; see
6262- # <http://lists.gnu.org/archive/html/bug-libtool/2010-05/msg00012.html>.)
6363- LDFLAGS = "-B${glibcCross}/lib";
6464- makeFlags = [ "LDFLAGS=-Wc,-B${glibcCross}/lib" ];
6565-6666- # Help the linker find glibc.
6767- CPATH = "${glibcCross}/include";
6868- LIBRARY_PATH = "${glibcCross}/lib";
6969-7070- passthru = {
7171- # Extra target LDFLAGS to allow the cross-linker to find the
7272- # dependencies of the cross libpthread.so, namely libihash.so.
7373- # Note: these are raw `ld' flags, so `-Wl,' must be prepended when using
7474- # `gcc'.
7575- #
7676- # This is actually only useful while building the final cross-gcc, since
7777- # afterwards gcc-cross-wrapper should add the relevant flags.
7878- TARGET_LDFLAGS = "-rpath-link=${hurd}/lib";
7979- };
8080- }
8181- else { }))
-57
pkgs/os-specific/gnu/mach/default.nix
···11-{ fetchgit, stdenv, mig ? null, autoconf, automake, texinfo
22-, headersOnly ? false }:
33-44-assert (!headersOnly) -> (mig != null);
55-66-let
77- date = "20120303";
88- rev = "2a603e88f86bee88e013c2451eacf076fbcaed81";
99-in
1010-stdenv.mkDerivation ({
1111- name = "gnumach${if headersOnly then "-headers" else ""}-${date}";
1212-1313- src = fetchgit {
1414- url = "git://git.sv.gnu.org/hurd/gnumach.git";
1515- sha256 = "1q8zk8xzbiwpnvvmfgkylj4gwkvkn5n2ydy9j054qv5plnaczj1c";
1616- inherit rev;
1717- };
1818-1919- configureFlags =
2020- stdenv.lib.optional headersOnly "--build=i586-pc-gnu" # cheat
2121-2222- # Always enable dependency tracking. See
2323- # <http://lists.gnu.org/archive/html/bug-hurd/2010-05/msg00137.html>.
2424- ++ [ "--enable-dependency-tracking" ];
2525-2626- nativeBuildInputs = [ autoconf automake texinfo ]
2727- ++ stdenv.lib.optional (mig != null) mig;
2828-2929- preConfigure = "autoreconf -vfi";
3030-3131- meta = {
3232- description = "GNU Mach, the microkernel used by the GNU Hurd";
3333-3434- longDescription =
3535- '' GNU Mach is the microkernel that the GNU Hurd system is based on.
3636-3737- It is maintained by the Hurd developers for the GNU project and
3838- remains compatible with Mach 3.0.
3939-4040- The majority of GNU Mach's device drivers are from Linux 2.0. They
4141- were added using glue code, i.e., a Linux emulation layer in Mach.
4242- '';
4343-4444- license = stdenv.lib.licenses.gpl2Plus;
4545-4646- homepage = http://www.gnu.org/software/hurd/microkernel/mach/gnumach.html;
4747-4848- maintainers = [ stdenv.lib.maintainers.ludo ];
4949- platforms = [ "i586-gnu" ];
5050- };
5151-}
5252-5353-//
5454-5555-(if headersOnly
5656- then { dontBuild = true; installPhase = "make install-data"; }
5757- else {}))
-50
pkgs/os-specific/gnu/mig/default.nix
···11-{ fetchgit, stdenv, autoconf, automake, flex, bison, machHeaders, bash }:
22-33-let
44- date = "20100512";
55- rev = "4fee6a5652f609cb68cdbd9049d4da7a194f15f8";
66-in
77-stdenv.mkDerivation {
88- name = "mig-${date}";
99-1010- src = fetchgit {
1111- url = "git://git.sv.gnu.org/hurd/mig.git";
1212- sha256 = "d6958d9b60925d4600aac133c9505bc873a16b203c69260bd0fb228922ee9273";
1313- inherit rev;
1414- };
1515-1616- patches = [ ./noyywrap.patch ];
1717-1818- nativeBuildInputs = [ autoconf automake flex bison machHeaders ];
1919-2020- preConfigure = "autoreconf -vfi";
2121-2222- doCheck = true;
2323-2424- # Fix the shebang to point to the cross-built shell. Won't be needed
2525- # after #43833.
2626- postInstall = ''
2727- sed -i "$out/bin/mig" -e 's|^#!/.*|#!${bash}/bin/sh|g'
2828- '';
2929-3030- meta = {
3131- description = "GNU MIG, the Mach interface generator";
3232-3333- longDescription =
3434- '' GNU MIG is the GNU distribution of the Mach 3.0 interface generator
3535- MIG, as maintained by the GNU Hurd developers for the GNU project.
3636-3737- You need this tool to compile the GNU Mach and GNU Hurd
3838- distributions, and to compile the GNU C library for the Hurd. Also,
3939- you will need it for other software in the GNU system that uses
4040- Mach-based inter-process communication.
4141- '';
4242-4343- license = stdenv.lib.licenses.gpl2Plus;
4444-4545- homepage = http://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html;
4646-4747- # platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux; # really GNU/Hurd
4848- maintainers = [ stdenv.lib.maintainers.ludo ];
4949- };
5050-}