projects/guix·blob python-team · refs

322 lines · 11.2 KiB

1# GNU Guix --- Functional package management for GNU
2# Copyright © 2016 Eric Bavier <[email protected]>
3# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email protected]>
4# Copyright © 2013 Andreas Enge <[email protected]>
5# Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <[email protected]>
6# Copyright © 2016, 2018 Mathieu Lirzin <[email protected]>
7# Copyright © 2018, 2021 Julien Lepiller <[email protected]>
8# Copyright © 2019 Timothy Sample <[email protected]>
9# Copyright © 2024, 2026 Janneke Nieuwenhuizen <[email protected]>
10# Copyright © 2024 gemmaro <[email protected]>
11#
12# This file is part of GNU Guix.
13#
14# GNU Guix is free software; you can redistribute it and/or modify it
15# under the terms of the GNU General Public License as published by
16# the Free Software Foundation; either version 3 of the License, or (at
17# your option) any later version.
18#
19# GNU Guix is distributed in the hope that it will be useful, but
20# WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27# If adding a language, update the following variables, and info_TEXINFOS.
28MANUAL_LANGUAGES = de es fr it pt_BR ru zh_CN
29COOKBOOK_LANGUAGES = de es fr it ko pt_BR ru sk sv zh_CN
30
31# Arg1: A list of languages codes.
32# Arg2: The file name stem.
33lang_to_texinfo = $(foreach lang,$(1),$(srcdir)/%D%/$(2).$(lang).texi)
34
35# Automake does not understand GNU Make non-standard extensions,
36# unfortunately, so we cannot use the above patsubst-based function here.
37info_TEXINFOS = %D%/guix.texi \
38 %D%/guix.de.texi \
39 %D%/guix.es.texi \
40 %D%/guix.fr.texi \
41 %D%/guix.it.texi \
42 %D%/guix.pt_BR.texi \
43 %D%/guix.ru.texi \
44 %D%/guix.zh_CN.texi \
45 %D%/guix-cookbook.texi \
46 %D%/guix-cookbook.de.texi \
47 %D%/guix-cookbook.es.texi \
48 %D%/guix-cookbook.fr.texi \
49 %D%/guix-cookbook.it.texi \
50 %D%/guix-cookbook.ko.texi \
51 %D%/guix-cookbook.pt_BR.texi \
52 %D%/guix-cookbook.ru.texi \
53 %D%/guix-cookbook.sk.texi \
54 %D%/guix-cookbook.sv.texi \
55 %D%/guix-cookbook.zh_CN.texi
56
57%C%_guix_TEXINFOS = \
58 $(OS_CONFIG_EXAMPLES_TEXI) \
59 %D%/contributing.texi \
60 %D%/fdl-1.3.texi
61
62DOT_FILES = \
63 %D%/images/bootstrap-graph.dot \
64 %D%/images/bootstrap-packages.dot \
65 %D%/images/coreutils-graph.dot \
66 %D%/images/coreutils-bag-graph.dot \
67 %D%/images/gcc-core-mesboot0-graph.dot \
68 %D%/images/service-graph.dot \
69 %D%/images/shepherd-graph.dot
70
71DOT_VECTOR_GRAPHICS = \
72 $(DOT_FILES:%.dot=%.eps) \
73 $(DOT_FILES:%.dot=%.pdf)
74
75EXTRA_DIST += \
76 %D%/htmlxref.cnf \
77 $(DOT_FILES) \
78 $(DOT_VECTOR_GRAPHICS) \
79 %D%/images/coreutils-size-map.eps \
80 %D%/environment-gdb.scm \
81 %D%/package-hello.scm \
82 %D%/package-hello.json
83
84OS_CONFIG_EXAMPLES_TEXI = \
85 %D%/os-config-bare-bones.texi \
86 %D%/os-config-desktop.texi \
87 %D%/os-config-lightweight-desktop.texi \
88 %D%/he-config-bare-bones.scm
89
90TRANSLATED_INFO = \
91 $(call lang_to_texinfo,$(MANUAL_LANGUAGES),guix) \
92 $(call lang_to_texinfo,$(MANUAL_LANGUAGES),contributing) \
93 $(call lang_to_texinfo,$(COOKBOOK_LANGUAGES),guix-cookbook)
94
95# Bundle this file so that makeinfo finds it in out-of-source-tree builds.
96BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
97EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
98MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
99
100# When a change to guix.texi occurs, it is not translated immediately.
101# Because @pxref and @xref commands are references to sections by name, they
102# should be translated. If a modification adds a reference to a section, this
103# reference is not translated, which means it references a section that does not
104# exist.
105define xref_command
106$(top_builddir)/pre-inst-env $(GUILE) --no-auto-compile \
107 "$(top_srcdir)/build-aux/convert-xref.scm" \
108 [email protected] $<
109endef
110
111# If /dev/null is used for this POT file path, a warning will be issued
112# because the path extension is not 'pot'.
113dummy_pot = $(shell mktemp --suffix=.pot)
114
115$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go
116 -$(AM_V_PO4A)$(PO4A) --no-update \
117 --variable localized="$@.tmp" \
118 --variable master="$(srcdir)/%D%/guix.texi" \
119 --variable po="$<" \
120 --variable pot=$(dummy_pot) \
121 $(srcdir)/po/doc/po4a.cfg
122 -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
123 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
124 -mv "$@.tmp" "$@"
125
126$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go
127 -$(AM_V_PO4A)$(PO4A) --no-update \
128 --variable localized="$@.tmp" \
129 --variable master="$(srcdir)/%D%/guix-cookbook.texi" \
130 --variable po="$<" \
131 --variable pot=$(dummy_pot) \
132 $(srcdir)/po/doc/po4a.cfg
133 -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
134 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
135 -mv "$@.tmp" "$@"
136
137$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go
138 -$(AM_V_PO4A)$(PO4A) --no-update \
139 --variable localized="$@.tmp" \
140 --variable master="$(srcdir)/%D%/contributing.texi" \
141 --variable po="$<" \
142 --variable pot=$(dummy_pot) \
143 $(srcdir)/po/doc/po4a.cfg
144 -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
145 -mv "$@.tmp" "$@"
146
147%D%/os-config-%.texi: gnu/system/examples/%.tmpl
148 $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
149 sed -e s,@,@@,g "$<" > "$@"
150
151infoimagedir = $(infodir)/images
152dist_infoimage_DATA = \
153 $(DOT_FILES:%.dot=%.png) \
154 %D%/images/coreutils-size-map.png \
155 %D%/images/installer-network.png \
156 %D%/images/installer-partitions.png \
157 %D%/images/installer-resume.png
158
159# Ask for warnings about cross-referenced manuals that are not listed in
160# htmlxref.cnf.
161AM_MAKEINFOHTMLFLAGS = --set-customization-variable CHECK_HTMLXREF=true
162
163# Try hard to obtain an image size and aspect that's reasonable for inclusion
164# in an Info or PDF document.
165DOT_OPTIONS = \
166 -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
167 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
168
169.dot.png:
170 $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"
171 $(AM_V_at)mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
172
173.dot.pdf:
174 $(AM_V_DOT)set -e; export TZ=UTC0; \
175 $(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"
176 $(AM_V_at)sed -ri \
177 -e 's,(/CreationDate \(D:).*\),\119700101000000),' \
178 "$(srcdir)/$@.tmp"
179 $(AM_V_at)mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
180
181.dot.eps:
182 $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"
183 $(AM_v_at)! grep -q %%CreationDate "$(srcdir)/$@.tmp"
184 $(AM_V_at)mv "$(srcdir)/$@.tmp" "$@"
185
186.png.eps:
187 $(AM_V_GEN)convert "$<" "$@-tmp.eps"
188 $(AM_V_at)mv "$@-tmp.eps" "$@"
189
190# We cannot add new dependencies to `%D%/guix.pdf' & co. (info "(automake)
191# Extending"). Using the `-local' rules is imperfect, because they may be
192# triggered after the main rule. Oh, well.
193pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
194info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
195ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \
196 $(top_srcdir)/%D%/images/coreutils-size-map.eps
197dvi-local: ps-local
198
199## ----------- ##
200## Man pages. ##
201## ----------- ##
202
203# The man pages are generated using GNU Help2man. In makefiles rules they
204# depend not on the binary, but on the source files. This usage allows a
205# manual page to be generated by the maintainer and included in the
206# distribution without requiring the end-user to have 'help2man' installed.
207# They are built in $(srcdir) like info manuals.
208
209sub_commands_mans = \
210 $(srcdir)/%D%/guix-archive.1 \
211 $(srcdir)/%D%/guix-build.1 \
212 $(srcdir)/%D%/guix-challenge.1 \
213 $(srcdir)/%D%/guix-container.1 \
214 $(srcdir)/%D%/guix-deploy.1 \
215 $(srcdir)/%D%/guix-describe.1 \
216 $(srcdir)/%D%/guix-download.1 \
217 $(srcdir)/%D%/guix-edit.1 \
218 $(srcdir)/%D%/guix-environment.1 \
219 $(srcdir)/%D%/guix-gc.1 \
220 $(srcdir)/%D%/guix-git.1 \
221 $(srcdir)/%D%/guix-graph.1 \
222 $(srcdir)/%D%/guix-hash.1 \
223 $(srcdir)/%D%/guix-home.1 \
224 $(srcdir)/%D%/guix-import.1 \
225 $(srcdir)/%D%/guix-lint.1 \
226 $(srcdir)/%D%/guix-offload.1 \
227 $(srcdir)/%D%/guix-pack.1 \
228 $(srcdir)/%D%/guix-package.1 \
229 $(srcdir)/%D%/guix-processes.1 \
230 $(srcdir)/%D%/guix-publish.1 \
231 $(srcdir)/%D%/guix-pull.1 \
232 $(srcdir)/%D%/guix-refresh.1 \
233 $(srcdir)/%D%/guix-repl.1 \
234 $(srcdir)/%D%/guix-shell.1 \
235 $(srcdir)/%D%/guix-size.1 \
236 $(srcdir)/%D%/guix-style.1 \
237 $(srcdir)/%D%/guix-system.1 \
238 $(srcdir)/%D%/guix-time-machine.1 \
239 $(srcdir)/%D%/guix-weather.1
240
241if HAVE_GUILE_SSH
242sub_commands_mans += $(srcdir)/%D%/guix-copy.1
243endif HAVE_GUILE_SSH
244
245# Assume that cross-compiled commands cannot be executed.
246if !CROSS_COMPILING
247
248dist_man1_MANS = \
249 $(srcdir)/%D%/guix.1 \
250 $(sub_commands_mans)
251
252endif
253
254gen_man = \
255 LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
256 $(HELP2MANFLAGS)
257
258HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
259# help2man reproducibility
260SOURCE_DATE_EPOCH = $(shell git show HEAD --format=%ct --no-patch 2>/dev/null || echo 1)
261export SOURCE_DATE_EPOCH
262
263$(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans)
264 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
265
266# The 'case' ensures the man pages are only generated if the corresponding
267# source script (the first prerequisite) has been changed. The $(GOBJECTS)
268# prerequisite is solely meant to force these docs to be made only after all
269# Guile modules have been compiled. We also need the guix script to exist.
270$(srcdir)/%D%/guix-%.1: guix/scripts/%.scm $(GOBJECTS) scripts/guix
271 -@case '$?' in \
272 *$<*) $(AM_V_HELP2MAN:@%=%)$(gen_man) --output="$@" "guix $*";; \
273 *) : ;; \
274 esac
275
276if BUILD_DAEMON
277if !CROSS_COMPILING
278
279dist_man1_MANS += $(srcdir)/%D%/guix-daemon.1
280
281$(srcdir)/%D%/guix-daemon.1: guix-daemon$(EXEEXT)
282 -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
283
284endif
285endif
286
287# Reproducible tarball
288
289DIST_CONFIGURE_FLAGS = \
290 --localstatedir=/var \
291 --sysconfdir=/etc
292
293# Delete all Autotools-generated files and rerun configure to ensure
294# a clean cache and distributing reproducible versions.
295auto-clean: maintainer-clean-vti doc-clean
296 rm -f ABOUT-NLS INSTALL
297 rm -f aclocal.m4 configure libtool Makefile.in
298 if test -e .git; then \
299 git clean -fdx -- '.am*' build-aux m4 po; \
300 else \
301 rm -rf .am*; \
302 $(MAKE) -C po/guix maintainer-clean; \
303 $(MAKE) -C po/packages maintainer-clean; \
304 fi
305 rm -f guile
306 rm -f guix-daemon nix/nix-daemon/guix_daemon-guix-daemon.o
307# Automake fails if guix-cookbook-LANG.texi stubs are missing; running
308# autoreconf -vif is not enough.
309 ./bootstrap
310# The dependency chain for the guix-cookbook-LANG.texi was cut on purpose;
311# they must be deleted to ensure a rebuild.
312 rm -f $(filter-out %D%/guix.texi %D%/guix-cookbook.texi, $(info_TEXINFOS))
313 ./configure $(DIST_CONFIGURE_FLAGS)
314
315# Delete all generated doc files to ensure a clean cache and distributing
316# reproducible versions.
317doc-clean:
318 rm -f $(srcdir)/doc/*.1
319 rm -f $(srcdir)/doc/stamp*
320 rm -f $(DOT_FILES:%.dot=%.png)
321 rm -f $(DOT_VECTOR_GRAPHICS)
322 rm -f doc/images/coreutils-size-map.eps