Skip to content

Commit

Permalink
sys-apps/nix: restore doc part of DESTDIR patch
Browse files Browse the repository at this point in the history
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
trofi committed Nov 29, 2024
1 parent 04e8ee8 commit e6597f2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions sys-apps/nix/files/nix-2.24-doc-destdir.patch
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 $@
1 change: 1 addition & 0 deletions sys-apps/nix/nix-2.24.10-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-2.10-libpaths.patch
"${FILESDIR}"/${PN}-2.16-no-sandbox-fallback.patch
"${FILESDIR}"/${PN}-2.22-no-sandbox-fallback-README.patch
"${FILESDIR}"/${PN}-2.24-doc-destdir.patch
)

DISABLE_AUTOFORMATTING=yes
Expand Down

0 comments on commit e6597f2

Please sign in to comment.