2010-05-12 17:46:47 +02:00
|
|
|
{ fetchgit, stdenv, autoconf, automake, libtool, texinfo
|
2010-05-19 23:28:34 +02:00
|
|
|
, machHeaders, mig, headersOnly ? true
|
|
|
|
, cross ? null, gccCross ? null, glibcCross ? null
|
2010-12-13 00:21:42 +01:00
|
|
|
, hurdPartedCross ? null, libuuid ? null
|
2010-05-19 23:28:34 +02:00
|
|
|
, buildTarget ? "all", installTarget ? "install" }:
|
2010-05-12 17:46:47 +02:00
|
|
|
|
2010-05-19 23:28:14 +02:00
|
|
|
assert (cross != null) -> (gccCross != null);
|
2010-12-13 00:21:42 +01:00
|
|
|
assert (hurdPartedCross != null) -> (libuuid != null);
|
2010-05-19 23:28:14 +02:00
|
|
|
|
|
|
|
let
|
2010-06-15 17:01:15 +02:00
|
|
|
# Unfortunately we can't use `master@{DATE}', see
|
|
|
|
# <http://www.bramschoenmakers.nl/en/node/645>.
|
2011-11-19 15:27:46 +01:00
|
|
|
date = "20111115";
|
|
|
|
rev = "969fbb646ffd89a482302e303eaded79781c3331";
|
2010-05-19 23:28:34 +02:00
|
|
|
suffix = if headersOnly
|
|
|
|
then "-headers"
|
|
|
|
else (if buildTarget != "all"
|
|
|
|
then "-minimal"
|
|
|
|
else "");
|
2010-05-19 23:28:14 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation ({
|
2010-05-19 23:28:34 +02:00
|
|
|
name = "hurd${suffix}-${date}";
|
2010-05-12 17:46:47 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.sv.gnu.org/hurd/hurd.git";
|
2011-11-19 15:27:46 +01:00
|
|
|
sha256 = "b7f57ec2c6dcaf35ec03fb7979eb5506180ce4c6e2edf60a587f12ac5b11f004";
|
2010-05-12 17:46:47 +02:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
2010-05-19 23:28:34 +02:00
|
|
|
buildInputs = [ autoconf automake libtool texinfo mig ]
|
2010-12-13 00:21:42 +01:00
|
|
|
++ stdenv.lib.optional (hurdPartedCross != null) hurdPartedCross
|
|
|
|
++ stdenv.lib.optional (libuuid != null) libuuid
|
2010-05-19 23:28:34 +02:00
|
|
|
++ stdenv.lib.optional (gccCross != null) gccCross
|
|
|
|
++ stdenv.lib.optional (glibcCross != null) glibcCross;
|
|
|
|
|
2010-05-12 17:46:47 +02:00
|
|
|
propagatedBuildInputs = [ machHeaders ];
|
|
|
|
|
2010-12-13 00:21:42 +01:00
|
|
|
configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ]
|
2011-06-12 00:23:22 +02:00
|
|
|
++ (if hurdPartedCross != null
|
|
|
|
then [ "--with-parted" ]
|
|
|
|
else [ "--without-parted" ]);
|
2010-05-12 17:46:47 +02:00
|
|
|
|
2012-04-18 19:22:10 +02:00
|
|
|
preConfigure =
|
|
|
|
'' autoreconf -vfi
|
2010-05-12 17:46:47 +02:00
|
|
|
|
2012-04-18 19:22:10 +02:00
|
|
|
echo "removing \`-o root' from makefiles..."
|
2010-05-20 13:54:37 +02:00
|
|
|
for mf in {utils,daemons}/Makefile
|
|
|
|
do
|
|
|
|
sed -i "$mf" -e's/-o root//g'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2012-04-18 19:22:10 +02:00
|
|
|
crossAttrs.dontPatchShebangs = true;
|
2010-05-19 23:28:34 +02:00
|
|
|
|
2010-05-12 17:46:47 +02: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).
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = "GPLv2+";
|
|
|
|
|
|
|
|
homepage = http://www.gnu.org/software/hurd/;
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2012-04-18 19:22:10 +02:00
|
|
|
(if !headersOnly && buildTarget != null
|
|
|
|
then assert installTarget != null; {
|
|
|
|
# Use the default `buildPhase' and `installPhase' so that the usual hooks
|
|
|
|
# can still be used.
|
|
|
|
buildFlags = buildTarget;
|
|
|
|
installTargets = installTarget;
|
|
|
|
}
|
|
|
|
else {})
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2010-05-12 17:46:47 +02:00
|
|
|
(if headersOnly
|
|
|
|
then { buildPhase = ":"; installPhase = "make install-headers"; }
|
2010-05-19 23:28:34 +02:00
|
|
|
else (if (cross != null)
|
|
|
|
then {
|
|
|
|
crossConfig = cross.config;
|
|
|
|
|
|
|
|
# The `configure' script wants to build executables so tell it where
|
|
|
|
# to find `crt1.o' et al.
|
|
|
|
LDFLAGS = "-B${glibcCross}/lib";
|
|
|
|
}
|
|
|
|
else { })))
|