Merge remote-tracking branch 'origin/master' into core-updates-frozen
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
7 # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
8 # Copyright © 2017 Leo Famulari <leo@famulari.name>
9 # Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
10 # Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
11 # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
12 # Copyright © 2018 Nikita <nikita@n0.is>
13 # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
14 # Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
15 # Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
16 # Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
17 # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
18 # Copyright © 2021 Andrew Tropin <andrew@trop.in>
19 #
20 # This file is part of GNU Guix.
21 #
22 # GNU Guix is free software; you can redistribute it and/or modify it
23 # under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 3 of the License, or (at
25 # your option) any later version.
26 #
27 # GNU Guix is distributed in the hope that it will be useful, but
28 # WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
31 #
32 # You should have received a copy of the GNU General Public License
33 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 MSGMERGE_UPDATE = @MSGMERGE@ --update
36
37 bin_SCRIPTS = scripts/guix
38
39 # Handle substitution of fully-expanded Autoconf variables.
40 do_subst = $(SED) \
41 -e 's,[@]GUILE[@],$(GUILE),g' \
42 -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
43 -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
44 -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
45 -e 's,[@]localedir[@],$(localedir),g'
46
47 scripts/guix: scripts/guix.in Makefile
48 $(AM_V_at)rm -f $@ $@-t
49 $(AM_V_at)$(MKDIR_P) "$(@D)"
50 $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
51 $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
52
53 # This is our variant of the 'guile' executable, one that doesn't complain
54 # about locales.
55 pkglibexec_PROGRAMS = guile
56 guile_SOURCES = gnu/packages/aux-files/guile-launcher.c
57 guile_LDADD = $(GUILE_LIBS)
58 guile_CFLAGS = $(GUILE_CFLAGS)
59
60 # Have the 'guix' command refer to our 'guile'.
61 install-exec-hook:
62 $(SED) -i "$(DESTDIR)$(bindir)/guix" \
63 -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g'
64
65 nodist_noinst_SCRIPTS = \
66 pre-inst-env \
67 test-env
68
69 # Modules that are not compiled but are installed nonetheless, such as
70 # build-side modules with unusual dependencies.
71 MODULES_NOT_COMPILED = \
72 guix/build/po.scm \
73 guix/man-db.scm
74
75 include gnu/local.mk
76 include po/doc/local.mk
77
78 MODULES = \
79 guix/base16.scm \
80 guix/base32.scm \
81 guix/base64.scm \
82 guix/ci.scm \
83 guix/cpio.scm \
84 guix/deprecation.scm \
85 guix/docker.scm \
86 guix/records.scm \
87 guix/openpgp.scm \
88 guix/pki.scm \
89 guix/progress.scm \
90 guix/combinators.scm \
91 guix/memoization.scm \
92 guix/utils.scm \
93 guix/sets.scm \
94 guix/modules.scm \
95 guix/download.scm \
96 guix/discovery.scm \
97 guix/android-repo-download.scm \
98 guix/bzr-download.scm \
99 guix/extracting-download.scm \
100 guix/git-download.scm \
101 guix/hg-download.scm \
102 guix/swh.scm \
103 guix/monads.scm \
104 guix/monad-repl.scm \
105 guix/gexp.scm \
106 guix/profiles.scm \
107 guix/serialization.scm \
108 guix/nar.scm \
109 guix/narinfo.scm \
110 guix/derivations.scm \
111 guix/grafts.scm \
112 guix/repl.scm \
113 guix/transformations.scm \
114 guix/inferior.scm \
115 guix/describe.scm \
116 guix/quirks.scm \
117 guix/channels.scm \
118 guix/gnu-maintenance.scm \
119 guix/self.scm \
120 guix/substitutes.scm \
121 guix/upstream.scm \
122 guix/licenses.scm \
123 guix/lint.scm \
124 guix/glob.scm \
125 guix/git.scm \
126 guix/git-authenticate.scm \
127 guix/graph.scm \
128 guix/cache.scm \
129 guix/cve.scm \
130 guix/workers.scm \
131 guix/ipfs.scm \
132 guix/build-system.scm \
133 guix/build-system/android-ndk.scm \
134 guix/build-system/ant.scm \
135 guix/build-system/cargo.scm \
136 guix/build-system/chicken.scm \
137 guix/build-system/clojure.scm \
138 guix/build-system/cmake.scm \
139 guix/build-system/dub.scm \
140 guix/build-system/dune.scm \
141 guix/build-system/emacs.scm \
142 guix/build-system/font.scm \
143 guix/build-system/go.scm \
144 guix/build-system/meson.scm \
145 guix/build-system/minify.scm \
146 guix/build-system/minetest.scm \
147 guix/build-system/asdf.scm \
148 guix/build-system/copy.scm \
149 guix/build-system/glib-or-gtk.scm \
150 guix/build-system/gnu.scm \
151 guix/build-system/guile.scm \
152 guix/build-system/haskell.scm \
153 guix/build-system/julia.scm \
154 guix/build-system/linux-module.scm \
155 guix/build-system/maven.scm \
156 guix/build-system/node.scm \
157 guix/build-system/perl.scm \
158 guix/build-system/python.scm \
159 guix/build-system/renpy.scm \
160 guix/build-system/ocaml.scm \
161 guix/build-system/qt.scm \
162 guix/build-system/waf.scm \
163 guix/build-system/r.scm \
164 guix/build-system/rakudo.scm \
165 guix/build-system/ruby.scm \
166 guix/build-system/scons.scm \
167 guix/build-system/texlive.scm \
168 guix/build-system/trivial.scm \
169 guix/ftp-client.scm \
170 guix/http-client.scm \
171 guix/gnupg.scm \
172 guix/elf.scm \
173 guix/profiling.scm \
174 guix/store.scm \
175 guix/cvs-download.scm \
176 guix/svn-download.scm \
177 guix/colors.scm \
178 guix/i18n.scm \
179 guix/diagnostics.scm \
180 guix/ui.scm \
181 guix/status.scm \
182 guix/build/android-ndk-build-system.scm \
183 guix/build/ant-build-system.scm \
184 guix/build/download.scm \
185 guix/build/download-nar.scm \
186 guix/build/cargo-build-system.scm \
187 guix/build/cargo-utils.scm \
188 guix/build/chicken-build-system.scm \
189 guix/build/cmake-build-system.scm \
190 guix/build/dub-build-system.scm \
191 guix/build/dune-build-system.scm \
192 guix/build/emacs-build-system.scm \
193 guix/build/meson-build-system.scm \
194 guix/build/minify-build-system.scm \
195 guix/build/font-build-system.scm \
196 guix/build/go-build-system.scm \
197 guix/build/android-repo.scm \
198 guix/build/asdf-build-system.scm \
199 guix/build/bzr.scm \
200 guix/build/copy-build-system.scm \
201 guix/build/git.scm \
202 guix/build/hg.scm \
203 guix/build/glib-or-gtk-build-system.scm \
204 guix/build/gnu-bootstrap.scm \
205 guix/build/gnu-build-system.scm \
206 guix/build/gnu-dist.scm \
207 guix/build/guile-build-system.scm \
208 guix/build/maven-build-system.scm \
209 guix/build/minetest-build-system.scm \
210 guix/build/node-build-system.scm \
211 guix/build/perl-build-system.scm \
212 guix/build/python-build-system.scm \
213 guix/build/ocaml-build-system.scm \
214 guix/build/qt-build-system.scm \
215 guix/build/r-build-system.scm \
216 guix/build/renpy-build-system.scm \
217 guix/build/rakudo-build-system.scm \
218 guix/build/ruby-build-system.scm \
219 guix/build/scons-build-system.scm \
220 guix/build/texlive-build-system.scm \
221 guix/build/waf-build-system.scm \
222 guix/build/haskell-build-system.scm \
223 guix/build/julia-build-system.scm \
224 guix/build/linux-module-build-system.scm \
225 guix/build/store-copy.scm \
226 guix/build/json.scm \
227 guix/build/pack.scm \
228 guix/build/utils.scm \
229 guix/build/union.scm \
230 guix/build/profiles.scm \
231 guix/build/compile.scm \
232 guix/build/cvs.scm \
233 guix/build/svn.scm \
234 guix/build/syscalls.scm \
235 guix/build/gremlin.scm \
236 guix/build/debug-link.scm \
237 guix/build/clojure-build-system.scm \
238 guix/build/clojure-utils.scm \
239 guix/build/emacs-utils.scm \
240 guix/build/java-utils.scm \
241 guix/build/lisp-utils.scm \
242 guix/build/meson-configuration.scm \
243 guix/build/maven/java.scm \
244 guix/build/maven/plugin.scm \
245 guix/build/maven/pom.scm \
246 guix/build/graft.scm \
247 guix/build/bournish.scm \
248 guix/build/qt-utils.scm \
249 guix/build/make-bootstrap.scm \
250 guix/search-paths.scm \
251 guix/packages.scm \
252 guix/import/cabal.scm \
253 guix/import/cpan.scm \
254 guix/import/cran.scm \
255 guix/import/crate.scm \
256 guix/import/egg.scm \
257 guix/import/elpa.scm \
258 guix/import/gem.scm \
259 guix/import/git.scm \
260 guix/import/github.scm \
261 guix/import/gnome.scm \
262 guix/import/gnu.scm \
263 guix/import/go.scm \
264 guix/import/hackage.scm \
265 guix/import/json.scm \
266 guix/import/kde.scm \
267 guix/import/launchpad.scm \
268 guix/import/minetest.scm \
269 guix/import/opam.scm \
270 guix/import/print.scm \
271 guix/import/pypi.scm \
272 guix/import/stackage.scm \
273 guix/import/texlive.scm \
274 guix/import/utils.scm \
275 guix/scripts.scm \
276 guix/scripts/download.scm \
277 guix/scripts/perform-download.scm \
278 guix/scripts/build.scm \
279 guix/scripts/archive.scm \
280 guix/scripts/import.scm \
281 guix/scripts/package.scm \
282 guix/scripts/install.scm \
283 guix/scripts/remove.scm \
284 guix/scripts/upgrade.scm \
285 guix/scripts/search.scm \
286 guix/scripts/show.scm \
287 guix/scripts/gc.scm \
288 guix/scripts/hash.scm \
289 guix/scripts/pack.scm \
290 guix/scripts/pull.scm \
291 guix/scripts/processes.scm \
292 guix/scripts/substitute.scm \
293 guix/scripts/authenticate.scm \
294 guix/scripts/refresh.scm \
295 guix/scripts/repl.scm \
296 guix/scripts/describe.scm \
297 guix/scripts/style.scm \
298 guix/scripts/system.scm \
299 guix/scripts/system/search.scm \
300 guix/scripts/system/reconfigure.scm \
301 guix/scripts/home.scm \
302 guix/scripts/home/import.scm \
303 guix/scripts/lint.scm \
304 guix/scripts/challenge.scm \
305 guix/scripts/import/crate.scm \
306 guix/scripts/import/cran.scm \
307 guix/scripts/import/egg.scm \
308 guix/scripts/import/elpa.scm \
309 guix/scripts/import/gem.scm \
310 guix/scripts/import/gnu.scm \
311 guix/scripts/import/go.scm \
312 guix/scripts/import/hackage.scm \
313 guix/scripts/import/json.scm \
314 guix/scripts/import/minetest.scm \
315 guix/scripts/import/opam.scm \
316 guix/scripts/import/pypi.scm \
317 guix/scripts/import/stackage.scm \
318 guix/scripts/import/texlive.scm \
319 guix/scripts/environment.scm \
320 guix/scripts/shell.scm \
321 guix/scripts/publish.scm \
322 guix/scripts/edit.scm \
323 guix/scripts/size.scm \
324 guix/scripts/git.scm \
325 guix/scripts/git/authenticate.scm \
326 guix/scripts/graph.scm \
327 guix/scripts/weather.scm \
328 guix/scripts/container.scm \
329 guix/scripts/container/exec.scm \
330 guix/scripts/deploy.scm \
331 guix/scripts/time-machine.scm \
332 guix.scm \
333 $(GNU_SYSTEM_MODULES)
334
335 if HAVE_GUILE_SSH
336
337 MODULES += \
338 guix/ssh.scm \
339 guix/remote.scm \
340 guix/scripts/copy.scm \
341 guix/store/ssh.scm
342
343 endif HAVE_GUILE_SSH
344
345 if HAVE_GUILE_AVAHI
346
347 MODULES += \
348 guix/avahi.scm \
349 guix/scripts/discover.scm
350
351 endif HAVE_GUILE_AVAHI
352
353 if BUILD_DAEMON_OFFLOAD
354
355 MODULES += \
356 guix/scripts/offload.scm
357
358 endif BUILD_DAEMON_OFFLOAD
359
360 # Scheme implementation of the build daemon and related functionality.
361 STORE_MODULES = \
362 guix/store/database.scm \
363 guix/store/deduplication.scm \
364 guix/store/roots.scm
365
366 MODULES += $(STORE_MODULES)
367
368 # Internal modules with test suite support.
369 dist_noinst_DATA = \
370 guix/tests.scm \
371 guix/tests/http.scm \
372 guix/tests/git.scm \
373 guix/tests/gnupg.scm
374
375 # Auxiliary files for packages.
376 AUX_FILES = \
377 gnu/packages/aux-files/chromium/master-preferences.json \
378 gnu/packages/aux-files/emacs/guix-emacs.el \
379 gnu/packages/aux-files/guix.vim \
380 gnu/packages/aux-files/linux-libre/5.15-arm.conf \
381 gnu/packages/aux-files/linux-libre/5.15-arm64.conf \
382 gnu/packages/aux-files/linux-libre/5.15-i686.conf \
383 gnu/packages/aux-files/linux-libre/5.15-x86_64.conf \
384 gnu/packages/aux-files/linux-libre/5.10-arm.conf \
385 gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
386 gnu/packages/aux-files/linux-libre/5.10-i686.conf \
387 gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
388 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
389 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
390 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
391 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
392 gnu/packages/aux-files/linux-libre/4.19-arm.conf \
393 gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
394 gnu/packages/aux-files/linux-libre/4.19-i686.conf \
395 gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
396 gnu/packages/aux-files/linux-libre/4.14-arm.conf \
397 gnu/packages/aux-files/linux-libre/4.14-i686.conf \
398 gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
399 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
400 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
401 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
402 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
403 gnu/packages/aux-files/pack-audit.c \
404 gnu/packages/aux-files/python/sanity-check.py \
405 gnu/packages/aux-files/python/sitecustomize.py \
406 gnu/packages/aux-files/run-in-namespace.c
407
408 # Templates, examples.
409 EXAMPLES = \
410 gnu/system/examples/asus-c201.tmpl \
411 gnu/system/examples/bare-bones.tmpl \
412 gnu/system/examples/bare-hurd.tmpl \
413 gnu/system/examples/beaglebone-black.tmpl \
414 gnu/system/examples/desktop.tmpl \
415 gnu/system/examples/lightweight-desktop.tmpl \
416 gnu/system/examples/docker-image.tmpl \
417 gnu/system/examples/vm-image.tmpl
418
419 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
420
421 nobase_dist_guilemodule_DATA = \
422 guix/d3.v3.js \
423 guix/graph.js \
424 guix/store/schema.sql \
425 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
426 $(MISC_DISTRO_FILES)
427 nobase_nodist_guilemodule_DATA = guix/config.scm
428 nobase_nodist_guileobject_DATA = $(GOBJECTS)
429
430 # Handy way to remove the .go files without removing all the rest.
431 clean-go:
432 -$(RM) -f $(GOBJECTS)
433 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
434 if test -t 1; then \
435 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
436 else \
437 xargs -r echo "warning: stray .go files:"; \
438 fi
439
440
441 # Test extensions; has to be unconditional.
442 TEST_EXTENSIONS = .scm .sh
443
444 if CAN_RUN_TESTS
445
446 SCM_TESTS = \
447 tests/accounts.scm \
448 tests/base16.scm \
449 tests/base32.scm \
450 tests/base64.scm \
451 tests/boot-parameters.scm \
452 tests/bournish.scm \
453 tests/builders.scm \
454 tests/build-utils.scm \
455 tests/cache.scm \
456 tests/challenge.scm \
457 tests/channels.scm \
458 tests/combinators.scm \
459 tests/containers.scm \
460 tests/cpan.scm \
461 tests/cpio.scm \
462 tests/cran.scm \
463 tests/crate.scm \
464 tests/cve.scm \
465 tests/debug-link.scm \
466 tests/derivations.scm \
467 tests/discovery.scm \
468 tests/egg.scm \
469 tests/elpa.scm \
470 tests/file-systems.scm \
471 tests/gem.scm \
472 tests/gexp.scm \
473 tests/git.scm \
474 tests/git-authenticate.scm \
475 tests/glob.scm \
476 tests/gnu-maintenance.scm \
477 tests/grafts.scm \
478 tests/graph.scm \
479 tests/gremlin.scm \
480 tests/hackage.scm \
481 tests/home-import.scm \
482 tests/import-git.scm \
483 tests/import-utils.scm \
484 tests/inferior.scm \
485 tests/lint.scm \
486 tests/minetest.scm \
487 tests/modules.scm \
488 tests/monads.scm \
489 tests/nar.scm \
490 tests/networking.scm \
491 tests/opam.scm \
492 tests/openpgp.scm \
493 tests/packages.scm \
494 tests/pack.scm \
495 tests/pki.scm \
496 tests/print.scm \
497 tests/processes.scm \
498 tests/profiles.scm \
499 tests/publish.scm \
500 tests/pypi.scm \
501 tests/records.scm \
502 tests/scripts.scm \
503 tests/search-paths.scm \
504 tests/services.scm \
505 tests/services/file-sharing.scm \
506 tests/services/configuration.scm \
507 tests/services/linux.scm \
508 tests/services/telephony.scm \
509 tests/sets.scm \
510 tests/size.scm \
511 tests/status.scm \
512 tests/store-database.scm \
513 tests/store-deduplication.scm \
514 tests/store-roots.scm \
515 tests/store.scm \
516 tests/substitute.scm \
517 tests/swh.scm \
518 tests/syscalls.scm \
519 tests/system.scm \
520 tests/style.scm \
521 tests/texlive.scm \
522 tests/transformations.scm \
523 tests/ui.scm \
524 tests/union.scm \
525 tests/upstream.scm \
526 tests/utils.scm \
527 tests/uuid.scm \
528 tests/workers.scm
529
530 if HAVE_GUILE_LIB
531 SCM_TESTS += tests/go.scm
532 else
533 EXTRA_DIST += tests/go.scm
534 endif
535
536 if BUILD_DAEMON_OFFLOAD
537 SCM_TESTS += tests/offload.scm
538 else
539 EXTRA_DIST += tests/offload.scm
540 endif
541
542 SH_TESTS = \
543 tests/guix-build.sh \
544 tests/guix-build-branch.sh \
545 tests/guix-download.sh \
546 tests/guix-gc.sh \
547 tests/guix-git-authenticate.sh \
548 tests/guix-hash.sh \
549 tests/guix-pack.sh \
550 tests/guix-pack-localstatedir.sh \
551 tests/guix-pack-relocatable.sh \
552 tests/guix-package.sh \
553 tests/guix-package-aliases.sh \
554 tests/guix-package-net.sh \
555 tests/guix-system.sh \
556 tests/guix-home.sh \
557 tests/guix-archive.sh \
558 tests/guix-authenticate.sh \
559 tests/guix-environment.sh \
560 tests/guix-environment-container.sh \
561 tests/guix-shell.sh \
562 tests/guix-graph.sh \
563 tests/guix-describe.sh \
564 tests/guix-repl.sh \
565 tests/guix-lint.sh
566
567 TESTS = $(SCM_TESTS) $(SH_TESTS)
568
569 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
570
571 SCM_LOG_DRIVER = \
572 $(top_builddir)/test-env --quiet-stderr \
573 $(GUILE) --no-auto-compile -e main \
574 $(top_srcdir)/build-aux/test-driver.scm
575
576 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
577
578 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
579 AM_SH_LOG_FLAGS = -x -e
580
581 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
582 # could end up removing files from the store while they are being used by
583 # other instances of the daemon.
584 tests/guix-gc.log: \
585 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
586 $(SCM_TESTS:%.scm=%.log)
587
588 else !CAN_RUN_TESTS
589
590 TESTS =
591 SH_TESTS =
592 SCM_TESTS =
593
594 # Automake always generates a 'check' target, so better not override it.
595 check-local:
596 @echo
597 @echo "Cannot run tests because file name limits would be exceeded." >&2
598 @echo "Look for 'length' in the 'config.log' file for details." >&2
599 @echo
600 @exit 1
601
602 endif !CAN_RUN_TESTS
603
604 check-system: $(GOBJECTS)
605 $(AM_V_at)$(top_builddir)/pre-inst-env \
606 guix build -m $(top_srcdir)/etc/system-tests.scm -K
607
608 # Public keys used to sign substitutes.
609 dist_pkgdata_DATA = \
610 etc/substitutes/berlin.guix.gnu.org.pub \
611 etc/substitutes/ci.guix.gnu.org.pub \
612 etc/substitutes/ci.guix.info.pub \
613 etc/substitutes/bordeaux.guix.gnu.org.pub
614
615 # Bash completion file.
616 dist_bashcompletion_DATA = etc/completion/bash/guix \
617 etc/completion/bash/guix-daemon
618
619 # Zsh completion file.
620 dist_zshcompletion_DATA = etc/completion/zsh/_guix
621
622 # Fish completion file.
623 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
624
625 # SELinux policy
626 nodist_selinux_policy_DATA = etc/guix-daemon.cil
627
628 EXTRA_DIST += \
629 HACKING \
630 ROADMAP \
631 TODO \
632 CODE-OF-CONDUCT \
633 .dir-locals.el \
634 .guix-authorizations \
635 .guix-channel \
636 scripts/guix.in \
637 etc/disarchive-manifest.scm \
638 etc/guix-install.sh \
639 etc/news.scm \
640 etc/release-manifest.scm \
641 etc/source-manifest.scm \
642 etc/system-tests.scm \
643 etc/historical-authorizations \
644 build-aux/build-self.scm \
645 build-aux/compile-all.scm \
646 build-aux/cuirass/hurd-manifest.scm \
647 build-aux/check-final-inputs-self-contained.scm \
648 build-aux/check-channel-news.scm \
649 build-aux/compile-as-derivation.scm \
650 build-aux/convert-xref.scm \
651 build-aux/generate-authors.scm \
652 build-aux/test-driver.scm \
653 build-aux/update-guix-package.scm \
654 build-aux/update-NEWS.scm \
655 tests/test.drv \
656 tests/signing-key.pub \
657 tests/signing-key.sec \
658 tests/cve-sample.json \
659 tests/civodul.key \
660 tests/rsa.key \
661 tests/dsa.key \
662 tests/ed25519.key \
663 tests/ed25519.sec \
664 tests/ed25519bis.key \
665 tests/ed25519bis.sec \
666 build-aux/config.rpath \
667 bootstrap \
668 doc/build.scm \
669 $(TESTS)
670
671 if !BUILD_DAEMON_OFFLOAD
672
673 EXTRA_DIST += \
674 guix/scripts/offload.scm
675
676 endif !BUILD_DAEMON_OFFLOAD
677
678
679 CLEANFILES = \
680 $(bin_SCRIPTS) \
681 $(GOBJECTS) \
682 $(SCM_TESTS:tests/%.scm=%.log)
683
684 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
685 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
686 # there that are newer than the local .scm files (for instance because the
687 # user ran 'make install' recently). When that happens, we end up loading
688 # those previously-installed .go files, which may be stale, thereby breaking
689 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
690 # stale files from ~/.cache/guile/ccache.
691 %.go: make-go ; @:
692 make-go: make-core-go make-packages-go make-system-go make-cli-go
693
694 # Define a rule to build a subset of the .go files.
695 define guile-compilation-rule
696
697 $(1): $(2)
698 $(AM_V_at)echo "Compiling Scheme modules..." ; \
699 unset GUILE_LOAD_COMPILED_PATH ; \
700 XDG_CACHE_HOME=/nowhere \
701 host=$(host) srcdir="$(top_srcdir)" \
702 $(top_builddir)/pre-inst-env \
703 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
704 --no-auto-compile \
705 -s "$(top_srcdir)"/build-aux/compile-all.scm \
706 --total $(words $(MODULES)) \
707 --completed $(3) \
708 $$(filter %.scm,$$^)
709
710 endef
711
712 # Split compilation in several steps, each of which building a subset of
713 # $(MODULES). The main goal is to reduce peak memory consumption, as reported
714 # in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
715 # 'make-*-go' phony target that builds the corresponding subset.
716
717 MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
718 MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
719 MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
720 MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
721 MODULES_PO = guix/build/po.scm
722
723 $(eval $(call guile-compilation-rule,make-core-go, \
724 $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
725 0))
726 .PHONY: make-core-go
727
728 $(eval $(call guile-compilation-rule,make-packages-go, \
729 $(MODULES_PACKAGES) make-core-go, \
730 $(words $(MODULES_CORE))))
731 .PHONY: make-packages-go
732
733 $(eval $(call guile-compilation-rule,make-system-go, \
734 $(MODULES_SYSTEM) make-packages-go make-core-go, \
735 $(words $(MODULES_CORE) $(MODULES_PACKAGES))))
736 .PHONY: make-system-go
737
738 $(eval $(call guile-compilation-rule,make-cli-go, \
739 $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
740 $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM))))
741 .PHONY: make-cli-go
742
743 $(eval $(call guile-compilation-rule,guix/build/po.go, \
744 $(MODULES_PO), \
745 0))
746
747 SUFFIXES = .go
748
749 # Make sure source files are installed first, so that the mtime of
750 # installed compiled files is greater than that of installed source
751 # files. See
752 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
753 # for details.
754 guix_install_go_files = install-nobase_nodist_guileobjectDATA
755 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
756
757 # The above trick doesn't work for 'config.go' because both 'config.scm' and
758 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
759 # special treatment.
760 install-data-hook:
761 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
762
763 # Commit corresponding to the 'v1.0.0' tag.
764 commit_v1_0_0 = 6298c3ffd9654d3231a6f25390b056483e8f407c
765
766 # Introduction of the 'guix' channel. Keep in sync with (guix channels)!
767 channel_intro_commit = 9edb3f66fd807b096b48283debdcddccfea34bad
768 channel_intro_signer = BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA
769
770 # Authenticate the current Git checkout by checking signatures on every commit.
771 GUIX_GIT_KEYRING = origin/keyring
772 authenticate:
773 $(AM_V_at)echo "Authenticating Git checkout..." ; \
774 guix git authenticate \
775 --keyring=$(GUIX_GIT_KEYRING) \
776 --cache-key=channels/guix --stats \
777 "$(channel_intro_commit)" "$(channel_intro_signer)"
778
779 # Assuming Guix is already installed and the daemon is up and running, this
780 # rule builds from $(srcdir), creating and building derivations.
781 as-derivation:
782 $(AM_V_at)echo "Building Guix in Guix..." ; \
783 $(GUILE) --no-auto-compile \
784 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
785 "$(abs_top_srcdir)"
786
787 SUBDIRS = po/guix po/packages
788 BUILT_SOURCES =
789
790 include doc/local.mk
791
792 if BUILD_DAEMON
793
794 include nix/local.mk
795
796 endif BUILD_DAEMON
797
798 ACLOCAL_AMFLAGS = -I m4
799
800 # Pass an explicit '--localstatedir' so that configure does not error out if
801 # it finds an existing installation with a different localstatedir. Inherit
802 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
803 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
804 # enough for shebangs.
805 AM_DISTCHECK_CONFIGURE_FLAGS = \
806 --localstatedir="$$dc_install_base/var" \
807 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
808 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
809 --enable-daemon \
810 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
811
812 # The self-contained tarball.
813 guix-binary.%.tar.xz:
814 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
815 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
816 --fallback \
817 -s "$*" --localstatedir --profile-name=current-guix \
818 guix` ; \
819 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
820
821
822 # The dependency on doc-pot-update is to generate the .pot files, which are
823 # not checked in.
824 dist: doc-pot-update
825
826 dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
827 dist-hook: assert-no-store-file-names
828
829 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
830
831 EXTRA_DIST += $(top_srcdir)/.version
832 BUILT_SOURCES += $(top_srcdir)/.version
833 $(top_srcdir)/.version: config.status
834 $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
835
836 gen-tarball-version:
837 echo $(VERSION) > "$(distdir)/.tarball-version"
838
839 gen-ChangeLog:
840 $(AM_V_GEN)if test -d .git; then \
841 $(top_srcdir)/build-aux/gitlog-to-changelog \
842 > $(distdir)/ChangeLog.tmp; \
843 rm -f $(distdir)/ChangeLog; \
844 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
845 fi
846
847 gen-AUTHORS:
848 $(AM_V_GEN)if test -d .git; then \
849 rm -f "$(distdir)/AUTHORS"; \
850 $(top_builddir)/pre-inst-env "$(GUILE)" \
851 "$(top_srcdir)/build-aux/generate-authors.scm" \
852 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
853 fi
854
855 # Like 'dist', but regenerate 'configure' so we get an up-to-date
856 # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
857 # do that whenever a 'dist' target is used.)
858 dist-with-updated-version:
859 @echo "Running './bootstrap' for new version string..."
860 $(top_srcdir)/bootstrap
861 $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
862
863 .PHONY: dist-with-updated-version
864
865 \f
866 #
867 # Release management.
868 #
869
870 releasedir = release-$(PACKAGE_VERSION)
871
872 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
873
874 # List of source tarballs produced. This must be kept in sync with the
875 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
876 SOURCE_TARBALLS = \
877 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
878
879 # Systems supported by Guix.
880 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
881 powerpc64le-linux
882
883 # Guix binary tarballs.
884 BINARY_TARBALLS = \
885 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
886
887 # Systems supported by Guix System.
888 GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
889
890 # Systems for which we build Guix VMs.
891 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
892
893 # Prefix of the Guix installation image file name.
894 GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
895
896 # Prefix of the Guix VM image file name.
897 GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
898
899 # Flags for 'guix system vm-image'. By default create a VM image that appears
900 # to have a 20G hard disk.
901 GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
902
903 # Return the sequence of '-s' flags for the given systems.
904 system_flags = $(foreach system,$(1),-s $(system))
905
906 # The release process works in several phases:
907 #
908 # 0. We assume the developer created a 'vX.Y.Z' tag.
909 # 1. Build the source tarball.
910 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
911 # 3. Build the binary tarballs for that 'guix' package.
912 # 4. Update the 'guix' package again.
913 # 5. Build the installation and VM images. The images will run 'guix'
914 # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
915 #
916 # This 'release' target takes care of everything and copies the resulting
917 # files to $(releasedir).
918 #
919 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
920 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
921 release: dist-with-updated-version all
922 @if ! git diff-index --quiet HEAD; then \
923 echo "There are uncommitted changes; stopping." >&2 ; \
924 exit 1 ; \
925 fi
926 $(MKDIR_P) "$(releasedir)"
927 rm -f "$(releasedir)"/*
928 mv $(SOURCE_TARBALLS) "$(releasedir)"
929 # Bump the Guix package version and build it.
930 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
931 $(top_builddir)/pre-inst-env "$(GUILE)" \
932 $(top_srcdir)/build-aux/update-guix-package.scm \
933 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
934 git add $(top_srcdir)/gnu/packages/package-management.scm
935 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
936 $(top_builddir)/pre-inst-env guix build guix \
937 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
938 -v1 --no-grafts --fallback
939 # Generate the binary release tarballs.
940 rm -f $(BINARY_TARBALLS)
941 $(MAKE) $(BINARY_TARBALLS)
942 for system in $(SUPPORTED_SYSTEMS) ; do \
943 mv "guix-binary.$$system.tar.xz" \
944 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
945 done
946 # Bump the Guix package version and build it (again).
947 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
948 $(top_builddir)/pre-inst-env "$(GUILE)" \
949 $(top_srcdir)/build-aux/update-guix-package.scm \
950 "`git rev-parse HEAD`"
951 git add $(top_srcdir)/gnu/packages/package-management.scm
952 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
953 $(top_builddir)/pre-inst-env guix build guix \
954 $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
955 -v1 --no-grafts --fallback
956 # Generate the ISO installation images.
957 for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
958 image=`$(top_builddir)/pre-inst-env \
959 guix system image -t iso9660 \
960 --label="GUIX_$${system}_$(VERSION)" \
961 --system=$$system --fallback \
962 gnu/system/install.scm` ; \
963 if [ ! -f "$$image" ] ; then \
964 echo "failed to produced Guix installation image for $$system" >&2 ; \
965 exit 1 ; \
966 fi ; \
967 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
968 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
969 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
970 done
971 # Generate the VM images.
972 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
973 image=`$(top_builddir)/pre-inst-env \
974 guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
975 --save-provenance \
976 --system=$$system --fallback \
977 gnu/system/examples/vm-image.tmpl` ; \
978 if [ ! -f "$$image" ] ; then \
979 echo "failed to produced Guix VM image for $$system" >&2 ; \
980 exit 1 ; \
981 fi ; \
982 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
983 done
984 @echo
985 @echo "Congratulations! All the release files are now in $(releasedir)."
986 @echo
987
988 update-guix-package:
989 git rev-parse HEAD
990 $(top_builddir)/pre-inst-env "$(GUILE)" \
991 $(top_srcdir)/build-aux/update-guix-package.scm \
992 "`git rev-parse HEAD`"
993
994 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
995 # Package data from this checkout is used by 'update-NEWS.scm'.
996 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
997
998 update-NEWS: $(GOBJECTS)
999 $(top_builddir)/pre-inst-env "$(GUILE)" \
1000 $(top_srcdir)/build-aux/update-NEWS.scm \
1001 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
1002
1003 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
1004 assert-no-store-file-names:
1005 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
1006 --exclude=*.info-[0-9] --exclude=*.dot \
1007 --exclude=*.eps --exclude-dir=bootstrap \
1008 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
1009 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
1010 --exclude=guix-prettify.el \
1011 --exclude=ChangeLog* \
1012 --exclude=binutils-boot-2.20*.patch \
1013 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
1014 then \
1015 echo "error: store file names embedded in the distribution" >&2 ; \
1016 exit 1 ; \
1017 fi
1018
1019 # Make sure important substitutes are available.
1020 assert-binaries-available: $(GOBJECTS)
1021 $(AM_V_at)$(top_builddir)/pre-inst-env \
1022 guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \
1023 --display-missing
1024
1025 # Make sure the final inputs don't refer to bootstrap tools.
1026 assert-final-inputs-self-contained: $(GOBJECTS)
1027 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1028 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
1029
1030 # Validate channel news.
1031 check-channel-news: $(GOBJECTS)
1032 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1033 "$(top_srcdir)/build-aux/check-channel-news.scm"
1034
1035 # Compute the Cuirass jobs.
1036 cuirass-jobs: $(GOBJECTS)
1037 rm -rf "$@"
1038 $(AM_V_at)$(MKDIR_P) "$@"
1039 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
1040 "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
1041
1042 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
1043 .PHONY: assert-no-store-file-names assert-binaries-available
1044 .PHONY: assert-final-inputs-self-contained check-channel-news
1045 .PHONY: clean-go make-go as-derivation authenticate
1046 .PHONY: update-guix-package update-NEWS cuirass-jobs release
1047
1048 # Downloading up-to-date PO files.
1049
1050 WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations
1051
1052 # Shallow clone the Git repository behind Weblate and copy files from it if
1053 # they contain at least one translation, and they are well-formed (Scheme
1054 # format only), warn otherwise. Copied files are converted to a canonical
1055 # form.
1056 download-po:
1057 dir=$$(mktemp -d); \
1058 git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \
1059 for domain in po/doc po/guix po/packages; do \
1060 for po in "$$dir/translations/$$domain"/*.po; do \
1061 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1062 target=$$(basename "$$po"); \
1063 target="$$domain/$$target"; \
1064 if msgfmt -c "$$po" && [ "$$translated" != "0" ]; then \
1065 msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \
1066 mv "$$po".tmp "$$target"; \
1067 echo "copied $$target."; \
1068 else \
1069 echo "WARN: $$target ($$translated translated messages) was not added/updated."; \
1070 fi; \
1071 done; \
1072 done; \
1073 rm -rf "$$dir"
1074 .PHONY: download-po
1075
1076 ## -------------- ##
1077 ## Silent rules. ##
1078 ## -------------- ##
1079
1080 AM_V_DL = $(AM_V_DL_$(V))
1081 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
1082 AM_V_DL_0 = @echo " DL " $@;
1083
1084 AM_V_DOT = $(AM_V_DOT_$(V))
1085 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
1086 AM_V_DOT_0 = @echo " DOT " $@;
1087
1088 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
1089 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
1090 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
1091
1092 AM_V_PO4A = $(AM_V_PO4A_$(V))
1093 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
1094 AM_V_PO4A_0 = @echo " PO4A" $@;
1095
1096 AM_V_POXREF = $(AM_V_POXREF_$(V))
1097 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
1098 AM_V_POXREF_0 = @echo " POXREF" $@;