projects/guix·blob a04b886f · refs

1417 lines · 47.0 KiB

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