projects/guix·blob ruby-team · refs

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