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
|
|
|
|
, 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);
|
|
|
|
|
|
|
|
let
|
2010-06-15 17:01:15 +02:00
|
|
|
# Unfortunately we can't use `master@{DATE}', see
|
|
|
|
# <http://www.bramschoenmakers.nl/en/node/645>.
|
|
|
|
date = "20100512";
|
|
|
|
rev = "7913beaef3e6a2c4f7f315a8db7a31dbe1f713e0";
|
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";
|
|
|
|
sha256 = "bf4f1376b26b0dcdfd23ff9c9b01440f50d032f48946fad6d3861539978f8f4d";
|
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
2010-05-19 23:28:34 +02:00
|
|
|
buildInputs = [ autoconf automake libtool texinfo mig ]
|
|
|
|
++ stdenv.lib.optional (gccCross != null) gccCross
|
|
|
|
++ stdenv.lib.optional (glibcCross != null) glibcCross;
|
|
|
|
|
2010-05-12 17:46:47 +02:00
|
|
|
propagatedBuildInputs = [ machHeaders ];
|
|
|
|
|
2010-05-19 23:28:34 +02:00
|
|
|
configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ];
|
2010-05-12 17:46:47 +02:00
|
|
|
|
|
|
|
preConfigure = "autoreconf -vfi";
|
|
|
|
|
2010-05-20 13:54:37 +02:00
|
|
|
patchPhase =
|
|
|
|
'' echo "removing \`-o root' from makefiles..."
|
|
|
|
for mf in {utils,daemons}/Makefile
|
|
|
|
do
|
|
|
|
sed -i "$mf" -e's/-o root//g'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2010-05-19 23:28:34 +02:00
|
|
|
buildPhase = "make ${buildTarget}";
|
|
|
|
installPhase = "make ${installTarget}";
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
(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 { })))
|