From 2ec105cc85eea3c37e88f2e0a893604499ab6e00 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 Aug 2010 12:28:53 +0000 Subject: [PATCH] * 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 --- doc/manual/default.nix | 35 ++++++++++++++++++++------ modules/services/misc/nixos-manual.nix | 4 +-- release.nix | 4 +-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/doc/manual/default.nix b/doc/manual/default.nix index 54301dadf444..53b7ec2d7832 100644 --- a/doc/manual/default.nix +++ b/doc/manual/default.nix @@ -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 +} \ No newline at end of file diff --git a/modules/services/misc/nixos-manual.nix b/modules/services/misc/nixos-manual.nix index ed2972e5b5bb..f463a91998e2 100644 --- a/modules/services/misc/nixos-manual.nix +++ b/modules/services/misc/nixos-manual.nix @@ -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 ''; }; diff --git a/release.nix b/release.nix index 204a636568d3..3d65e7054a39 100644 --- a/release.nix +++ b/release.nix @@ -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 {