mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
docs: use a single nix-build for all the generate function docs
This commit is contained in:
parent
ddfe184efc
commit
cd6bf8aa00
16
doc/Makefile
16
doc/Makefile
|
@ -21,7 +21,7 @@ fix-misc-xml:
|
|||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f ${MD_TARGETS} .version manual-full.xml functions/library/locations.xml functions/library/generated
|
||||
rm -f ${MD_TARGETS} doc-support/result .version manual-full.xml functions/library/locations.xml functions/library/generated
|
||||
rm -rf ./out/ ./highlightjs
|
||||
|
||||
.PHONY: validate
|
||||
|
@ -78,14 +78,14 @@ manual-full.xml: ${MD_TARGETS} .version functions/library/locations.xml function
|
|||
nix-instantiate --eval \
|
||||
-E '(import ../lib).version' > .version
|
||||
|
||||
functions/library/locations.xml:
|
||||
nix-build ./lib-function-locations.nix \
|
||||
--out-link $@
|
||||
doc-support/result:
|
||||
(cd doc-support; nix-build)
|
||||
|
||||
functions/library/generated: functions/library/locations.xml
|
||||
nix-build ./lib-function-docs.nix \
|
||||
--arg locationsXml $< \
|
||||
--out-link $@
|
||||
functions/library/locations.xml: doc-support/result
|
||||
ln -rfs ./doc-support/result/function-locations.xml functions/library/locations.xml
|
||||
|
||||
functions/library/generated: doc-support/result
|
||||
ln -rfs ./doc-support/result/function-docs functions/library/generated
|
||||
|
||||
%.section.xml: %.section.md
|
||||
pandoc $^ -w docbook+smart \
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
|
||||
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
|
||||
doc-support = import ./doc-support { inherit pkgs nixpkgs; };
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
name = "nixpkgs-manual";
|
||||
|
||||
|
@ -30,9 +29,6 @@ in pkgs.stdenv.mkDerivation {
|
|||
];
|
||||
|
||||
postPatch = ''
|
||||
rm -rf ./functions/library/locations.xml
|
||||
ln -s ${locationsXml} ./functions/library/locations.xml
|
||||
ln -s ${functionDocs} ./functions/library/generated
|
||||
echo ${lib.version} > .version
|
||||
'';
|
||||
|
||||
|
|
14
doc/doc-support/default.nix
Normal file
14
doc/doc-support/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
|
||||
let
|
||||
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
|
||||
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
|
||||
in pkgs.runCommand "doc-support" {}
|
||||
''
|
||||
mkdir result
|
||||
(
|
||||
cd result
|
||||
ln -s ${locationsXml} ./function-locations.xml
|
||||
ln -s ${functionDocs} ./function-docs
|
||||
)
|
||||
mv result $out
|
||||
''
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
with pkgs; stdenv.mkDerivation {
|
||||
name = "nixpkgs-lib-docs";
|
||||
src = ./../lib;
|
||||
src = ./../../lib;
|
||||
|
||||
buildInputs = [ nixdoc ];
|
||||
installPhase = ''
|
Loading…
Reference in a new issue