* Separate building of the NixOS manual and manpages. Usually we only

need the manpages, and the manual takes much longer to build.

svn path=/nixos/trunk/; revision=23112
This commit is contained in:
Eelco Dolstra 2010-08-11 12:28:53 +00:00
parent 310fffa974
commit 2ec105cc85
3 changed files with 32 additions and 11 deletions

View File

@ -20,12 +20,15 @@ let
-o $out ${./options-to-docbook.xsl} ${optionsXML} -o $out ${./options-to-docbook.xsl} ${optionsXML}
''; '';
in rec {
# Generate the NixOS manual.
manual = pkgs.stdenv.mkDerivation { manual = pkgs.stdenv.mkDerivation {
name = "nixos-manual"; name = "nixos-manual";
sources = pkgs.lib.sourceFilesBySuffices ./. [".xml"]; sources = pkgs.lib.sourceFilesBySuffices ./. [".xml"];
buildInputs = [pkgs.libxml2 pkgs.libxslt]; buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
xsltFlags = '' xsltFlags = ''
--param section.autolabel 1 --param section.autolabel 1
@ -38,7 +41,6 @@ let
''; '';
buildCommand = '' buildCommand = ''
ln -s $sources/*.xml . # */ ln -s $sources/*.xml . # */
ln -s ${optionsDocBook} options-db.xml ln -s ${optionsDocBook} options-db.xml
@ -58,6 +60,28 @@ let
ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/ ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/
cp ${./style.css} $dst/style.css cp ${./style.css} $dst/style.css
ensureDir $out/nix-support
echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products
'';
};
# Generate the NixOS manpages.
manpages = pkgs.stdenv.mkDerivation {
name = "nixos-manpages";
sources = pkgs.lib.sourceFilesBySuffices ./. [".xml"];
buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
buildCommand = ''
ln -s $sources/*.xml . # */
ln -s ${optionsDocBook} options-db.xml
# Check the validity of the manual sources.
xmllint --noout --nonet --xinclude --noxincludenode \
--relaxng ${pkgs.docbook5}/xml/rng/docbook/docbook.rng \
./man-pages.xml
# Generate manpages. # Generate manpages.
ensureDir $out/share/man ensureDir $out/share/man
xsltproc --nonet --xinclude \ xsltproc --nonet --xinclude \
@ -66,10 +90,7 @@ let
--param man.endnotes.are.numbered 0 \ --param man.endnotes.are.numbered 0 \
${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \ ${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
./man-pages.xml ./man-pages.xml
ensureDir $out/nix-support
echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products
''; '';
}; };
in manual }

View File

@ -68,7 +68,7 @@ in
system.build.manual = manual; system.build.manual = manual;
environment.systemPackages = [manual]; environment.systemPackages = [ manual.manpages ];
boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"]; boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"];
@ -82,7 +82,7 @@ in
exec = exec =
'' ''
${cfg.browser} ${manual}/share/doc/nixos/manual.html \ ${cfg.browser} ${manual.manual}/share/doc/nixos/manual.html \
< /dev/tty${toString cfg.ttyNumber} > /dev/tty${toString cfg.ttyNumber} 2>&1 < /dev/tty${toString cfg.ttyNumber} > /dev/tty${toString cfg.ttyNumber} 2>&1
''; '';
}; };

View File

@ -106,7 +106,7 @@ let
, officialRelease ? false , officialRelease ? false
}: }:
import "${nixosSrc}/doc/manual" { (import "${nixosSrc}/doc/manual" {
pkgs = import nixpkgs {}; pkgs = import nixpkgs {};
options = options =
(import lib/eval-config.nix { (import lib/eval-config.nix {
@ -115,7 +115,7 @@ let
}).options; }).options;
revision = revision =
if nixosSrc.rev == 1234 then "HEAD" else toString nixosSrc.rev; if nixosSrc.rev == 1234 then "HEAD" else toString nixosSrc.rev;
}; }).manual;
iso_minimal = makeIso { iso_minimal = makeIso {