all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 4535ae5bc44551bb7bda3280b45391d2753d230f 3029 bytes (raw)
name: gnu/packages/patches/git-filter-repo-generate-doc.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
From 56e6857e71d2b2a2236625f3c8b112bd40a8b164 Mon Sep 17 00:00:00 2001
From: Josselin Poiret <dev@jpoiret.xyz>
Date: Fri, 16 Feb 2024 00:21:06 +0800
Subject: [PATCH] Add documentation generation.

This requires the manpage XSL and asciidoc config files from git 2.41.0.

Modified-by: Hilton Chain <hako@ultrarare.space>
---
 Documentation/Makefile | 34 ++++++++++++++++++++++++++++++++++
 Makefile               | 17 +++--------------
 2 files changed, 37 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/Makefile

diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 0000000..d81ffbe
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,34 @@
+MAN_BASE_URL := $(prefix)/share/doc/git-doc/
+VERSION := $(git log --pretty="%H" -n 1)
+
+ASCIIDOC := asciidoc
+ASCIIDOC_EXTRA :=
+ASCIIDOC_HTML := xhtml11
+ASCIIDOC_DOCBOOK := docbook
+ASCIIDOC_CONF := -f asciidoc.conf
+ASCIIDOC_COMMON := $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \
+		-amanmanual='git-filter-repo Manual' -amansource='git-filter-repo $(VERSION)'
+ASCIIDOC_DEPS := asciidoc.conf
+TXT_TO_HTML := $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
+TXT_TO_XML := $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
+MANPAGE_XSL := manpage-normal.xsl
+XMLTO := xmlto
+XMLTO_EXTRA := -m manpage-bold-literal.xsl \
+		--stringparam man.base.url.for.relative.links='$(MAN_BASE_URL)'
+
+manpage-prereqs := $(wildcard manpage*.xsl)
+manpage-cmd := $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man
+
+%.xml : %.txt $(ASCIIDOC_DEPS)
+	$(TXT_TO_XML) -d manpage -o $@ $<
+
+man1/%.1 : %.xml $(manpage-prereqs)
+	mkdir -p man1
+	$(manpage-cmd) -o man1 $<
+
+html/%.html : %.txt $(ASCIIDOC_DEPS)
+	mkdir -p html
+	$(TXT_TO_HTML) -d manpage -o $@ $<
+
+man: man1/git-filter-repo.1
+html: html/git-filter-repo.html
diff --git a/Makefile b/Makefile
index a443450..d965ae5 100644
--- a/Makefile
+++ b/Makefile
@@ -20,21 +20,10 @@ test:
 fixup_locale:
 	sed -ie s%@@LOCALEDIR@@%$(localedir)% git-filter-repo

-# People installing from tarball will already have man1/git-filter-repo.1 and
-# html/git-filter-repo.html.  But let's support people installing from a git
-# clone too; for them, just cheat and snag a copy of the built docs that I
-# record in a different branch.
-snag_docs: Documentation/man1/git-filter-repo.1 Documentation/html/git-filter-repo.html
+doc:
+	$(MAKE) -C Documentation man html

-Documentation/man1/git-filter-repo.1:
-	mkdir -p Documentation/man1
-	git show origin/docs:man1/git-filter-repo.1 >Documentation/man1/git-filter-repo.1
-
-Documentation/html/git-filter-repo.html:
-	mkdir -p Documentation/html
-	git show origin/docs:html/git-filter-repo.html >Documentation/html/git-filter-repo.html
-
-install: snag_docs #fixup_locale
+install: doc #fixup_locale
 	install -Dm0755 git-filter-repo "$(DESTDIR)/$(bindir)/git-filter-repo"
 	install -dm0755 "$(DESTDIR)/$(pythondir)"
 	ln -sf "$(bindir)/git-filter-repo" "$(DESTDIR)/$(pythondir)/git_filter_repo.py"

base-commit: cbc6535694380d3a3bf3e5c96410d4ce7e8de94f
--
2.41.0


debug log:

solving e0bbc7831c ...
found e0bbc7831c in https://yhetil.org/guix/079d9634c8b4f12f91a51f15a0ed2042e939b3ba.1708017486.git.hako@ultrarare.space/

applying [1/1] https://yhetil.org/guix/079d9634c8b4f12f91a51f15a0ed2042e939b3ba.1708017486.git.hako@ultrarare.space/
diff --git a/gnu/packages/patches/git-filter-repo-generate-doc.patch b/gnu/packages/patches/git-filter-repo-generate-doc.patch
new file mode 100644
index 0000000000..e0bbc7831c

1:67: space before tab in indent.
 	sed -ie s%@@LOCALEDIR@@%$(localedir)% git-filter-repo
1:87: space before tab in indent.
 	install -Dm0755 git-filter-repo "$(DESTDIR)/$(bindir)/git-filter-repo"
1:88: space before tab in indent.
 	install -dm0755 "$(DESTDIR)/$(pythondir)"
1:89: space before tab in indent.
 	ln -sf "$(bindir)/git-filter-repo" "$(DESTDIR)/$(pythondir)/git_filter_repo.py"
Checking patch gnu/packages/patches/git-filter-repo-generate-doc.patch...
1:94: new blank line at EOF.
+
Applied patch gnu/packages/patches/git-filter-repo-generate-doc.patch cleanly.
warning: 5 lines add whitespace errors.

index at:
100644 4535ae5bc44551bb7bda3280b45391d2753d230f	gnu/packages/patches/git-filter-repo-generate-doc.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.