-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys-apps/nix: restore doc part of DESTDIR patch
Without the change the install fails to access generated man-pages in $WORKDIR while the build process targeted #DESTDIR. Reported-by: UnwhiteCat Issue: #54
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Fix DESTDIR handling for USE=doc case. | ||
|
||
The build system does not support a separate install phase and fails | ||
to create man pages locally: always attempts to write to $(DESTDIR). | ||
--- a/doc/manual/local.mk | ||
+++ b/doc/manual/local.mk | ||
@@ -183,26 +183,26 @@ install: $(docdir)/manual/index.html | ||
|
||
# Generate 'nix' manpages. | ||
.PHONY: manpages | ||
-manpages: $(mandir)/man1/nix3-manpages | ||
-install: $(mandir)/man1/nix3-manpages | ||
-man: doc/manual/generated/man1/nix3-manpages | ||
-all: doc/manual/generated/man1/nix3-manpages | ||
+manpages: $(DESTDIR)$(mandir)/man1/nix3-manpages | ||
+install: $(DESTDIR)$(mandir)/man1/nix3-manpages | ||
+man: $(DESTDIR)doc/manual/generated/man1/nix3-manpages | ||
+all: $(DESTDIR)doc/manual/generated/man1/nix3-manpages | ||
|
||
# FIXME: unify with how the other man pages are generated. | ||
# this one works differently and does not use any of the amenities provided by `/mk/lib.mk`. | ||
-$(mandir)/man1/nix3-manpages: doc/manual/generated/man1/nix3-manpages | ||
- @mkdir -p $(DESTDIR)$$(dirname $@) | ||
- $(trace-install) install -m 0644 $$(dirname $<)/* $(DESTDIR)$$(dirname $@) | ||
+$(DESTDIR)$(mandir)/man1/nix3-manpages: $(DESTDIR)doc/manual/generated/man1/nix3-manpages | ||
+ @mkdir -p $$(dirname $@) | ||
+ $(trace-install) install -m 0644 $$(dirname $<)/* $$(dirname $@) | ||
|
||
-doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli | ||
- @mkdir -p $(DESTDIR)$$(dirname $@) | ||
+$(DESTDIR)doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli | ||
+ @mkdir -p $$(dirname $@) | ||
$(trace-gen) for i in doc/manual/src/command-ref/new-cli/*.md; do \ | ||
name=$$(basename $$i .md); \ | ||
tmpFile=$$(mktemp); \ | ||
if [[ $$name = SUMMARY ]]; then continue; fi; \ | ||
printf "Title: %s\n\n" "$$name" > $$tmpFile; \ | ||
cat $$i >> $$tmpFile; \ | ||
- lowdown -sT man --nroff-nolinks -M section=1 $$tmpFile -o $(DESTDIR)$$(dirname $@)/$$name.1; \ | ||
+ lowdown -sT man --nroff-nolinks -M section=1 $$tmpFile -o $$(dirname $@)/$$name.1; \ | ||
rm $$tmpFile; \ | ||
done | ||
@touch $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters