GNU Hurd: Allow partial builds.
svn path=/nixpkgs/trunk/; revision=21899
This commit is contained in:
parent
89b9d2af52
commit
2534ea88b1
@ -1,14 +1,21 @@
|
|||||||
{ fetchgit, stdenv, autoconf, automake, libtool, texinfo
|
{ fetchgit, stdenv, autoconf, automake, libtool, texinfo
|
||||||
, machHeaders, mig, headersOnly ? true }:
|
, machHeaders, mig, headersOnly ? true
|
||||||
|
, cross ? null, gccCross ? null, glibcCross ? null
|
||||||
|
, buildTarget ? "all", installTarget ? "install" }:
|
||||||
|
|
||||||
assert (cross != null) -> (gccCross != null);
|
assert (cross != null) -> (gccCross != null);
|
||||||
|
|
||||||
let
|
let
|
||||||
date = "2010-05-12";
|
date = "2010-05-12";
|
||||||
rev = "master@{${date}}";
|
rev = "master@{${date}}";
|
||||||
|
suffix = if headersOnly
|
||||||
|
then "-headers"
|
||||||
|
else (if buildTarget != "all"
|
||||||
|
then "-minimal"
|
||||||
|
else "");
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
name = "hurd${if headersOnly then "-headers" else ""}-${date}";
|
name = "hurd${suffix}-${date}";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "git://git.sv.gnu.org/hurd/hurd.git";
|
url = "git://git.sv.gnu.org/hurd/hurd.git";
|
||||||
@ -16,13 +23,19 @@ stdenv.mkDerivation ({
|
|||||||
inherit rev;
|
inherit rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ autoconf automake libtool texinfo mig ];
|
buildInputs = [ autoconf automake libtool texinfo mig ]
|
||||||
|
++ stdenv.lib.optional (gccCross != null) gccCross
|
||||||
|
++ stdenv.lib.optional (glibcCross != null) glibcCross;
|
||||||
|
|
||||||
propagatedBuildInputs = [ machHeaders ];
|
propagatedBuildInputs = [ machHeaders ];
|
||||||
|
|
||||||
configureFlags = "--build=i586-pc-gnu";
|
configureFlags = stdenv.lib.optionals headersOnly [ "--build=i586-pc-gnu" ];
|
||||||
|
|
||||||
preConfigure = "autoreconf -vfi";
|
preConfigure = "autoreconf -vfi";
|
||||||
|
|
||||||
|
buildPhase = "make ${buildTarget}";
|
||||||
|
installPhase = "make ${installTarget}";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "The GNU Hurd, GNU project's replacement for the Unix kernel";
|
description = "The GNU Hurd, GNU project's replacement for the Unix kernel";
|
||||||
|
|
||||||
@ -46,4 +59,12 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
(if headersOnly
|
(if headersOnly
|
||||||
then { buildPhase = ":"; installPhase = "make install-headers"; }
|
then { buildPhase = ":"; installPhase = "make install-headers"; }
|
||||||
else {}))
|
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 { })))
|
||||||
|
@ -6085,6 +6085,24 @@ let
|
|||||||
inherit fetchurl stdenv ncurses;
|
inherit fetchurl stdenv ncurses;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hurdCrossIntermediate = forceBuildDrv(import ../os-specific/gnu/hurd {
|
||||||
|
inherit fetchgit stdenv autoconf libtool texinfo machHeaders
|
||||||
|
mig glibcCross;
|
||||||
|
automake = automake111x;
|
||||||
|
headersOnly = false;
|
||||||
|
cross = assert crossSystem != null; crossSystem;
|
||||||
|
|
||||||
|
# The "final" GCC needs glibc and the Hurd libraries (libpthread in
|
||||||
|
# particular) so we first need an intermediate Hurd built with the
|
||||||
|
# intermediate GCC.
|
||||||
|
gccCross = gccCrossStageStatic;
|
||||||
|
|
||||||
|
# This intermediate Hurd is only needed to build libpthread, which really
|
||||||
|
# only needs libihash.
|
||||||
|
buildTarget = "libihash";
|
||||||
|
installTarget = "libihash-install";
|
||||||
|
});
|
||||||
|
|
||||||
hurdHeaders = import ../os-specific/gnu/hurd {
|
hurdHeaders = import ../os-specific/gnu/hurd {
|
||||||
inherit fetchgit stdenv autoconf libtool texinfo machHeaders;
|
inherit fetchgit stdenv autoconf libtool texinfo machHeaders;
|
||||||
mig = migCross;
|
mig = migCross;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user