projects/guix·blob add-tests-for-guix-shell-container · refs

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