mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
* 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:
parent
310fffa974
commit
2ec105cc85
@ -3,7 +3,7 @@
|
||||
, revision ? "HEAD"
|
||||
}:
|
||||
|
||||
let
|
||||
let
|
||||
|
||||
# To prevent infinite recursion, remove system.path from the
|
||||
# options. Not sure why this happens.
|
||||
@ -20,12 +20,15 @@ let
|
||||
-o $out ${./options-to-docbook.xsl} ${optionsXML}
|
||||
'';
|
||||
|
||||
in rec {
|
||||
|
||||
# Generate the NixOS manual.
|
||||
manual = pkgs.stdenv.mkDerivation {
|
||||
name = "nixos-manual";
|
||||
|
||||
sources = pkgs.lib.sourceFilesBySuffices ./. [".xml"];
|
||||
|
||||
buildInputs = [pkgs.libxml2 pkgs.libxslt];
|
||||
buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
|
||||
|
||||
xsltFlags = ''
|
||||
--param section.autolabel 1
|
||||
@ -38,7 +41,6 @@ let
|
||||
'';
|
||||
|
||||
buildCommand = ''
|
||||
|
||||
ln -s $sources/*.xml . # */
|
||||
ln -s ${optionsDocBook} options-db.xml
|
||||
|
||||
@ -57,6 +59,28 @@ let
|
||||
|
||||
ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/
|
||||
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.
|
||||
ensureDir $out/share/man
|
||||
@ -66,10 +90,7 @@ let
|
||||
--param man.endnotes.are.numbered 0 \
|
||||
${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
|
||||
./man-pages.xml
|
||||
|
||||
ensureDir $out/nix-support
|
||||
echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
|
||||
in manual
|
||||
}
|
@ -68,7 +68,7 @@ in
|
||||
|
||||
system.build.manual = manual;
|
||||
|
||||
environment.systemPackages = [manual];
|
||||
environment.systemPackages = [ manual.manpages ];
|
||||
|
||||
boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"];
|
||||
|
||||
@ -82,7 +82,7 @@ in
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ let
|
||||
, officialRelease ? false
|
||||
}:
|
||||
|
||||
import "${nixosSrc}/doc/manual" {
|
||||
(import "${nixosSrc}/doc/manual" {
|
||||
pkgs = import nixpkgs {};
|
||||
options =
|
||||
(import lib/eval-config.nix {
|
||||
@ -115,7 +115,7 @@ let
|
||||
}).options;
|
||||
revision =
|
||||
if nixosSrc.rev == 1234 then "HEAD" else toString nixosSrc.rev;
|
||||
};
|
||||
}).manual;
|
||||
|
||||
|
||||
iso_minimal = makeIso {
|
||||
|
Loading…
Reference in New Issue
Block a user