1with import ./.. { };
2with lib;
3
4stdenv.mkDerivation {
5 name = "nixpkgs-manual";
6
7 sources = sourceFilesBySuffices ./. [".xml"];
8
9 buildInputs = [ libxml2 libxslt ];
10
11 xsltFlags = ''
12 --param section.autolabel 1
13 --param section.label.includes.component.label 1
14 --param html.stylesheet 'style.css'
15 --param xref.with.number.and.title 1
16 --param toc.section.depth 3
17 --param admon.style '''
18 --param callout.graphics.extension '.gif'
19 '';
20
21 buildCommand = ''
22 ln -s $sources/*.xml . # */
23
24 echo ${nixpkgsVersion} > .version
25
26 xmllint --noout --nonet --xinclude --noxincludenode \
27 --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
28 manual.xml
29
30 dst=$out/share/doc/nixpkgs
31 mkdir -p $dst
32 xsltproc $xsltFlags --nonet --xinclude \
33 --output $dst/manual.html \
34 ${docbook5_xsl}/xml/xsl/docbook/xhtml/docbook.xsl \
35 ./manual.xml
36
37 cp ${./style.css} $dst/style.css
38
39 mkdir -p $dst/images/callouts
40 cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
41
42 mkdir -p $out/nix-support
43 echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products
44 '';
45}