projects/guix·blob wip-riscv-bootstrap1 · refs

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