1{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
2let
3 lib = pkgs.lib;
4 doc-support = import ./doc-support { inherit pkgs nixpkgs; };
5in pkgs.stdenv.mkDerivation {
6 name = "nixpkgs-manual";
7
8 nativeBuildInputs = with pkgs; [
9 pandoc
10 graphviz
11 libxml2
12 libxslt
13 zip
14 jing
15 xmlformat
16 ];
17
18 src = lib.cleanSource ./.;
19
20 makeFlags = [
21 "PANDOC_LUA_FILTERS_DIR=${pkgs.pandoc-lua-filters}/share/pandoc/filters"
22 ];
23
24 postPatch = ''
25 ln -s ${doc-support} ./doc-support/result
26 '';
27
28 installPhase = ''
29 dest="$out/share/doc/nixpkgs"
30 mkdir -p "$(dirname "$dest")"
31 mv out/html "$dest"
32 mv "$dest/index.html" "$dest/manual.html"
33
34 mv out/epub/manual.epub "$dest/nixpkgs-manual.epub"
35
36 mkdir -p $out/nix-support/
37 echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products
38 echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products
39 '';
40}