mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-17 14:05:25 +03:00
82 lines
4.4 KiB
Diff
82 lines
4.4 KiB
Diff
Patch-Source: https://github.com/NixOS/nix/pull/5145 (updated)
|
|
--
|
|
From d7c09d119f9c85ae00c27eed2060280f77c3c455 Mon Sep 17 00:00:00 2001
|
|
From: Federico Pellegrin <fede@evolware.org>
|
|
Date: Tue, 17 Aug 2021 04:26:41 +0200
|
|
Subject: [PATCH] Docs build: depend on locally built nix executable and not
|
|
installed one
|
|
|
|
Previously many of the documentation targets were depending on
|
|
$(bindir)/nix which is the installed version. This meant that its
|
|
install rules would be triggered (which in chain would also trigger
|
|
the install of libraries, as reported in #5140). Therefore a build
|
|
of the documentation without an installation would not be possible
|
|
(which apart from doing unwanted operations it may also generate
|
|
permission problems for example).
|
|
The fix makes the rules depend on $(nix_DIR)/nix instead, which is
|
|
the executable in the build tree.
|
|
---
|
|
doc/manual/local.mk | 20 ++++++++++----------
|
|
1 file changed, 10 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
|
|
index 190f025..758a74a 100644
|
|
--- a/doc/manual/local.mk
|
|
+++ b/doc/manual/local.mk
|
|
@@ -24,7 +24,7 @@ dummy-env = env -i \
|
|
NIX_STATE_DIR=/dummy \
|
|
NIX_CONFIG='cores = 0'
|
|
|
|
-nix-eval = $(dummy-env) $(bindir)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw
|
|
+nix-eval = $(dummy-env) $(nix_DIR)/nix eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw
|
|
|
|
$(d)/%.1: $(d)/src/command-ref/%.md
|
|
@printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp
|
|
@@ -48,29 +48,29 @@ $(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/command-ref/new-cli
|
|
$(trace-gen) cat doc/manual/src/SUMMARY.md.in | while IFS= read line; do if [[ $$line = @manpages@ ]]; then cat doc/manual/src/command-ref/new-cli/SUMMARY.md; else echo "$$line"; fi; done > $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(bindir)/nix
|
|
+$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(nix_DIR)/nix
|
|
@rm -rf $@
|
|
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-manpage.nix { toplevel = builtins.readFile $<; }'
|
|
# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
|
|
$(trace-gen) sed -i $@.tmp/*.md -e 's^@docroot@^../..^g'
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(bindir)/nix
|
|
+$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.nix $(d)/src/command-ref/conf-file-prefix.md $(nix_DIR)/nix
|
|
@cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp
|
|
# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
|
|
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-options.nix (builtins.fromJSON (builtins.readFile $<))' \
|
|
| sed -e 's^@docroot@^..^g'>> $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/nix.json: $(bindir)/nix
|
|
- $(trace-gen) $(dummy-env) $(bindir)/nix __dump-args > $@.tmp
|
|
+$(d)/nix.json: $(nix_DIR)/nix
|
|
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix __dump-args > $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/conf-file.json: $(bindir)/nix
|
|
- $(trace-gen) $(dummy-env) $(bindir)/nix show-config --json --experimental-features nix-command > $@.tmp
|
|
+$(d)/conf-file.json: $(nix_DIR)/nix
|
|
+ $(trace-gen) $(dummy-env) $(nix_DIR)/nix show-config --json --experimental-features nix-command > $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(bindir)/nix
|
|
+$(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(nix_DIR)/nix
|
|
@cat doc/manual/src/language/builtins-prefix.md > $@.tmp
|
|
# @docroot@: https://nixos.org/manual/nix/unstable/contributing/hacking.html#docroot-variable
|
|
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' \
|
|
@@ -78,8 +78,8 @@ $(d)/src/language/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d
|
|
@cat doc/manual/src/language/builtins-suffix.md >> $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
-$(d)/builtins.json: $(bindir)/nix
|
|
- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
|
|
+$(d)/builtins.json: $(nix_DIR)/nix
|
|
+ $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(nix_DIR)/nix __dump-builtins > $@.tmp
|
|
@mv $@.tmp $@
|
|
|
|
# Generate the HTML manual.
|