summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2019-07-04 08:27:16 -0400
committerGraham Christensen <graham@grahamc.com>2019-07-04 09:10:13 -0400
commitd11f5a9d15c2d1eb735750392d69d515ae51df6c (patch)
treedee43f0c1af01b6ef430cee98cfcdc933246ec55
parentcd6bf8aa00962766e4db9f26e36848b6be8dd096 (diff)
downloadnixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar.gz
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar.bz2
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar.lz
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar.xz
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.tar.zst
nixpkgs-d11f5a9d15c2d1eb735750392d69d515ae51df6c.zip
docs: get version from doc-support build
-rw-r--r--doc/Makefile7
-rw-r--r--doc/default.nix2
-rw-r--r--doc/doc-support/default.nix2
3 files changed, 6 insertions, 5 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 4cd493d5565..06a70519488 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -74,11 +74,10 @@ highlightjs:
 manual-full.xml: ${MD_TARGETS} .version functions/library/locations.xml functions/library/generated *.xml **/*.xml **/**/*.xml
 	xmllint --nonet --xinclude --noxincludenode manual.xml --output manual-full.xml
 
-.version:
-	nix-instantiate --eval \
-		-E '(import ../lib).version' > .version
+.version: doc-support/result
+	ln -rfs ./doc-support/result/version .version
 
-doc-support/result:
+doc-support/result: doc-support/default.nix
 	(cd doc-support; nix-build)
 
 functions/library/locations.xml: doc-support/result
diff --git a/doc/default.nix b/doc/default.nix
index 7b44376034c..5cd91e0f112 100644
--- a/doc/default.nix
+++ b/doc/default.nix
@@ -29,7 +29,7 @@ in pkgs.stdenv.mkDerivation {
   ];
 
   postPatch = ''
-    echo ${lib.version} > .version
+    ln -s ${doc-support} ./doc-support/result
   '';
 
   installPhase = ''
diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix
index 93f6287d4b0..94b3ea464d9 100644
--- a/doc/doc-support/default.nix
+++ b/doc/doc-support/default.nix
@@ -2,6 +2,7 @@
 let
   locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
   functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
+  version = pkgs.lib.version;
 in pkgs.runCommand "doc-support" {}
 ''
   mkdir result
@@ -9,6 +10,7 @@ in pkgs.runCommand "doc-support" {}
     cd result
     ln -s ${locationsXml} ./function-locations.xml
     ln -s ${functionDocs} ./function-docs
+    echo -n "${version}" > ./version
   )
   mv result $out
 ''