projects/guix·blob wip-fix-system-tests · refs

1385 lines · 46.0 KiB

1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012-2025 Ludovic Courtès <[email protected]>
3# Copyright © 2013 Andreas Enge <[email protected]>
4# Copyright © 2015, 2017 Alex Kost <[email protected]>
5# Copyright © 2016, 2018 Mathieu Lirzin <[email protected]>
6# Copyright © 2016, 2017, 2018, 2019 Mark H Weaver <[email protected]>
7# Copyright © 2017 Mathieu Othacehe <[email protected]>
8# Copyright © 2017 Leo Famulari <[email protected]>
9# Copyright © 2017 Ricardo Wurmus <[email protected]>
10# Copyright © 2017, 2020, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
11# Copyright © 2017 Arun Isaac <[email protected]>
12# Copyright © 2018 Nikita <[email protected]>
13# Copyright © 2018 Julien Lepiller <[email protected]>
14# Copyright © 2018 Oleg Pykhalov <[email protected]>
15# Copyright © 2018 Alex Vong <[email protected]>
16# Copyright © 2019, 2023 Efraim Flashner <[email protected]>
17# Copyright © 2020, 2021, 2023 Maxim Cournoyer <[email protected]>
18# Copyright © 2021 Chris Marusich <[email protected]>
19# Copyright © 2021 Andrew Tropin <[email protected]>
20# Copyright © 2023 Clément Lassieur <[email protected]>
21# Copyright © 2023, 2024 Wilko Meyer <[email protected]>
22# Copyright © 2024 gemmaro <[email protected]>
23# Copyright © 2025 Brice Waegeneire <[email protected]>
24# Copyright © 2025 Florian Pelz <[email protected]>
25#
26# This file is part of GNU Guix.
27#
28# GNU Guix is free software; you can redistribute it and/or modify it
29# under the terms of the GNU General Public License as published by
30# the Free Software Foundation; either version 3 of the License, or (at
31# your option) any later version.
32#
33# GNU Guix is distributed in the hope that it will be useful, but
34# WITHOUT ANY WARRANTY; without even the implied warranty of
35# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36# GNU General Public License for more details.
37#
38# You should have received a copy of the GNU General Public License
39# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41MSGMERGE_UPDATE = @MSGMERGE@ --update
42
43bin_SCRIPTS = scripts/guix
44
45# Handle substitution of fully-expanded Autoconf variables.
46do_subst = $(SED) \
47 -e 's,[@]GUILE[@],$(GUILE),g' \
48 -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
49 -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
50 -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
51 -e 's,[@]localedir[@],$(localedir),g'
52
53scripts/guix: scripts/guix.in Makefile guile$(EXEEXT)
54 $(AM_V_at)rm -f $@ $@-t
55 $(AM_V_at)$(MKDIR_P) "$(@D)"
56 $(AM_V_GEN)$(do_subst) < "$(srcdir)/[email protected]" > "$@-t"
57 $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
58
59# This is our variant of the 'guile' executable, one that doesn't complain
60# about locales.
61pkglibexec_PROGRAMS = guile
62guile_SOURCES = gnu/packages/aux-files/guile-launcher.c
63guile_LDADD = $(GUILE_LIBS)
64guile_CFLAGS = $(GUILE_CFLAGS)
65
66# Have the 'guix' command refer to our 'guile'.
67install-exec-hook:
68 $(SED) -i "$(DESTDIR)$(bindir)/guix" \
69 -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g'
70
71nodist_noinst_SCRIPTS = \
72 pre-inst-env \
73 test-env
74
75# Modules that are not compiled but are installed nonetheless, such as
76# build-side modules with unusual dependencies.
77MODULES_NOT_COMPILED = \
78 guix/build/po.scm \
79 guix/man-db.scm
80
81include gnu/local.mk
82include po/doc/local.mk
83
84MODULES = \
85 guix/base16.scm \
86 guix/base32.scm \
87 guix/base64.scm \
88 guix/ci.scm \
89 guix/cpio.scm \
90 guix/cpu.scm \
91 guix/deprecation.scm \
92 guix/docker.scm \
93 guix/records.scm \
94 guix/openpgp.scm \
95 guix/pki.scm \
96 guix/progress.scm \
97 guix/combinators.scm \
98 guix/memoization.scm \
99 guix/utils.scm \
100 guix/sets.scm \
101 guix/modules.scm \
102 guix/download.scm \
103 guix/discovery.scm \
104 guix/android-repo-download.scm \
105 guix/bzr-download.scm \
106 guix/git-download.scm \
107 guix/hg-download.scm \
108 guix/hash.scm \
109 guix/swh.scm \
110 guix/monads.scm \
111 guix/monad-repl.scm \
112 guix/gexp.scm \
113 guix/profiles.scm \
114 guix/serialization.scm \
115 guix/nar.scm \
116 guix/narinfo.scm \
117 guix/derivations.scm \
118 guix/grafts.scm \
119 guix/repl.scm \
120 guix/rpm.scm \
121 guix/transformations.scm \
122 guix/inferior.scm \
123 guix/describe.scm \
124 guix/quirks.scm \
125 guix/channels.scm \
126 guix/gnu-maintenance.scm \
127 guix/self.scm \
128 guix/substitutes.scm \
129 guix/upstream.scm \
130 guix/licenses.scm \
131 guix/lint.scm \
132 guix/glob.scm \
133 guix/git.scm \
134 guix/git-authenticate.scm \
135 guix/graph.scm \
136 guix/cache.scm \
137 guix/cve.scm \
138 guix/workers.scm \
139 guix/least-authority.scm \
140 guix/read-print.scm \
141 guix/ipfs.scm \
142 guix/platform.scm \
143 guix/platforms/arm.scm \
144 guix/platforms/avr.scm \
145 guix/platforms/loongarch.scm \
146 guix/platforms/mips.scm \
147 guix/platforms/or1k.scm \
148 guix/platforms/powerpc.scm \
149 guix/platforms/riscv.scm \
150 guix/platforms/x86.scm \
151 guix/platforms/xtensa.scm \
152 guix/build-system.scm \
153 guix/build-system/agda.scm \
154 guix/build-system/android-ndk.scm \
155 guix/build-system/ant.scm \
156 guix/build-system/asdf.scm \
157 guix/build-system/cargo.scm \
158 guix/build-system/channel.scm \
159 guix/build-system/chicken.scm \
160 guix/build-system/clojure.scm \
161 guix/build-system/cmake.scm \
162 guix/build-system/copy.scm \
163 guix/build-system/composer.scm \
164 guix/build-system/dub.scm \
165 guix/build-system/dune.scm \
166 guix/build-system/elm.scm \
167 guix/build-system/emacs.scm \
168 guix/build-system/font.scm \
169 guix/build-system/glib-or-gtk.scm \
170 guix/build-system/gnu.scm \
171 guix/build-system/go.scm \
172 guix/build-system/guile.scm \
173 guix/build-system/haskell.scm \
174 guix/build-system/julia.scm \
175 guix/build-system/linux-module.scm \
176 guix/build-system/luanti.scm \
177 guix/build-system/maven.scm \
178 guix/build-system/meson.scm \
179 guix/build-system/minetest.scm \
180 guix/build-system/minify.scm \
181 guix/build-system/mix.scm \
182 guix/build-system/mozilla.scm \
183 guix/build-system/node.scm \
184 guix/build-system/ocaml.scm \
185 guix/build-system/perl.scm \
186 guix/build-system/pyproject.scm \
187 guix/build-system/python.scm \
188 guix/build-system/qt.scm \
189 guix/build-system/r.scm \
190 guix/build-system/rakudo.scm \
191 guix/build-system/rebar.scm \
192 guix/build-system/renpy.scm \
193 guix/build-system/ruby.scm \
194 guix/build-system/scons.scm \
195 guix/build-system/texlive.scm \
196 guix/build-system/tree-sitter.scm \
197 guix/build-system/trivial.scm \
198 guix/build-system/vim.scm \
199 guix/build-system/waf.scm \
200 guix/build-system/zig.scm \
201 guix/ftp-client.scm \
202 guix/http-client.scm \
203 guix/gnupg.scm \
204 guix/elf.scm \
205 guix/profiling.scm \
206 guix/store.scm \
207 guix/cvs-download.scm \
208 guix/svn-download.scm \
209 guix/colors.scm \
210 guix/i18n.scm \
211 guix/diagnostics.scm \
212 guix/ui.scm \
213 guix/status.scm \
214 guix/build/agda-build-system.scm \
215 guix/build/android-ndk-build-system.scm \
216 guix/build/ant-build-system.scm \
217 guix/build/download.scm \
218 guix/build/download-nar.scm \
219 guix/build/cargo-build-system.scm \
220 guix/build/cargo-utils.scm \
221 guix/build/chicken-build-system.scm \
222 guix/build/cmake-build-system.scm \
223 guix/build/composer-build-system.scm \
224 guix/build/dub-build-system.scm \
225 guix/build/dune-build-system.scm \
226 guix/build/elm-build-system.scm \
227 guix/build/emacs-build-system.scm \
228 guix/build/meson-build-system.scm \
229 guix/build/minify-build-system.scm \
230 guix/build/font-build-system.scm \
231 guix/build/go-build-system.scm \
232 guix/build/android-repo.scm \
233 guix/build/asdf-build-system.scm \
234 guix/build/bzr.scm \
235 guix/build/copy-build-system.scm \
236 guix/build/git.scm \
237 guix/build/hg.scm \
238 guix/build/glib-or-gtk-build-system.scm \
239 guix/build/gnu-bootstrap.scm \
240 guix/build/gnu-build-system.scm \
241 guix/build/gnu-dist.scm \
242 guix/build/guile-build-system.scm \
243 guix/build/luanti-build-system.scm \
244 guix/build/maven-build-system.scm \
245 guix/build/minetest-build-system.scm \
246 guix/build/mix-build-system.scm \
247 guix/build/node-build-system.scm \
248 guix/build/perl-build-system.scm \
249 guix/build/pyproject-build-system.scm \
250 guix/build/python-build-system.scm \
251 guix/build/ocaml-build-system.scm \
252 guix/build/qt-build-system.scm \
253 guix/build/r-build-system.scm \
254 guix/build/renpy-build-system.scm \
255 guix/build/rakudo-build-system.scm \
256 guix/build/rebar-build-system.scm \
257 guix/build/ruby-build-system.scm \
258 guix/build/scons-build-system.scm \
259 guix/build/texlive-build-system.scm \
260 guix/build/tree-sitter-build-system.scm \
261 guix/build/vim-build-system.scm \
262 guix/build/waf-build-system.scm \
263 guix/build/haskell-build-system.scm \
264 guix/build/julia-build-system.scm \
265 guix/build/kconfig.scm \
266 guix/build/linux-module-build-system.scm \
267 guix/build/store-copy.scm \
268 guix/build/json.scm \
269 guix/build/pack.scm \
270 guix/build/utils.scm \
271 guix/build/union.scm \
272 guix/build/profiles.scm \
273 guix/build/compile.scm \
274 guix/build/cvs.scm \
275 guix/build/svn.scm \
276 guix/build/syscalls.scm \
277 guix/build/gremlin.scm \
278 guix/build/debug-link.scm \
279 guix/build/clojure-build-system.scm \
280 guix/build/clojure-utils.scm \
281 guix/build/emacs-utils.scm \
282 guix/build/java-utils.scm \
283 guix/build/lisp-utils.scm \
284 guix/build/meson-configuration.scm \
285 guix/build/maven/java.scm \
286 guix/build/maven/plugin.scm \
287 guix/build/maven/pom.scm \
288 guix/build/graft.scm \
289 guix/build/bournish.scm \
290 guix/build/qt-utils.scm \
291 guix/build/zig-build-system.scm \
292 guix/build/zig-utils.scm \
293 guix/build/make-bootstrap.scm \
294 guix/build/toml.scm \
295 guix/search-paths.scm \
296 guix/packages.scm \
297 guix/import/cabal.scm \
298 guix/import/composer.scm \
299 guix/import/cpan.scm \
300 guix/import/cran.scm \
301 guix/import/crate.scm \
302 guix/import/crate/cargo-lock.scm \
303 guix/import/egg.scm \
304 guix/import/elm.scm \
305 guix/import/elpa.scm \
306 guix/import/gem.scm \
307 guix/import/git.scm \
308 guix/import/github.scm \
309 guix/import/gnome.scm \
310 guix/import/gnu.scm \
311 guix/import/go.scm \
312 guix/import/hackage.scm \
313 guix/import/hexpm.scm \
314 guix/import/json.scm \
315 guix/import/kde.scm \
316 guix/import/launchpad.scm \
317 guix/import/luanti.scm \
318 guix/import/minetest.scm \
319 guix/import/nuget.scm \
320 guix/import/npm-binary.scm \
321 guix/import/opam.scm \
322 guix/import/print.scm \
323 guix/import/pypi.scm \
324 guix/import/stackage.scm \
325 guix/import/test.scm \
326 guix/import/texlive.scm \
327 guix/import/utils.scm \
328 guix/scripts.scm \
329 guix/scripts/download.scm \
330 guix/scripts/perform-download.scm \
331 guix/scripts/build.scm \
332 guix/scripts/archive.scm \
333 guix/scripts/import.scm \
334 guix/scripts/package.scm \
335 guix/scripts/locate.scm \
336 guix/scripts/install.scm \
337 guix/scripts/remove.scm \
338 guix/scripts/upgrade.scm \
339 guix/scripts/search.scm \
340 guix/scripts/show.scm \
341 guix/scripts/gc.scm \
342 guix/scripts/hash.scm \
343 guix/scripts/pack.scm \
344 guix/scripts/pull.scm \
345 guix/scripts/processes.scm \
346 guix/scripts/substitute.scm \
347 guix/scripts/authenticate.scm \
348 guix/scripts/refresh.scm \
349 guix/scripts/repl.scm \
350 guix/scripts/describe.scm \
351 guix/scripts/style.scm \
352 guix/scripts/system.scm \
353 guix/scripts/system/edit.scm \
354 guix/scripts/system/reconfigure.scm \
355 guix/scripts/system/search.scm \
356 guix/scripts/home.scm \
357 guix/scripts/home/edit.scm \
358 guix/scripts/home/import.scm \
359 guix/scripts/lint.scm \
360 guix/scripts/challenge.scm \
361 guix/scripts/import/composer.scm \
362 guix/scripts/import/crate.scm \
363 guix/scripts/import/cpan.scm \
364 guix/scripts/import/cran.scm \
365 guix/scripts/import/egg.scm \
366 guix/scripts/import/elm.scm \
367 guix/scripts/import/elpa.scm \
368 guix/scripts/import/gem.scm \
369 guix/scripts/import/gnu.scm \
370 guix/scripts/import/go.scm \
371 guix/scripts/import/hackage.scm \
372 guix/scripts/import/hexpm.scm \
373 guix/scripts/import/json.scm \
374 guix/scripts/import/luanti.scm \
375 guix/scripts/import/minetest.scm \
376 guix/scripts/import/npm-binary.scm \
377 guix/scripts/import/opam.scm \
378 guix/scripts/import/pypi.scm \
379 guix/scripts/import/stackage.scm \
380 guix/scripts/import/texlive.scm \
381 guix/scripts/environment.scm \
382 guix/scripts/shell.scm \
383 guix/scripts/publish.scm \
384 guix/scripts/edit.scm \
385 guix/scripts/size.scm \
386 guix/scripts/git.scm \
387 guix/scripts/git/authenticate.scm \
388 guix/scripts/graph.scm \
389 guix/scripts/weather.scm \
390 guix/scripts/container.scm \
391 guix/scripts/container/exec.scm \
392 guix/scripts/deploy.scm \
393 guix/scripts/time-machine.scm \
394 guix.scm \
395 $(GNU_SYSTEM_MODULES)
396
397if HAVE_GUILE_SSH
398
399MODULES += \
400 guix/ssh.scm \
401 guix/remote.scm \
402 guix/scripts/copy.scm \
403 guix/store/ssh.scm
404
405endif HAVE_GUILE_SSH
406
407if HAVE_GUILE_AVAHI
408
409MODULES += \
410 guix/avahi.scm \
411 guix/scripts/discover.scm
412
413endif HAVE_GUILE_AVAHI
414
415if BUILD_DAEMON_OFFLOAD
416
417MODULES += \
418 guix/scripts/offload.scm
419
420endif BUILD_DAEMON_OFFLOAD
421
422INSTALLER_SCRIPT = guix/scripts/system/installer.scm
423
424if ENABLE_INSTALLER
425MODULES += $(INSTALLER_SCRIPT)
426else
427MODULES_NOT_COMPILED += $(INSTALLER_SCRIPT)
428endif !ENABLE_INSTALLER
429
430# Scheme implementation of the build daemon and related functionality.
431STORE_MODULES = \
432 guix/store/database.scm \
433 guix/store/deduplication.scm \
434 guix/store/roots.scm
435
436MODULES += $(STORE_MODULES)
437
438# Internal modules with test suite support.
439dist_noinst_DATA = \
440 guix/tests.scm \
441 guix/tests/http.scm \
442 guix/tests/git.scm \
443 guix/tests/gnupg.scm
444
445# Auxiliary files for packages.
446AUX_FILES = \
447 gnu/packages/aux-files/chromium/master-preferences.json \
448 gnu/packages/aux-files/emacs/comp-integrity.el \
449 gnu/packages/aux-files/emacs/guix-emacs.el \
450 gnu/packages/aux-files/findclass.php \
451 gnu/packages/aux-files/guix.vim \
452 gnu/packages/aux-files/guix-nvim.vim \
453 gnu/packages/aux-files/linux-libre/6.16-arm.conf \
454 gnu/packages/aux-files/linux-libre/6.16-arm64.conf \
455 gnu/packages/aux-files/linux-libre/6.16-riscv.conf \
456 gnu/packages/aux-files/linux-libre/6.16-x86_64.conf \
457 gnu/packages/aux-files/linux-libre/6.16-i686.conf \
458 gnu/packages/aux-files/linux-libre/6.12-arm.conf \
459 gnu/packages/aux-files/linux-libre/6.12-arm64.conf \
460 gnu/packages/aux-files/linux-libre/6.12-i686.conf \
461 gnu/packages/aux-files/linux-libre/6.12-x86_64.conf \
462 gnu/packages/aux-files/linux-libre/6.12-riscv.conf \
463 gnu/packages/aux-files/linux-libre/6.6-arm.conf \
464 gnu/packages/aux-files/linux-libre/6.6-arm64.conf \
465 gnu/packages/aux-files/linux-libre/6.6-i686.conf \
466 gnu/packages/aux-files/linux-libre/6.6-x86_64.conf \
467 gnu/packages/aux-files/linux-libre/6.1-arm.conf \
468 gnu/packages/aux-files/linux-libre/6.1-arm64.conf \
469 gnu/packages/aux-files/linux-libre/6.1-i686.conf \
470 gnu/packages/aux-files/linux-libre/6.1-x86_64.conf \
471 gnu/packages/aux-files/linux-libre/5.15-arm.conf \
472 gnu/packages/aux-files/linux-libre/5.15-arm64.conf \
473 gnu/packages/aux-files/linux-libre/5.15-i686.conf \
474 gnu/packages/aux-files/linux-libre/5.15-x86_64.conf \
475 gnu/packages/aux-files/linux-libre/5.10-arm.conf \
476 gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
477 gnu/packages/aux-files/linux-libre/5.10-i686.conf \
478 gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
479 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
480 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
481 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
482 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
483 gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json \
484 gnu/packages/aux-files/pack-audit.c \
485 gnu/packages/aux-files/python/sanity-check.py \
486 gnu/packages/aux-files/python/sitecustomize.py \
487 gnu/packages/aux-files/renpy/renpy.in \
488 gnu/packages/aux-files/run-in-namespace.c \
489 gnu/packages/aux-files/xml/patch-catalog-xml.xsl \
490 gnu/packages/aux-files/xml/docbook-xml/catalog-4.1.2.xml
491
492# Templates, examples.
493EXAMPLES = \
494 gnu/system/examples/asus-c201.tmpl \
495 gnu/system/examples/bare-bones.tmpl \
496 gnu/system/examples/bare-hurd.tmpl \
497 gnu/system/examples/bare-hurd64.tmpl \
498 gnu/system/examples/beaglebone-black.tmpl \
499 gnu/system/examples/desktop.tmpl \
500 gnu/system/examples/devel-hurd64.tmpl \
501 gnu/system/examples/devel-hurd.tmpl \
502 gnu/system/examples/lightweight-desktop.tmpl \
503 gnu/system/examples/docker-image.tmpl \
504 gnu/system/examples/plasma.tmpl \
505 gnu/system/examples/raspberry-pi-64.tmpl \
506 gnu/system/examples/raspberry-pi-64-nfs-root.tmpl \
507 gnu/system/examples/vm-image.tmpl
508
509GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
510
511nobase_dist_guilemodule_DATA = \
512 guix/d3.v3.js \
513 guix/graph.js \
514 guix/store/schema.sql \
515 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
516 $(MISC_DISTRO_FILES)
517nobase_nodist_guilemodule_DATA = guix/config.scm
518nobase_nodist_guileobject_DATA = $(GOBJECTS)
519
520# Handy way to remove the .go files without removing all the rest.
521clean-go:
522 -$(RM) -f $(GOBJECTS)
523 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
524 if test -t 1; then \
525 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
526 else \
527 xargs -r echo "warning: stray .go files:"; \
528 fi
529
530
531# Test extensions; has to be unconditional.
532TEST_EXTENSIONS = .scm .sh
533
534if CAN_RUN_TESTS
535
536SCM_TESTS = \
537 tests/accounts.scm \
538 tests/base16.scm \
539 tests/base32.scm \
540 tests/base64.scm \
541 tests/boot-parameters.scm \
542 tests/bournish.scm \
543 tests/builders.scm \
544 tests/build-emacs-utils.scm \
545 tests/build-utils.scm \
546 tests/cache.scm \
547 tests/challenge.scm \
548 tests/channels.scm \
549 tests/combinators.scm \
550 tests/containers.scm \
551 tests/cpio.scm \
552 tests/cve.scm \
553 tests/debug-link.scm \
554 tests/derivations.scm \
555 tests/discovery.scm \
556 tests/file-systems.scm \
557 tests/gexp.scm \
558 tests/git.scm \
559 tests/git-authenticate.scm \
560 tests/glob.scm \
561 tests/gnu-maintenance.scm \
562 tests/grafts.scm \
563 tests/graph.scm \
564 tests/gremlin.scm \
565 tests/import/composer.scm \
566 tests/import/cpan.scm \
567 tests/import/cran.scm \
568 tests/import/crate.scm \
569 tests/import/egg.scm \
570 tests/import/elm.scm \
571 tests/import/elpa.scm \
572 tests/import/gem.scm \
573 tests/import/git.scm \
574 tests/import/github.scm \
575 tests/import/hackage.scm \
576 tests/import/hexpm.scm \
577 tests/import/luanti.scm \
578 tests/import/npm-binary.scm \
579 tests/import/opam.scm \
580 tests/import/print.scm \
581 tests/import/pypi.scm \
582 tests/import/texlive.scm \
583 tests/import/utils.scm \
584 tests/home-import.scm \
585 tests/home-services.scm \
586 tests/http-client.scm \
587 tests/inferior.scm \
588 tests/ipfs.scm \
589 tests/lint.scm \
590 tests/modules.scm \
591 tests/monads.scm \
592 tests/nar.scm \
593 tests/networking.scm \
594 tests/openpgp.scm \
595 tests/packages.scm \
596 tests/pack.scm \
597 tests/pki.scm \
598 tests/processes.scm \
599 tests/profiles.scm \
600 tests/publish.scm \
601 tests/read-print.scm \
602 tests/records.scm \
603 tests/rpm.scm \
604 tests/scripts.scm \
605 tests/search-paths.scm \
606 tests/services.scm \
607 tests/services/file-sharing.scm \
608 tests/services/configuration.scm \
609 tests/services/lightdm.scm \
610 tests/services/linux.scm \
611 tests/services/pam-mount.scm \
612 tests/services/telephony.scm \
613 tests/services/vpn.scm \
614 tests/sets.scm \
615 tests/size.scm \
616 tests/status.scm \
617 tests/store-database.scm \
618 tests/store-deadlock.scm \
619 tests/store-deduplication.scm \
620 tests/store-roots.scm \
621 tests/store.scm \
622 tests/substitute.scm \
623 tests/swh.scm \
624 tests/syscalls.scm \
625 tests/system.scm \
626 tests/style.scm \
627 tests/toml.scm \
628 tests/transformations.scm \
629 tests/ui.scm \
630 tests/union.scm \
631 tests/upstream.scm \
632 tests/utils.scm \
633 tests/uuid.scm \
634 tests/workers.scm
635
636if HAVE_GUILE_LIB
637SCM_TESTS += tests/import/go.scm
638else
639EXTRA_DIST += tests/import/go.scm
640endif
641
642if HAVE_GUILE_SSH
643SCM_TESTS += tests/machine/hetzner.scm \
644 tests/machine/hetzner/http.scm
645else
646EXTRA_DIST += tests/machine/hetzner.scm \
647 tests/machine/hetzner/http.scm
648endif
649
650if BUILD_DAEMON_OFFLOAD
651SCM_TESTS += tests/offload.scm
652else
653EXTRA_DIST += tests/offload.scm
654endif
655
656SH_TESTS = \
657 tests/guix-build.sh \
658 tests/guix-build-branch.sh \
659 tests/guix-download.sh \
660 tests/guix-gc.sh \
661 tests/guix-git-authenticate.sh \
662 tests/guix-hash.sh \
663 tests/guix-locate.sh \
664 tests/guix-pack.sh \
665 tests/guix-pack-localstatedir.sh \
666 tests/guix-pack-relocatable.sh \
667 tests/guix-package.sh \
668 tests/guix-package-aliases.sh \
669 tests/guix-package-net.sh \
670 tests/guix-style.sh \
671 tests/guix-system.sh \
672 tests/guix-home.sh \
673 tests/guix-archive.sh \
674 tests/guix-authenticate.sh \
675 tests/guix-environment.sh \
676 tests/guix-environment-container.sh \
677 tests/guix-refresh.sh \
678 tests/guix-shell.sh \
679 tests/guix-shell-export-manifest.sh \
680 tests/guix-time-machine.sh \
681 tests/guix-graph.sh \
682 tests/guix-describe.sh \
683 tests/guix-repl.sh \
684 tests/guix-lint.sh
685
686TESTS = $(SCM_TESTS) $(SH_TESTS)
687
688AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
689
690SCM_LOG_DRIVER = \
691 $(top_builddir)/test-env --quiet-stderr \
692 $(GUILE) --no-auto-compile -e main \
693 $(top_srcdir)/build-aux/test-driver.scm
694
695AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
696
697SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
698AM_SH_LOG_FLAGS = -x -e
699
700# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
701# could end up removing files from the store while they are being used by
702# other instances of the daemon.
703tests/guix-gc.log: \
704 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
705 $(SCM_TESTS:%.scm=%.log)
706
707else !CAN_RUN_TESTS
708
709TESTS =
710SH_TESTS =
711SCM_TESTS =
712
713# Automake always generates a 'check' target, so better not override it.
714check-local:
715 @echo
716 @echo "Cannot run tests because file name limits would be exceeded." >&2
717 @echo "Look for 'length' in the 'config.log' file for details." >&2
718 @echo
719 @exit 1
720
721endif !CAN_RUN_TESTS
722
723check-system: $(GOBJECTS)
724 $(AM_V_at)$(top_builddir)/pre-inst-env \
725 guix repl -- $(top_srcdir)/build-aux/run-system-tests.scm -K
726
727# Public keys used to sign substitutes.
728dist_pkgdata_DATA = \
729 etc/substitutes/berlin.guix.gnu.org.pub \
730 etc/substitutes/ci.guix.gnu.org.pub \
731 etc/substitutes/ci.guix.info.pub \
732 etc/substitutes/bordeaux.guix.gnu.org.pub
733
734# Bash completion file.
735dist_bashcompletion_DATA = etc/completion/bash/guix \
736 etc/completion/bash/guix-daemon
737
738# Zsh completion file.
739dist_zshcompletion_DATA = etc/completion/zsh/_guix
740
741# Fish completion file.
742dist_fishcompletion_DATA = etc/completion/fish/guix.fish
743
744# SELinux policy
745nodist_selinux_policy_DATA = etc/guix-daemon.cil
746
747EXTRA_DIST += \
748 .dir-locals.el \
749 .guix-authorizations \
750 .guix-channel \
751 CODE-OF-CONDUCT \
752 HACKING \
753 ROADMAP \
754 TODO \
755 bootstrap \
756 manifest.scm \
757 build-aux/build-self.scm \
758 build-aux/check-channel-news.scm \
759 build-aux/check-final-inputs-self-contained.scm \
760 build-aux/compile-all.scm \
761 build-aux/compile-as-derivation.scm \
762 build-aux/config.rpath \
763 build-aux/convert-xref.scm \
764 build-aux/extract-syscall-ranges.sh \
765 build-aux/generate-authors.scm \
766 build-aux/git-version-gen \
767 build-aux/mdate-from-git.scm \
768 build-aux/test-driver.scm \
769 build-aux/update-NEWS.scm \
770 build-aux/update-guix-package.scm \
771 build-aux/xgettext.scm \
772 doc/build.scm \
773 etc/guix-install.sh \
774 etc/historical-authorizations \
775 etc/news.scm \
776 etc/teams.scm \
777 etc/manifests/disarchive.scm \
778 etc/manifests/hurd.scm \
779 etc/manifests/kernels.scm \
780 etc/manifests/release.scm \
781 etc/manifests/source.scm \
782 etc/manifests/system-tests.scm \
783 etc/manifests/time-travel.scm \
784 etc/manifests/ungraft.scm \
785 etc/manifests/upgrade.scm \
786 scripts/guix.in \
787 tests/cve-sample.json \
788 tests/keys/civodul.pub \
789 tests/keys/dsa.pub \
790 tests/keys/ed25519-2.pub \
791 tests/keys/ed25519-2.sec \
792 tests/keys/ed25519-3.pub \
793 tests/keys/ed25519-3.sec \
794 tests/keys/ed25519.pub \
795 tests/keys/ed25519.sec \
796 tests/keys/rsa.pub \
797 tests/keys/signing-key.pub \
798 tests/keys/signing-key.sec \
799 tests/test.drv \
800 $(TESTS)
801
802if !BUILD_DAEMON_OFFLOAD
803
804EXTRA_DIST += \
805 guix/scripts/offload.scm
806
807endif !BUILD_DAEMON_OFFLOAD
808
809
810CLEANFILES = \
811 $(bin_SCRIPTS) \
812 $(GOBJECTS) \
813 $(SCM_TESTS:tests/%.scm=%.log)
814
815# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
816# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
817# there that are newer than the local .scm files (for instance because the
818# user ran 'make install' recently). When that happens, we end up loading
819# those previously-installed .go files, which may be stale, thereby breaking
820# the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
821# stale files from ~/.cache/guile/ccache.
822%.go: make-go ; @:
823make-go: make-core-go make-packages-go make-system-go make-cli-go
824
825# Define a rule to build a subset of the .go files.
826define guile-compilation-rule
827
828$(1): $(2)
829 $(AM_V_at)echo "Compiling Scheme modules..." ; \
830 unset GUILE_LOAD_COMPILED_PATH ; \
831 XDG_CACHE_HOME=/nowhere \
832 host="$(4)" srcdir="$(top_srcdir)" \
833 $(top_builddir)/pre-inst-env \
834 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
835 --no-auto-compile \
836 -s "$(top_srcdir)"/build-aux/compile-all.scm \
837 --total $(words $(MODULES)) \
838 --completed $(3) \
839 $$(filter %.scm,$$^)
840
841endef
842
843# Split compilation in several steps, each of which building a subset of
844# $(MODULES). The main goal is to reduce peak memory consumption, as reported
845# in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
846# 'make-*-go' phony target that builds the corresponding subset.
847
848first_fifth := \
849 gnu/packages/a% gnu/packages/b% gnu/packages/c%
850
851second_fifth := \
852 gnu/packages/d% gnu/packages/e% gnu/packages/f%
853
854third_fifth := \
855 gnu/packages/g% gnu/packages/h% gnu/packages/i%
856
857fourth_fifth := \
858 gnu/packages/j% gnu/packages/k% gnu/packages/l% gnu/packages/m% \
859 gnu/packages/n% gnu/packages/o%
860
861MODULES_CORE := guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
862MODULES_PACKAGES1 := $(filter $(first_fifth),$(MODULES))
863MODULES_PACKAGES2 := $(filter $(second_fifth),$(MODULES))
864MODULES_PACKAGES3 := $(filter $(third_fifth),$(MODULES))
865MODULES_PACKAGES4 := $(filter $(fourth_fifth),$(MODULES))
866MODULES_PACKAGES5 := $(filter-out $(first_fifth) $(second_fifth) \
867 $(third_fifth) $(fourth_fifth), \
868 $(filter gnu/packages/%,$(MODULES)))
869MODULES_PACKAGES := $(MODULES_PACKAGES1) $(MODULES_PACKAGES2) \
870 $(MODULES_PACKAGES3) $(MODULES_PACKAGES4) \
871 $(MODULES_PACKAGES5)
872MODULES_SYSTEM := gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
873MODULES_CLI := $(filter guix/scripts/%,$(MODULES))
874MODULES_PO := guix/build/po.scm
875
876$(eval $(call guile-compilation-rule,make-core-go, \
877 $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
878 0,$(host)))
879.PHONY: make-core-go
880
881$(eval $(call guile-compilation-rule,make-packages1-go, \
882 $(MODULES_PACKAGES1) make-core-go, \
883 $(words $(MODULES_CORE)),$(host)))
884.PHONY: make-packages1-go
885
886$(eval $(call guile-compilation-rule,make-packages2-go, \
887 $(MODULES_PACKAGES2) make-core-go make-packages1-go, \
888 $(words $(MODULES_CORE) $(MODULES_PACKAGES1)),$(host)))
889.PHONY: make-packages2-go
890
891$(eval $(call guile-compilation-rule,make-packages3-go, \
892 $(MODULES_PACKAGES3) make-core-go make-packages1-go make-packages2-go, \
893 $(words $(MODULES_CORE) $(MODULES_PACKAGES1) $(MODULES_PACKAGES2)),$(host)))
894.PHONY: make-packages3-go
895
896$(eval $(call guile-compilation-rule,make-packages4-go, \
897 $(MODULES_PACKAGES4) make-core-go make-packages1-go make-packages2-go \
898 make-packages3-go, \
899 $(words $(MODULES_CORE) $(MODULES_PACKAGES1) $(MODULES_PACKAGES2) \
900 $(MODULES_PACKAGES3)),$(host)))
901.PHONY: make-packages4-go
902
903$(eval $(call guile-compilation-rule,make-packages5-go, \
904 $(MODULES_PACKAGES5) make-core-go make-packages1-go make-packages2-go \
905 make-packages3-go make-packages4-go, \
906 $(words $(MODULES_CORE) $(MODULES_PACKAGES1) $(MODULES_PACKAGES2) \
907 $(MODULES_PACKAGES3) $(MODULES_PACKAGES4)),$(host)))
908.PHONY: make-packages5-go
909
910make-packages-go: make-packages1-go make-packages2-go \
911 make-packages3-go make-packages4-go make-packages5-go
912.PHONY: make-packages-go
913
914$(eval $(call guile-compilation-rule,make-system-go, \
915 $(MODULES_SYSTEM) make-packages-go make-core-go, \
916 $(words $(MODULES_CORE) $(MODULES_PACKAGES)),$(host)))
917.PHONY: make-system-go
918
919$(eval $(call guile-compilation-rule,make-cli-go, \
920 $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
921 $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM)),$(host)))
922.PHONY: make-cli-go
923
924$(eval $(call guile-compilation-rule,guix/build/po.go, \
925 $(MODULES_PO), \
926 0,$(build)))
927
928SUFFIXES = .go
929
930# Make sure source files are installed first, so that the mtime of
931# installed compiled files is greater than that of installed source
932# files. See
933# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
934# for details.
935guix_install_go_files = install-nobase_nodist_guileobjectDATA
936$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
937
938# The above trick doesn't work for 'config.go' because both 'config.scm' and
939# 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
940# special treatment.
941install-data-hook:
942 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
943
944# Assuming Guix is already installed and the daemon is up and running, this
945# rule builds from $(srcdir), creating and building derivations.
946as-derivation:
947 $(AM_V_at)echo "Building Guix in Guix..." ; \
948 $(GUILE) --no-auto-compile \
949 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
950 "$(abs_top_srcdir)"
951
952SUBDIRS = po/guix po/packages
953BUILT_SOURCES =
954
955include doc/local.mk
956
957if BUILD_DAEMON
958
959include nix/local.mk
960
961endif BUILD_DAEMON
962
963ACLOCAL_AMFLAGS = -I m4
964
965# Pass an explicit '--localstatedir' so that configure does not error out if
966# it finds an existing installation with a different localstatedir. Inherit
967# 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
968# repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
969# enough for shebangs.
970AM_DISTCHECK_CONFIGURE_FLAGS = \
971 --localstatedir="$$dc_install_base/var" \
972 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
973 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
974 --enable-daemon \
975 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
976
977# The self-contained tarball.
978guix-binary.%.tar.xz:
979 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
980 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
981 --fallback \
982 -s "$*" --localstatedir --profile-name=current-guix \
983 guix` ; \
984 cp "$$tarball" "[email protected]" ; mv "[email protected]" "$@"
985
986# The `dist' target has other dependencies when building from Git
987# to assert and achieve reproducibility.
988if in_git_p
989
990# The dependency on dist-doc-pot-update is to clean possibly stale doc and po
991# files and only then generate the .pot files, which are not checked in.
992dist: dist-doc-pot-update
993dist-doc-pot-update: auto-clean
994 $(MAKE) guile$(EXEEXT)
995 $(MAKE) -C po/guix all
996 $(MAKE) -C po/packages all
997 $(MAKE) doc-pot-update
998
999dist-hook: gen-ChangeLog gen-AUTHORS
1000
1001# Assert that Autotools cache is up to date with Git, by checking
1002# PACKAGE_VERSION against HEAD. Indented to get past Automake.
1003 ifeq ($(MAKECMDGOALS),dist)
1004 git_version = $(shell build-aux/git-version-gen .tarball-version)
1005 ifneq ($(PACKAGE_VERSION),$(git_version))
1006 $(warning Autotools cache out of date.)
1007 $(info Autotools cache version: $(PACKAGE_VERSION).)
1008 $(info Git version: $(git_version).)
1009 $(info Please run ./bootstrap && ./configure $(DIST_CONFIGURE_FLAGS))
1010 ifneq ($(GUIX_ALLOW_IRREPRODUCIBLE_TARBALL),yes)
1011 $(error Cannot create reproducible tarball)
1012 else
1013 $(warning Tarball will be irreproducible; distdir will not get removed!)
1014 endif # !GUIX_ALLOW_IRREPRODUCIBLE_TARBALL
1015 endif # PACKAGE_VERSION != git_version
1016 endif # MAKECMDGOALS dist
1017
1018else # !in_git_p
1019
1020dist: doc-pot-update
1021
1022 ifeq ($(MAKECMDGOALS),dist)
1023$(warning Not using Git, tarball will likely be irreproducible!)
1024 endif # MAKECMDGOALS dist
1025endif # !in_git_p
1026
1027dist-hook: gen-tarball-version
1028dist-hook: assert-no-store-file-names
1029
1030distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
1031
1032EXTRA_DIST += $(top_srcdir)/.version
1033BUILT_SOURCES += $(top_srcdir)/.version
1034$(top_srcdir)/.version: config.status
1035 $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
1036
1037gen-tarball-version:
1038 echo $(VERSION) > "$(distdir)/.tarball-version"
1039 echo $(SOURCE_DATE_EPOCH) > $(distdir)/.tarball-timestamp
1040
1041gen-ChangeLog:
1042 $(AM_V_GEN)set -e; \
1043 export LC_ALL=en_US.UTF-8; \
1044 export TZ=UTC0; \
1045 $(top_srcdir)/build-aux/gitlog-to-changelog \
1046 > $(distdir)/ChangeLog.tmp; \
1047 rm -f $(distdir)/ChangeLog; \
1048 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog;
1049
1050gen-AUTHORS:
1051 $(AM_V_GEN)set -e; \
1052 rm -f "$(distdir)/AUTHORS"; \
1053 export LC_ALL=en_US.UTF-8; \
1054 export TZ=UTC0; \
1055 $(top_builddir)/pre-inst-env "$(GUILE)" \
1056 "$(top_srcdir)/build-aux/generate-authors.scm" \
1057 "$(top_srcdir)" "$(distdir)/AUTHORS";
1058
1059# Like 'dist', but regenerate 'configure' so we get an up-to-date
1060# 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
1061# do that whenever a 'dist' target is used.)
1062dist-with-updated-version:
1063 @echo "Running './bootstrap' for new version string..."
1064 $(top_srcdir)/bootstrap
1065 $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
1066
1067.PHONY: dist-with-updated-version
1068
1069
1070#
1071# Release management.
1072#
1073
1074# Reproducible tarball
1075override GZIP_ENV = --best --no-name
1076# Be friendly to Debian; avoid using EPOCH
1077override am__tar = $${TAR-tar} \
1078 --format=ustar \
1079 --sort=name \
1080 --mode=go=rX,u+rw,a-s \
1081 --mtime=@$$(cat "$$tardir"/.tarball-timestamp) \
1082 --owner=0 --group=0 --numeric-owner \
1083 -cf - \
1084 "$$tardir"
1085
1086releasedir = release-$(PACKAGE_VERSION)
1087
1088PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
1089
1090# List of source tarballs produced. This must be kept in sync with the
1091# 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
1092SOURCE_TARBALLS = \
1093 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
1094
1095# Systems supported by Guix.
1096SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
1097 powerpc64le-linux riscv64-linux
1098
1099# Guix binary tarballs.
1100BINARY_TARBALLS = \
1101 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
1102
1103# Systems supported by the Guix System installer.
1104# A Hurd install happens from a Linux installer image.
1105GUIX_SYSTEM_INSTALLER_SYSTEMS ?= x86_64-linux i686-linux
1106
1107# Systems for which we build Guix VMs.
1108GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
1109
1110# Prefix of the Guix installation image file name.
1111GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
1112
1113# Prefix of the Guix VM image file name.
1114GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
1115
1116# Flags for 'guix system vm-image'. By default create a VM image that appears
1117# to have a 20G hard disk.
1118GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
1119
1120# Return the sequence of '-s' flags for the given systems.
1121system_flags = $(foreach system,$(1),-s $(system))
1122
1123# The release process works in several phases:
1124#
1125# 0. We assume the developer created a 'vX.Y.Z' tag.
1126# 1. Build the source tarball.
1127# 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
1128# 3. Build the binary tarballs for that 'guix' package.
1129# 4. Update the 'guix' package again.
1130# 5. Build the installation and VM images. The images will run 'guix'
1131# corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
1132#
1133# This 'release' target takes care of everything and copies the resulting
1134# files to $(releasedir).
1135#
1136# XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
1137# issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
1138release: dist-with-updated-version all
1139 @if ! git diff-index --quiet HEAD; then \
1140 echo "There are uncommitted changes; stopping." >&2 ; \
1141 exit 1 ; \
1142 fi
1143 $(MKDIR_P) "$(releasedir)"
1144 rm -f "$(releasedir)"/*
1145 mv $(SOURCE_TARBALLS) "$(releasedir)"
1146# Bump the Guix package version and build it.
1147 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
1148 $(top_builddir)/pre-inst-env "$(GUILE)" \
1149 $(top_srcdir)/build-aux/update-guix-package.scm \
1150 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
1151 git add $(top_srcdir)/gnu/packages/package-management.scm
1152 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
1153 $(top_builddir)/pre-inst-env guix build guix \
1154 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
1155 -v1 --no-grafts --fallback
1156# Generate the binary release tarballs.
1157 rm -f $(BINARY_TARBALLS)
1158 $(MAKE) $(BINARY_TARBALLS)
1159 for system in $(SUPPORTED_SYSTEMS) ; do \
1160 mv "guix-binary.$$system.tar.xz" \
1161 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
1162 done
1163# Build 'current-guix' to speed things up for the next step.
1164 $(top_builddir)/pre-inst-env guix build \
1165 -e '((@ (gnu packages package-management) current-guix))' \
1166 $(call system_flags,$(GUIX_SYSTEM_INSTALLER_SYSTEMS)) \
1167 -v1 --no-grafts --fallback
1168# Generate the ISO installation images.
1169 for system in $(GUIX_SYSTEM_INSTALLER_SYSTEMS) ; do \
1170 GUIX_DISPLAYED_VERSION="`git describe --match=v* | sed -'es/^v//'`" ; \
1171 image=`$(top_builddir)/pre-inst-env \
1172 guix system image -t iso9660 \
1173 --label="GUIX_$${system}_$(VERSION)" \
1174 --system=$$system --fallback \
1175 gnu/system/install.scm` ; \
1176 if [ ! -f "$$image" ] ; then \
1177 echo "failed to produce Guix installation image for $$system" >&2 ; \
1178 exit 1 ; \
1179 fi ; \
1180 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
1181 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
1182 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
1183 done
1184# Generate the VM images.
1185 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
1186 GUIX_DISPLAYED_VERSION="`git describe --match=v* | sed -'es/^v//'`" ; \
1187 image=`$(top_builddir)/pre-inst-env \
1188 guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
1189 --save-provenance \
1190 --system=$$system --fallback \
1191 gnu/system/examples/vm-image.tmpl` ; \
1192 if [ ! -f "$$image" ] ; then \
1193 echo "failed to produce Guix VM image for $$system" >&2 ; \
1194 exit 1 ; \
1195 fi ; \
1196 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
1197 done
1198 @echo
1199 @echo "Congratulations! All the release files are now in $(releasedir)."
1200 @echo
1201
1202update-guix-package:
1203 git rev-parse HEAD
1204 $(top_builddir)/pre-inst-env "$(GUILE)" \
1205 $(top_srcdir)/build-aux/update-guix-package.scm \
1206 "`git rev-parse HEAD`"
1207
1208# Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
1209# Package data from this checkout is used by 'update-NEWS.scm'.
1210GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
1211
1212update-NEWS: $(GOBJECTS)
1213 $(top_builddir)/pre-inst-env "$(GUILE)" \
1214 $(top_srcdir)/build-aux/update-NEWS.scm \
1215 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
1216
1217# Make sure we're not shipping a file that embeds a local /gnu/store file name.
1218assert-no-store-file-names:
1219 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
1220 --exclude=*.info-[0-9] --exclude=*.dot \
1221 --exclude=*.eps --exclude-dir=bootstrap \
1222 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
1223 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
1224 --exclude=guix-prettify.el \
1225 --exclude=ChangeLog* \
1226 --exclude=binutils-boot-2.20*.patch \
1227 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
1228 then \
1229 echo "error: store file names embedded in the distribution" >&2 ; \
1230 exit 1 ; \
1231 fi
1232
1233# Make sure installer substitutes are available. Check only the primary
1234# server so that '--display-missing' doesn't print two lists.
1235assert-binaries-available: $(GOBJECTS)
1236 $(AM_V_at)$(top_builddir)/pre-inst-env \
1237 guix weather -m "$(top_srcdir)/etc/manifests/release.scm" \
1238 --substitute-urls="https://ci.guix.gnu.org" \
1239 --display-missing
1240
1241# Make sure the final inputs don't refer to bootstrap tools.
1242assert-final-inputs-self-contained: $(GOBJECTS)
1243 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1244 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
1245
1246# Validate channel news.
1247check-channel-news: $(GOBJECTS)
1248 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1249 "$(top_srcdir)/build-aux/check-channel-news.scm"
1250
1251# Compute the Cuirass jobs.
1252cuirass-jobs: $(GOBJECTS)
1253 rm -rf "$@"
1254 $(AM_V_at)$(MKDIR_P) "$@"
1255 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
1256 "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
1257
1258.PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
1259.PHONY: assert-no-store-file-names assert-binaries-available
1260.PHONY: assert-final-inputs-self-contained check-channel-news
1261.PHONY: clean-go make-go as-derivation
1262.PHONY: update-guix-package update-NEWS cuirass-jobs release
1263
1264# Git auto-configuration.
1265.git/hooks/:
1266 $(AM_V_at)if test -d .git; then \
1267 mkdir "$@"; \
1268 fi
1269
1270.git/hooks/%: etc/git/% | .git/hooks/
1271 $(AM_V_at)if test -d .git; then \
1272 cp "$<" "$@"; \
1273 fi
1274
1275.git/config: etc/git/gitconfig
1276 $(AM_V_at)if command -v git >/dev/null && test -d .git; then \
1277 git config --fixed-value --replace-all include.path \
1278 ../etc/git/gitconfig ../etc/git/gitconfig; \
1279 fi
1280
1281COMMIT_MSG_MAGIC = VGhpcyBpcyB0aGUgY29tbWl0LW1zZyBob29rIG9mIEd1aXg=
1282.git/hooks/commit-msg: etc/git/commit-msg | .git/hooks/
1283 $(AM_V_at)if test -d .git; then \
1284 if test -f $@ && ! grep -qF $(COMMIT_MSG_MAGIC) $@; then \
1285 mkdir -p [email protected] && mv $@ [email protected] && \
1286 @ echo user commit-msg hook moved to [email protected]/commit-msg; \
1287 fi; \
1288 cp etc/git/commit-msg $@; \
1289 fi
1290
1291# The etc/git/ config files are not distributed and have no use when building
1292# from a tarball. Do not add dependencies on these to *_DATA when building
1293# from a tarball, as that breaks the build.
1294if in_git_p
1295nodist_noinst_DATA = \
1296 .git/hooks/pre-push \
1297 .git/hooks/post-merge \
1298 .git/config \
1299 .git/hooks/commit-msg
1300endif
1301
1302# Downloading up-to-date PO files.
1303
1304WEBLATE_REPO = https://codeberg.org/guix/translations
1305
1306# Shallow clone the Git repository behind Weblate and copy files from it if
1307# they contain at least one translation, and they are well-formed (Scheme
1308# format only), warn otherwise. Copied files are converted to a canonical
1309# form. Note: The files will be minified to reduce file size, except the
1310# guix domain, because they are comparatively small and it would need more
1311# comprehensive PO file parsing abilities for plural forms.
1312download-po: guix/build/po.go
1313 dir=$$(mktemp -d); \
1314 git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations" && \
1315 for domain in po/doc po/guix po/packages; do \
1316 for po in "$$dir/translations/$$domain"/*.po; do \
1317 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1318 untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \
1319 untranslated=$${untranslated:-0}; \
1320 total=$$(($$translated+$$untranslated)); \
1321 target=$$(basename "$$po"); \
1322 target="$$domain/$$target"; \
1323 msgfmt -c "$$po"; \
1324 if msgfmt -c "$$po" && [ "$$translated" != "0" ] && ([ "$$domain" != "po/doc" ] || [ "$$translated" -gt $$(($$total/10)) ] || [ -f $$target ]); then \
1325 if [ "$$domain" != "po/guix" ]; then \
1326 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
1327 --no-auto-compile \
1328 -s "$(top_srcdir)"/build-aux/keep-only-translated.scm \
1329 "$$po" > "$$po".tmp; \
1330 else ln -s "$$po" "$$po".tmp; fi; \
1331 msgconv --no-wrap -o "$$po".tmp2 "$$po".tmp; \
1332 rm "$$po".tmp; \
1333 mv "$$po".tmp2 "$$target"; \
1334 echo "copied $$target."; \
1335 else \
1336 echo "WARN: $$target ($$translated translated messages ($$((translated/total*100))%)) was not added/updated."; \
1337 fi; \
1338 done; \
1339 done; \
1340 for po in po/doc/*.po; do \
1341 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1342 untranslated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | rev | cut -f3 -d' ' | rev); \
1343 untranslated=$${untranslated:-0}; \
1344 total=$$(($$translated + $$untranslated)); \
1345 if [ "$$translated" -lt "$$(($$total/20))" ]; then \
1346 echo "WARN: $$po was removed because it is below the 5% threshold: $$((translated/total*100))%"; \
1347 rm $$po; \
1348 fi; \
1349 done; \
1350 rm -rf "$$dir"
1351.PHONY: download-po
1352
1353# Regenerate 'CODEOWNERS' when 'teams.scm' is modified so we don't forget.
1354if in_git_p
1355if !CROSS_COMPILING
1356CODEOWNERS: etc/teams.scm scripts/guix
1357 ./etc/teams.scm codeowners > "[email protected]"
1358 mv "[email protected]" "$@"
1359
1360BUILT_SOURCES += CODEOWNERS
1361endif
1362endif
1363## -------------- ##
1364## Silent rules. ##
1365## -------------- ##
1366
1367AM_V_DL = $(AM_V_DL_$(V))
1368AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
1369AM_V_DL_0 = @echo " DL " $@;
1370
1371AM_V_DOT = $(AM_V_DOT_$(V))
1372AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
1373AM_V_DOT_0 = @echo " DOT " $@;
1374
1375AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
1376AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
1377AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
1378
1379AM_V_PO4A = $(AM_V_PO4A_$(V))
1380AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
1381AM_V_PO4A_0 = @echo " PO4A " $@;
1382
1383AM_V_POXREF = $(AM_V_POXREF_$(V))
1384AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
1385AM_V_POXREF_0 = @echo " POXREF " $@;