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
|
.PHONY: clean
|
||||||
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
|
rm -rf ./out/ ./highlightjs
|
||||||
|
|
||||||
.PHONY: validate
|
.PHONY: validate
|
||||||
|
@ -78,14 +78,14 @@ manual-full.xml: ${MD_TARGETS} .version functions/library/locations.xml function
|
||||||
nix-instantiate --eval \
|
nix-instantiate --eval \
|
||||||
-E '(import ../lib).version' > .version
|
-E '(import ../lib).version' > .version
|
||||||
|
|
||||||
functions/library/locations.xml:
|
doc-support/result:
|
||||||
nix-build ./lib-function-locations.nix \
|
(cd doc-support; nix-build)
|
||||||
--out-link $@
|
|
||||||
|
|
||||||
functions/library/generated: functions/library/locations.xml
|
functions/library/locations.xml: doc-support/result
|
||||||
nix-build ./lib-function-docs.nix \
|
ln -rfs ./doc-support/result/function-locations.xml functions/library/locations.xml
|
||||||
--arg locationsXml $< \
|
|
||||||
--out-link $@
|
functions/library/generated: doc-support/result
|
||||||
|
ln -rfs ./doc-support/result/function-docs functions/library/generated
|
||||||
|
|
||||||
%.section.xml: %.section.md
|
%.section.xml: %.section.md
|
||||||
pandoc $^ -w docbook+smart \
|
pandoc $^ -w docbook+smart \
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
|
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
|
||||||
let
|
let
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
|
doc-support = import ./doc-support { inherit pkgs nixpkgs; };
|
||||||
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
|
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
name = "nixpkgs-manual";
|
name = "nixpkgs-manual";
|
||||||
|
|
||||||
|
@ -30,9 +29,6 @@ in pkgs.stdenv.mkDerivation {
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
rm -rf ./functions/library/locations.xml
|
|
||||||
ln -s ${locationsXml} ./functions/library/locations.xml
|
|
||||||
ln -s ${functionDocs} ./functions/library/generated
|
|
||||||
echo ${lib.version} > .version
|
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 {
|
with pkgs; stdenv.mkDerivation {
|
||||||
name = "nixpkgs-lib-docs";
|
name = "nixpkgs-lib-docs";
|
||||||
src = ./../lib;
|
src = ./../../lib;
|
||||||
|
|
||||||
buildInputs = [ nixdoc ];
|
buildInputs = [ nixdoc ];
|
||||||
installPhase = ''
|
installPhase = ''
|
Loading…
Reference in New Issue
Block a user