2010-05-12 16:46:47 +01:00
|
|
|
{ fetchgit, stdenv, autoconf, automake, libtool, texinfo
|
2010-05-19 22:28:34 +01:00
|
|
|
, machHeaders, mig, headersOnly ? true
|
|
|
|
, cross ? null, gccCross ? null, glibcCross ? null
|
2010-12-12 23:21:42 +00:00
|
|
|
, hurdPartedCross ? null, libuuid ? null
|
2010-05-19 22:28:34 +01:00
|
|
|
, buildTarget ? "all", installTarget ? "install" }:
|
2010-05-12 16:46:47 +01:00
|
|
|
|
2010-05-19 22:28:14 +01:00
|
|
|
assert (cross != null) -> (gccCross != null);
|
2010-12-12 23:21:42 +00:00
|
|
|
assert (hurdPartedCross != null) -> (libuuid != null);
|
2010-05-19 22:28:14 +01:00
|
|
|
|
|
|
|
let
|
2010-06-15 16:01:15 +01:00
|
|
|
# Unfortunately we can't use `master@{DATE}', see
|
|
|
|
# <http://www.bramschoenmakers.nl/en/node/645>.
|
2011-11-19 14:27:46 +00:00
|
|
|
date = "20111115";
|
|
|
|
rev = "969fbb646ffd89a482302e303eaded79781c3331";
|
2010-05-19 22:28:34 +01:00
|
|
|
suffix = if headersOnly
|
|
|
|
then "-headers"
|
|
|
|
else (if buildTarget != "all"
|
|
|
|
then "-minimal"
|
|
|
|
else "");
|
2010-05-19 22:28:14 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation ({
|
2010-05-19 22:28:34 +01:00
|
|
|
name = "hurd${suffix}-${date}";
|
2010-05-12 16:46:47 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.sv.gnu.org/hurd/hurd.git";
|
2011-11-19 14:27:46 +00:00
|
|
|
sha256 = "b7f57ec2c6dcaf35ec03fb7979eb5506180ce4c6e2edf60a587f12ac5b11f004";
|
2010-05-12 16:46:47 +01:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
2010-05-19 22:28:34 +01:00
|
|
|
buildInputs = [ autoconf automake libtool texinfo mig ]
|
2010-12-12 23:21:42 +00:00
|
|
|
++ stdenv.lib.optional (hurdPartedCross != null) hurdPartedCross
|
|
|
|
++ stdenv.lib.optional (libuuid != null) libuuid
|
2010-05-19 22:28:34 +01:00
|
|
|
++ stdenv.lib.optional (gccCross != null) gccCross
|
|
|
|
++ stdenv.lib.optional (glibcCross != null) glibcCross;
|
|
|
|
|
2010-05-12 16:46:47 +01:00
|
|
|
propagatedBuildInputs = [ machHeaders ];
|
|
|
|
|
2010-12-12 23:21:42 +00:00
|
|
|
configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ]
|
2011-06-11 23:23:22 +01:00
|
|
|
++ (if hurdPartedCross != null
|
|
|
|
then [ "--with-parted" ]
|
|
|
|
else [ "--without-parted" ]);
|
2010-05-12 16:46:47 +01:00
|
|
|
|
2012-04-18 19:42:44 +01:00
|
|
|
# Use `preConfigure' only for `autoreconf', so that users know they can
|
|
|
|
# simply clear it when the autoconf phase is unneeded.
|
|
|
|
preConfigure = "autoreconf -vfi";
|
2010-05-12 16:46:47 +01:00
|
|
|
|
2012-04-18 19:42:44 +01:00
|
|
|
postConfigure =
|
|
|
|
'' echo "removing \`-o root' from makefiles..."
|
2010-05-20 12:54:37 +01:00
|
|
|
for mf in {utils,daemons}/Makefile
|
|
|
|
do
|
|
|
|
sed -i "$mf" -e's/-o root//g'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2018-07-23 22:11:48 +01:00
|
|
|
# Not needed after https://github.com/NixOS/nixpkgs/pull/43833
|
|
|
|
dontPatchShebangs = stdenv.hostPlatform != stdenv.buildPlatform;
|
2010-05-19 22:28:34 +01:00
|
|
|
|
2010-05-12 16:46:47 +01:00
|
|
|
meta = {
|
|
|
|
description = "The GNU Hurd, GNU project's replacement for the Unix kernel";
|
|
|
|
|
|
|
|
longDescription =
|
|
|
|
'' The GNU Hurd is the GNU project's replacement for the Unix kernel.
|
|
|
|
It is a collection of servers that run on the Mach microkernel to
|
|
|
|
implement file systems, network protocols, file access control, and
|
|
|
|
other features that are implemented by the Unix kernel or similar
|
|
|
|
kernels (such as Linux).
|
|
|
|
'';
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2010-05-12 16:46:47 +01:00
|
|
|
|
|
|
|
homepage = http://www.gnu.org/software/hurd/;
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2018-05-15 01:33:54 +01:00
|
|
|
stdenv.lib.optionalAttrs (!headersOnly && buildTarget != null) {
|
|
|
|
# Use the default `buildPhase' and `installPhase' so that the usual hooks
|
|
|
|
# can still be used.
|
|
|
|
buildFlags = buildTarget;
|
|
|
|
installTargets = assert installTarget != null; installTarget;
|
|
|
|
}
|
2012-04-18 18:22:10 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
|
2018-05-15 01:33:54 +01:00
|
|
|
stdenv.lib.optionalAttrs headersOnly {
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = "make install-headers";
|
|
|
|
})
|