gnu: python-tempora: Switch to pyproject-build-system.
[jackhill/guix/guix.git] / doc / local.mk
CommitLineData
575ed8d5 1# GNU Guix --- Functional package management for GNU
36629097 2# Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
62bc3c5b 3# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
575ed8d5 4# Copyright © 2013 Andreas Enge <andreas@enge.fr>
ce9a3042 5# Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
523790d1 6# Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
66072a00 7# Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu>
575ed8d5
AE
8#
9# This file is part of GNU Guix.
10#
11# GNU Guix is free software; you can redistribute it and/or modify it
12# under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 3 of the License, or (at
14# your option) any later version.
15#
16# GNU Guix is distributed in the hope that it will be useful, but
17# WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
66072a00 24# If adding a language, update the following variables, and info_TEXINFOS.
93bfd4d9
JL
25MANUAL_LANGUAGES = de es fr pt_BR ru zh_CN
26COOKBOOK_LANGUAGES = de fr ko sk
66072a00
JL
27
28# Arg1: A list of languages codes.
29# Arg2: The file name stem.
30lang_to_texinfo = $(foreach lang,$(1),%D%/$(2).$(lang).texi)
31
32# Automake does not understand GNU Make non-standard extensions,
33# unfortunately, so we cannot use the above patsubst-based function here.
de712e52 34info_TEXINFOS = %D%/guix.texi \
3bac7e64 35 %D%/guix.de.texi \
de712e52
LC
36 %D%/guix.es.texi \
37 %D%/guix.fr.texi \
c3eaff8a 38 %D%/guix.pt_BR.texi \
3bac7e64 39 %D%/guix.ru.texi \
7bc46ecc 40 %D%/guix.zh_CN.texi \
f98e83a1 41 %D%/guix-cookbook.texi \
58c59116 42 %D%/guix-cookbook.de.texi \
0f355124 43 %D%/guix-cookbook.fr.texi \
8830930e 44 %D%/guix-cookbook.ko.texi \
93bfd4d9 45 %D%/guix-cookbook.sk.texi
88856916 46
523790d1
ML
47%C%_guix_TEXINFOS = \
48 %D%/contributing.texi \
49 %D%/fdl-1.3.texi
50
88856916 51DOT_FILES = \
c0d2e7b1
ML
52 %D%/images/bootstrap-graph.dot \
53 %D%/images/bootstrap-packages.dot \
54 %D%/images/coreutils-graph.dot \
55 %D%/images/coreutils-bag-graph.dot \
cd5d5f53 56 %D%/images/gcc-core-mesboot0-graph.dot \
c0d2e7b1
ML
57 %D%/images/service-graph.dot \
58 %D%/images/shepherd-graph.dot
88856916
LC
59
60DOT_VECTOR_GRAPHICS = \
61 $(DOT_FILES:%.dot=%.eps) \
62 $(DOT_FILES:%.dot=%.pdf)
63
a9424c08 64EXTRA_DIST += \
c0d2e7b1 65 %D%/htmlxref.cnf \
88856916
LC
66 $(DOT_FILES) \
67 $(DOT_VECTOR_GRAPHICS) \
c0d2e7b1
ML
68 %D%/images/coreutils-size-map.eps \
69 %D%/environment-gdb.scm \
c9f321e5
RW
70 %D%/package-hello.scm \
71 %D%/package-hello.json
575ed8d5 72
dd51caac 73OS_CONFIG_EXAMPLES_TEXI = \
c0d2e7b1
ML
74 %D%/os-config-bare-bones.texi \
75 %D%/os-config-desktop.texi \
e95acc09
JL
76 %D%/os-config-lightweight-desktop.texi \
77 %D%/he-config-bare-bones.scm
dd51caac 78
66072a00
JL
79TRANSLATED_INFO = \
80 $(call lang_to_texinfo,$(MANUAL_LANGUAGES),guix) \
81 $(call lang_to_texinfo,$(MANUAL_LANGUAGES),contributing) \
82 $(call lang_to_texinfo,$(COOKBOOK_LANGUAGES),guix-cookbook)
b9fe8fd6 83
931c132a 84# Bundle this file so that makeinfo finds it in out-of-source-tree builds.
b9fe8fd6
JL
85BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
86EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
87MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
88
89PO4A_PARAMS := -M UTF-8 -L UTF-8 #master and localized encoding
90PO4A_PARAMS += -k 0 # produce an output even if the translation is not complete
91PO4A_PARAMS += -f texinfo # texinfo format
92
93# When a change to guix.texi occurs, it is not translated immediately.
0623138f 94# Because @pxref and @xref commands are references to sections by name, they
b9fe8fd6
JL
95# should be translated. If a modification adds a reference to a section, this
96# reference is not translated, which means it references a section that does not
97# exist.
b9fe8fd6 98define xref_command
0623138f
JL
99$(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \
100 "$(top_srcdir)/build-aux/convert-xref.scm" \
101 $@.tmp $<
b9fe8fd6
JL
102endef
103
0623138f 104$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go
b9fe8fd6
JL
105 -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp"
106 -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
c5881ff1 107 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
b9fe8fd6
JL
108 -mv "$@.tmp" "$@"
109
0623138f 110$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go
7bc46ecc
RW
111 -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp"
112 -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
c5881ff1 113 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
7bc46ecc
RW
114 -mv "$@.tmp" "$@"
115
0623138f 116$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go
39764ef8 117 -$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp"
c5881ff1 118 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
b9fe8fd6 119 -mv "$@.tmp" "$@"
931c132a 120
c0d2e7b1 121%D%/os-config-%.texi: gnu/system/examples/%.tmpl
e71ad29d 122 $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
931c132a
LC
123 cp "$<" "$@"
124
575ed8d5 125infoimagedir = $(infodir)/images
a8f996c6 126dist_infoimage_DATA = \
88856916 127 $(DOT_FILES:%.dot=%.png) \
e1c15e8b
LC
128 %D%/images/coreutils-size-map.png \
129 %D%/images/installer-network.png \
130 %D%/images/installer-partitions.png \
131 %D%/images/installer-resume.png
575ed8d5 132
227ff747
LC
133# Ask for warnings about cross-referenced manuals that are not listed in
134# htmlxref.cnf.
135AM_MAKEINFOHTMLFLAGS = --set-customization-variable CHECK_HTMLXREF=true
136
575ed8d5
AE
137# Try hard to obtain an image size and aspect that's reasonable for inclusion
138# in an Info or PDF document.
54461ce7
LC
139DOT_OPTIONS = \
140 -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
575ed8d5
AE
141 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
142
143.dot.png:
4c48878d 144 $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
ce9a3042 145 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
575ed8d5 146
54461ce7 147.dot.pdf:
4c48878d 148 $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
ce9a3042 149 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
54461ce7 150
575ed8d5 151.dot.eps:
4c48878d 152 $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
ce9a3042 153 mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
575ed8d5 154
66c8ea47 155.png.eps:
e71ad29d 156 $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \
66c8ea47
LC
157 mv "$@-tmp.eps" "$@"
158
c0d2e7b1 159# We cannot add new dependencies to `%D%/guix.pdf' & co. (info "(automake)
a9424c08
LC
160# Extending"). Using the `-local' rules is imperfect, because they may be
161# triggered after the main rule. Oh, well.
88856916
LC
162pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
163info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
164ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \
c0d2e7b1 165 $(top_srcdir)/%D%/images/coreutils-size-map.eps
66c8ea47 166dvi-local: ps-local
52eca736 167
36629097
EB
168## ----------- ##
169## Man pages. ##
170## ----------- ##
171
39118b5e
ML
172# The man pages are generated using GNU Help2man. In makefiles rules they
173# depend not on the binary, but on the source files. This usage allows a
174# manual page to be generated by the maintainer and included in the
175# distribution without requiring the end-user to have 'help2man' installed.
176# They are built in $(srcdir) like info manuals.
177
36629097 178sub_commands_mans = \
c0d2e7b1
ML
179 $(srcdir)/%D%/guix-archive.1 \
180 $(srcdir)/%D%/guix-build.1 \
181 $(srcdir)/%D%/guix-challenge.1 \
d9e83f2a 182 $(srcdir)/%D%/guix-deploy.1 \
c0d2e7b1
ML
183 $(srcdir)/%D%/guix-download.1 \
184 $(srcdir)/%D%/guix-edit.1 \
185 $(srcdir)/%D%/guix-environment.1 \
186 $(srcdir)/%D%/guix-gc.1 \
187 $(srcdir)/%D%/guix-hash.1 \
188 $(srcdir)/%D%/guix-import.1 \
189 $(srcdir)/%D%/guix-lint.1 \
190 $(srcdir)/%D%/guix-package.1 \
191 $(srcdir)/%D%/guix-publish.1 \
192 $(srcdir)/%D%/guix-pull.1 \
193 $(srcdir)/%D%/guix-refresh.1 \
194 $(srcdir)/%D%/guix-size.1 \
d9e83f2a
LC
195 $(srcdir)/%D%/guix-system.1 \
196 $(srcdir)/%D%/guix-time-machine.1 \
197 $(srcdir)/%D%/guix-weather.1
52eca736 198
62bc3c5b
LC
199# Assume that cross-compiled commands cannot be executed.
200if !CROSS_COMPILING
201
52eca736 202dist_man1_MANS = \
c0d2e7b1 203 $(srcdir)/%D%/guix.1 \
36629097
EB
204 $(sub_commands_mans)
205
62bc3c5b
LC
206endif
207
ff853a2a
LC
208gen_man = \
209 LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
210 $(HELP2MANFLAGS)
211
212HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
36629097 213
c0d2e7b1 214$(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans)
92d40a68 215 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
36629097 216
39118b5e
ML
217# The 'case' ensures the man pages are only generated if the corresponding
218# source script (the first prerequisite) has been changed. The $(GOBJECTS)
219# prerequisite is solely meant to force these docs to be made only after all
220# Guile modules have been compiled.
c0d2e7b1 221$(srcdir)/%D%/guix-%.1: guix/scripts/%.scm $(GOBJECTS)
36629097
EB
222 -@case '$?' in \
223 *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \
224 $(gen_man) --output="$@" "guix $*";; \
225 *) : ;; \
226 esac
acec3beb
LC
227
228if BUILD_DAEMON
62bc3c5b 229if !CROSS_COMPILING
acec3beb 230
c0d2e7b1 231dist_man1_MANS += $(srcdir)/%D%/guix-daemon.1
36629097 232
7dd05396 233$(srcdir)/%D%/guix-daemon.1: guix-daemon$(EXEEXT)
36629097 234 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
acec3beb
LC
235
236endif
62bc3c5b 237endif