Merge branch '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/publish.scm \
321 guix/scripts/edit.scm \
322 guix/scripts/size.scm \
323 guix/scripts/git.scm \
324 guix/scripts/git/authenticate.scm \
325 guix/scripts/graph.scm \
326 guix/scripts/weather.scm \
327 guix/scripts/container.scm \
328 guix/scripts/container/exec.scm \
329 guix/scripts/deploy.scm \
330 guix/scripts/time-machine.scm \
331 guix.scm \
332 $(GNU_SYSTEM_MODULES)
333
334 if HAVE_GUILE_SSH
335
336 MODULES += \
337 guix/ssh.scm \
338 guix/remote.scm \
339 guix/scripts/copy.scm \
340 guix/store/ssh.scm
341
342 endif HAVE_GUILE_SSH
343
344 if HAVE_GUILE_AVAHI
345
346 MODULES += \
347 guix/avahi.scm \
348 guix/scripts/discover.scm
349
350 endif HAVE_GUILE_AVAHI
351
352 if BUILD_DAEMON_OFFLOAD
353
354 MODULES += \
355 guix/scripts/offload.scm
356
357 endif BUILD_DAEMON_OFFLOAD
358
359 # Scheme implementation of the build daemon and related functionality.
360 STORE_MODULES = \
361 guix/store/database.scm \
362 guix/store/deduplication.scm \
363 guix/store/roots.scm
364
365 MODULES += $(STORE_MODULES)
366
367 # Internal modules with test suite support.
368 dist_noinst_DATA = \
369 guix/tests.scm \
370 guix/tests/http.scm \
371 guix/tests/git.scm \
372 guix/tests/gnupg.scm
373
374 # Auxiliary files for packages.
375 AUX_FILES = \
376 gnu/packages/aux-files/chromium/master-preferences.json \
377 gnu/packages/aux-files/emacs/guix-emacs.el \
378 gnu/packages/aux-files/guix.vim \
379 gnu/packages/aux-files/linux-libre/5.14-arm.conf \
380 gnu/packages/aux-files/linux-libre/5.14-arm64.conf \
381 gnu/packages/aux-files/linux-libre/5.14-i686.conf \
382 gnu/packages/aux-files/linux-libre/5.14-x86_64.conf \
383 gnu/packages/aux-files/linux-libre/5.10-arm.conf \
384 gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
385 gnu/packages/aux-files/linux-libre/5.10-i686.conf \
386 gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
387 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
388 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
389 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
390 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
391 gnu/packages/aux-files/linux-libre/4.19-arm.conf \
392 gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
393 gnu/packages/aux-files/linux-libre/4.19-i686.conf \
394 gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
395 gnu/packages/aux-files/linux-libre/4.14-arm.conf \
396 gnu/packages/aux-files/linux-libre/4.14-i686.conf \
397 gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
398 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
399 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
400 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
401 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
402 gnu/packages/aux-files/pack-audit.c \
403 gnu/packages/aux-files/python/sanity-check.py \
404 gnu/packages/aux-files/python/sitecustomize.py \
405 gnu/packages/aux-files/run-in-namespace.c
406
407 # Templates, examples.
408 EXAMPLES = \
409 gnu/system/examples/asus-c201.tmpl \
410 gnu/system/examples/bare-bones.tmpl \
411 gnu/system/examples/bare-hurd.tmpl \
412 gnu/system/examples/beaglebone-black.tmpl \
413 gnu/system/examples/desktop.tmpl \
414 gnu/system/examples/lightweight-desktop.tmpl \
415 gnu/system/examples/docker-image.tmpl \
416 gnu/system/examples/vm-image.tmpl
417
418 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
419
420 nobase_dist_guilemodule_DATA = \
421 guix/d3.v3.js \
422 guix/graph.js \
423 guix/store/schema.sql \
424 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
425 $(MISC_DISTRO_FILES)
426 nobase_nodist_guilemodule_DATA = guix/config.scm
427 nobase_nodist_guileobject_DATA = $(GOBJECTS)
428
429 # Handy way to remove the .go files without removing all the rest.
430 clean-go:
431 -$(RM) -f $(GOBJECTS)
432 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
433 if test -t 1; then \
434 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
435 else \
436 xargs -r echo "warning: stray .go files:"; \
437 fi
438
439
440 # Test extensions; has to be unconditional.
441 TEST_EXTENSIONS = .scm .sh
442
443 if CAN_RUN_TESTS
444
445 SCM_TESTS = \
446 tests/accounts.scm \
447 tests/base16.scm \
448 tests/base32.scm \
449 tests/base64.scm \
450 tests/boot-parameters.scm \
451 tests/bournish.scm \
452 tests/builders.scm \
453 tests/build-utils.scm \
454 tests/cache.scm \
455 tests/challenge.scm \
456 tests/channels.scm \
457 tests/combinators.scm \
458 tests/containers.scm \
459 tests/cpan.scm \
460 tests/cpio.scm \
461 tests/cran.scm \
462 tests/crate.scm \
463 tests/cve.scm \
464 tests/debug-link.scm \
465 tests/derivations.scm \
466 tests/discovery.scm \
467 tests/egg.scm \
468 tests/elpa.scm \
469 tests/file-systems.scm \
470 tests/gem.scm \
471 tests/gexp.scm \
472 tests/git.scm \
473 tests/git-authenticate.scm \
474 tests/glob.scm \
475 tests/gnu-maintenance.scm \
476 tests/grafts.scm \
477 tests/graph.scm \
478 tests/gremlin.scm \
479 tests/hackage.scm \
480 tests/import-git.scm \
481 tests/import-utils.scm \
482 tests/inferior.scm \
483 tests/lint.scm \
484 tests/minetest.scm \
485 tests/modules.scm \
486 tests/monads.scm \
487 tests/nar.scm \
488 tests/networking.scm \
489 tests/opam.scm \
490 tests/openpgp.scm \
491 tests/packages.scm \
492 tests/pack.scm \
493 tests/pki.scm \
494 tests/print.scm \
495 tests/processes.scm \
496 tests/profiles.scm \
497 tests/publish.scm \
498 tests/pypi.scm \
499 tests/records.scm \
500 tests/scripts.scm \
501 tests/search-paths.scm \
502 tests/services.scm \
503 tests/services/file-sharing.scm \
504 tests/services/configuration.scm \
505 tests/services/linux.scm \
506 tests/services/telephony.scm \
507 tests/sets.scm \
508 tests/size.scm \
509 tests/status.scm \
510 tests/store-database.scm \
511 tests/store-deduplication.scm \
512 tests/store-roots.scm \
513 tests/store.scm \
514 tests/substitute.scm \
515 tests/swh.scm \
516 tests/syscalls.scm \
517 tests/system.scm \
518 tests/style.scm \
519 tests/texlive.scm \
520 tests/transformations.scm \
521 tests/ui.scm \
522 tests/union.scm \
523 tests/upstream.scm \
524 tests/utils.scm \
525 tests/uuid.scm \
526 tests/workers.scm
527
528 if HAVE_GUILE_LIB
529 SCM_TESTS += tests/go.scm
530 else
531 EXTRA_DIST += tests/go.scm
532 endif
533
534 if BUILD_DAEMON_OFFLOAD
535 SCM_TESTS += tests/offload.scm
536 else
537 EXTRA_DIST += tests/offload.scm
538 endif
539
540 SH_TESTS = \
541 tests/guix-build.sh \
542 tests/guix-build-branch.sh \
543 tests/guix-download.sh \
544 tests/guix-gc.sh \
545 tests/guix-git-authenticate.sh \
546 tests/guix-hash.sh \
547 tests/guix-pack.sh \
548 tests/guix-pack-localstatedir.sh \
549 tests/guix-pack-relocatable.sh \
550 tests/guix-package.sh \
551 tests/guix-package-aliases.sh \
552 tests/guix-package-net.sh \
553 tests/guix-system.sh \
554 tests/guix-home.sh \
555 tests/guix-archive.sh \
556 tests/guix-authenticate.sh \
557 tests/guix-environment.sh \
558 tests/guix-environment-container.sh \
559 tests/guix-graph.sh \
560 tests/guix-describe.sh \
561 tests/guix-repl.sh \
562 tests/guix-lint.sh
563
564 TESTS = $(SCM_TESTS) $(SH_TESTS)
565
566 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
567
568 SCM_LOG_DRIVER = \
569 $(top_builddir)/test-env --quiet-stderr \
570 $(GUILE) --no-auto-compile -e main \
571 $(top_srcdir)/build-aux/test-driver.scm
572
573 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
574
575 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
576 AM_SH_LOG_FLAGS = -x -e
577
578 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
579 # could end up removing files from the store while they are being used by
580 # other instances of the daemon.
581 tests/guix-gc.log: \
582 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
583 $(SCM_TESTS:%.scm=%.log)
584
585 else !CAN_RUN_TESTS
586
587 TESTS =
588 SH_TESTS =
589 SCM_TESTS =
590
591 # Automake always generates a 'check' target, so better not override it.
592 check-local:
593 @echo
594 @echo "Cannot run tests because file name limits would be exceeded." >&2
595 @echo "Look for 'length' in the 'config.log' file for details." >&2
596 @echo
597 @exit 1
598
599 endif !CAN_RUN_TESTS
600
601 check-system: $(GOBJECTS)
602 $(AM_V_at)$(top_builddir)/pre-inst-env \
603 guix build -m $(top_srcdir)/etc/system-tests.scm -K
604
605 # Public keys used to sign substitutes.
606 dist_pkgdata_DATA = \
607 etc/substitutes/berlin.guix.gnu.org.pub \
608 etc/substitutes/ci.guix.gnu.org.pub \
609 etc/substitutes/ci.guix.info.pub \
610 etc/substitutes/bordeaux.guix.gnu.org.pub
611
612 # Bash completion file.
613 dist_bashcompletion_DATA = etc/completion/bash/guix \
614 etc/completion/bash/guix-daemon
615
616 # Zsh completion file.
617 dist_zshcompletion_DATA = etc/completion/zsh/_guix
618
619 # Fish completion file.
620 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
621
622 # SELinux policy
623 nodist_selinux_policy_DATA = etc/guix-daemon.cil
624
625 EXTRA_DIST += \
626 HACKING \
627 ROADMAP \
628 TODO \
629 CODE-OF-CONDUCT \
630 .dir-locals.el \
631 .guix-authorizations \
632 .guix-channel \
633 scripts/guix.in \
634 etc/disarchive-manifest.scm \
635 etc/guix-install.sh \
636 etc/news.scm \
637 etc/release-manifest.scm \
638 etc/source-manifest.scm \
639 etc/system-tests.scm \
640 etc/historical-authorizations \
641 build-aux/build-self.scm \
642 build-aux/compile-all.scm \
643 build-aux/cuirass/hurd-manifest.scm \
644 build-aux/check-final-inputs-self-contained.scm \
645 build-aux/check-channel-news.scm \
646 build-aux/compile-as-derivation.scm \
647 build-aux/generate-authors.scm \
648 build-aux/test-driver.scm \
649 build-aux/update-guix-package.scm \
650 build-aux/update-NEWS.scm \
651 tests/test.drv \
652 tests/signing-key.pub \
653 tests/signing-key.sec \
654 tests/cve-sample.json \
655 tests/civodul.key \
656 tests/rsa.key \
657 tests/dsa.key \
658 tests/ed25519.key \
659 tests/ed25519.sec \
660 tests/ed25519bis.key \
661 tests/ed25519bis.sec \
662 build-aux/config.rpath \
663 bootstrap \
664 doc/build.scm \
665 $(TESTS)
666
667 if !BUILD_DAEMON_OFFLOAD
668
669 EXTRA_DIST += \
670 guix/scripts/offload.scm
671
672 endif !BUILD_DAEMON_OFFLOAD
673
674
675 CLEANFILES = \
676 $(bin_SCRIPTS) \
677 $(GOBJECTS) \
678 $(SCM_TESTS:tests/%.scm=%.log)
679
680 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
681 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
682 # there that are newer than the local .scm files (for instance because the
683 # user ran 'make install' recently). When that happens, we end up loading
684 # those previously-installed .go files, which may be stale, thereby breaking
685 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
686 # stale files from ~/.cache/guile/ccache.
687 %.go: make-go ; @:
688 make-go: make-core-go make-packages-go make-system-go make-cli-go
689
690 # Define a rule to build a subset of the .go files.
691 define guile-compilation-rule
692
693 $(1): $(2)
694 $(AM_V_at)echo "Compiling Scheme modules..." ; \
695 unset GUILE_LOAD_COMPILED_PATH ; \
696 XDG_CACHE_HOME=/nowhere \
697 host=$(host) srcdir="$(top_srcdir)" \
698 $(top_builddir)/pre-inst-env \
699 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
700 --no-auto-compile \
701 -s "$(top_srcdir)"/build-aux/compile-all.scm \
702 --total $(words $(MODULES)) \
703 --completed $(3) \
704 $$(filter %.scm,$$^)
705
706 .PHONY: $(1)
707
708 endef
709
710 # Split compilation in several steps, each of which building a subset of
711 # $(MODULES). The main goal is to reduce peak memory consumption, as reported
712 # in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
713 # 'make-*-go' phony target that builds the corresponding subset.
714
715 MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
716 MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
717 MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
718 MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
719
720 $(eval $(call guile-compilation-rule,make-core-go, \
721 $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
722 0))
723
724 $(eval $(call guile-compilation-rule,make-packages-go, \
725 $(MODULES_PACKAGES) make-core-go, \
726 $(words $(MODULES_CORE))))
727
728 $(eval $(call guile-compilation-rule,make-system-go, \
729 $(MODULES_SYSTEM) make-packages-go make-core-go, \
730 $(words $(MODULES_CORE) $(MODULES_PACKAGES))))
731
732 $(eval $(call guile-compilation-rule,make-cli-go, \
733 $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
734 $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM))))
735
736 SUFFIXES = .go
737
738 # Make sure source files are installed first, so that the mtime of
739 # installed compiled files is greater than that of installed source
740 # files. See
741 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
742 # for details.
743 guix_install_go_files = install-nobase_nodist_guileobjectDATA
744 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
745
746 # The above trick doesn't work for 'config.go' because both 'config.scm' and
747 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
748 # special treatment.
749 install-data-hook:
750 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
751
752 # Commit corresponding to the 'v1.0.0' tag.
753 commit_v1_0_0 = 6298c3ffd9654d3231a6f25390b056483e8f407c
754
755 # Introduction of the 'guix' channel. Keep in sync with (guix channels)!
756 channel_intro_commit = 9edb3f66fd807b096b48283debdcddccfea34bad
757 channel_intro_signer = BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA
758
759 # Authenticate the current Git checkout by checking signatures on every commit.
760 GUIX_GIT_KEYRING = origin/keyring
761 authenticate:
762 $(AM_V_at)echo "Authenticating Git checkout..." ; \
763 guix git authenticate \
764 --keyring=$(GUIX_GIT_KEYRING) \
765 --cache-key=channels/guix --stats \
766 "$(channel_intro_commit)" "$(channel_intro_signer)"
767
768 # Assuming Guix is already installed and the daemon is up and running, this
769 # rule builds from $(srcdir), creating and building derivations.
770 as-derivation:
771 $(AM_V_at)echo "Building Guix in Guix..." ; \
772 $(GUILE) --no-auto-compile \
773 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
774 "$(abs_top_srcdir)"
775
776 SUBDIRS = po/guix po/packages
777 BUILT_SOURCES =
778
779 include doc/local.mk
780
781 if BUILD_DAEMON
782
783 include nix/local.mk
784
785 endif BUILD_DAEMON
786
787 ACLOCAL_AMFLAGS = -I m4
788
789 # Pass an explicit '--localstatedir' so that configure does not error out if
790 # it finds an existing installation with a different localstatedir. Inherit
791 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
792 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
793 # enough for shebangs.
794 AM_DISTCHECK_CONFIGURE_FLAGS = \
795 --localstatedir="$$dc_install_base/var" \
796 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
797 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
798 --enable-daemon \
799 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
800
801 # The self-contained tarball.
802 guix-binary.%.tar.xz:
803 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
804 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
805 --fallback \
806 -s "$*" --localstatedir --profile-name=current-guix \
807 guix` ; \
808 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
809
810
811 # The dependency on doc-pot-update is to generate the .pot files, which are
812 # not checked in.
813 dist: doc-pot-update
814
815 dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
816 dist-hook: assert-no-store-file-names
817
818 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
819
820 EXTRA_DIST += $(top_srcdir)/.version
821 BUILT_SOURCES += $(top_srcdir)/.version
822 $(top_srcdir)/.version: config.status
823 $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
824
825 gen-tarball-version:
826 echo $(VERSION) > "$(distdir)/.tarball-version"
827
828 gen-ChangeLog:
829 $(AM_V_GEN)if test -d .git; then \
830 $(top_srcdir)/build-aux/gitlog-to-changelog \
831 > $(distdir)/ChangeLog.tmp; \
832 rm -f $(distdir)/ChangeLog; \
833 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
834 fi
835
836 gen-AUTHORS:
837 $(AM_V_GEN)if test -d .git; then \
838 rm -f "$(distdir)/AUTHORS"; \
839 $(top_builddir)/pre-inst-env "$(GUILE)" \
840 "$(top_srcdir)/build-aux/generate-authors.scm" \
841 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
842 fi
843
844 # Like 'dist', but regenerate 'configure' so we get an up-to-date
845 # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
846 # do that whenever a 'dist' target is used.)
847 dist-with-updated-version:
848 @echo "Running './bootstrap' for new version string..."
849 $(top_srcdir)/bootstrap
850 $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
851
852 .PHONY: dist-with-updated-version
853
854 \f
855 #
856 # Release management.
857 #
858
859 releasedir = release-$(PACKAGE_VERSION)
860
861 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
862
863 # List of source tarballs produced. This must be kept in sync with the
864 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
865 SOURCE_TARBALLS = \
866 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
867
868 # Systems supported by Guix.
869 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
870 powerpc64le-linux
871
872 # Guix binary tarballs.
873 BINARY_TARBALLS = \
874 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
875
876 # Systems supported by Guix System.
877 GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
878
879 # Systems for which we build Guix VMs.
880 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
881
882 # Prefix of the Guix installation image file name.
883 GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
884
885 # Prefix of the Guix VM image file name.
886 GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
887
888 # Flags for 'guix system vm-image'. By default create a VM image that appears
889 # to have a 20G hard disk.
890 GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
891
892 # Return the sequence of '-s' flags for the given systems.
893 system_flags = $(foreach system,$(1),-s $(system))
894
895 # The release process works in several phases:
896 #
897 # 0. We assume the developer created a 'vX.Y.Z' tag.
898 # 1. Build the source tarball.
899 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
900 # 3. Build the binary tarballs for that 'guix' package.
901 # 4. Update the 'guix' package again.
902 # 5. Build the installation and VM images. The images will run 'guix'
903 # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
904 #
905 # This 'release' target takes care of everything and copies the resulting
906 # files to $(releasedir).
907 #
908 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
909 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
910 release: dist-with-updated-version all
911 @if ! git diff-index --quiet HEAD; then \
912 echo "There are uncommitted changes; stopping." >&2 ; \
913 exit 1 ; \
914 fi
915 $(MKDIR_P) "$(releasedir)"
916 rm -f "$(releasedir)"/*
917 mv $(SOURCE_TARBALLS) "$(releasedir)"
918 # Bump the Guix package version and build it.
919 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
920 $(top_builddir)/pre-inst-env "$(GUILE)" \
921 $(top_srcdir)/build-aux/update-guix-package.scm \
922 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
923 git add $(top_srcdir)/gnu/packages/package-management.scm
924 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
925 $(top_builddir)/pre-inst-env guix build guix \
926 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
927 -v1 --no-grafts --fallback
928 # Generate the binary release tarballs.
929 rm -f $(BINARY_TARBALLS)
930 $(MAKE) $(BINARY_TARBALLS)
931 for system in $(SUPPORTED_SYSTEMS) ; do \
932 mv "guix-binary.$$system.tar.xz" \
933 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
934 done
935 # Bump the Guix package version and build it (again).
936 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
937 $(top_builddir)/pre-inst-env "$(GUILE)" \
938 $(top_srcdir)/build-aux/update-guix-package.scm \
939 "`git rev-parse HEAD`"
940 git add $(top_srcdir)/gnu/packages/package-management.scm
941 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
942 $(top_builddir)/pre-inst-env guix build guix \
943 $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
944 -v1 --no-grafts --fallback
945 # Generate the ISO installation images.
946 for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
947 image=`$(top_builddir)/pre-inst-env \
948 guix system image -t iso9660 \
949 --label="GUIX_$${system}_$(VERSION)" \
950 --system=$$system --fallback \
951 gnu/system/install.scm` ; \
952 if [ ! -f "$$image" ] ; then \
953 echo "failed to produced Guix installation image for $$system" >&2 ; \
954 exit 1 ; \
955 fi ; \
956 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
957 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
958 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
959 done
960 # Generate the VM images.
961 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
962 image=`$(top_builddir)/pre-inst-env \
963 guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
964 --save-provenance \
965 --system=$$system --fallback \
966 gnu/system/examples/vm-image.tmpl` ; \
967 if [ ! -f "$$image" ] ; then \
968 echo "failed to produced Guix VM image for $$system" >&2 ; \
969 exit 1 ; \
970 fi ; \
971 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
972 done
973 @echo
974 @echo "Congratulations! All the release files are now in $(releasedir)."
975 @echo
976
977 update-guix-package:
978 git rev-parse HEAD
979 $(top_builddir)/pre-inst-env "$(GUILE)" \
980 $(top_srcdir)/build-aux/update-guix-package.scm \
981 "`git rev-parse HEAD`"
982
983 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
984 # Package data from this checkout is used by 'update-NEWS.scm'.
985 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
986
987 update-NEWS: $(GOBJECTS)
988 $(top_builddir)/pre-inst-env "$(GUILE)" \
989 $(top_srcdir)/build-aux/update-NEWS.scm \
990 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
991
992 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
993 assert-no-store-file-names:
994 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
995 --exclude=*.info-[0-9] --exclude=*.dot \
996 --exclude=*.eps --exclude-dir=bootstrap \
997 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
998 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
999 --exclude=guix-prettify.el \
1000 --exclude=ChangeLog* \
1001 --exclude=binutils-boot-2.20*.patch \
1002 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
1003 then \
1004 echo "error: store file names embedded in the distribution" >&2 ; \
1005 exit 1 ; \
1006 fi
1007
1008 # Make sure important substitutes are available.
1009 assert-binaries-available: $(GOBJECTS)
1010 $(AM_V_at)$(top_builddir)/pre-inst-env \
1011 guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \
1012 --display-missing
1013
1014 # Make sure the final inputs don't refer to bootstrap tools.
1015 assert-final-inputs-self-contained: $(GOBJECTS)
1016 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1017 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
1018
1019 # Validate channel news.
1020 check-channel-news: $(GOBJECTS)
1021 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1022 "$(top_srcdir)/build-aux/check-channel-news.scm"
1023
1024 # Compute the Cuirass jobs.
1025 cuirass-jobs: $(GOBJECTS)
1026 rm -rf "$@"
1027 $(AM_V_at)$(MKDIR_P) "$@"
1028 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
1029 "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
1030
1031 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
1032 .PHONY: assert-no-store-file-names assert-binaries-available
1033 .PHONY: assert-final-inputs-self-contained check-channel-news
1034 .PHONY: clean-go make-go as-derivation authenticate
1035 .PHONY: update-guix-package update-NEWS cuirass-jobs release
1036
1037 # Downloading up-to-date PO files.
1038
1039 WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations
1040
1041 # Shallow clone the Git repository behind Weblate and copy files from it if
1042 # they contain at least one translation, and they are well-formed (Scheme
1043 # format only), warn otherwise. Copied files are converted to a canonical
1044 # form.
1045 download-po:
1046 dir=$$(mktemp -d); \
1047 git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \
1048 for domain in po/doc po/guix po/packages; do \
1049 for po in "$$dir/translations/$$domain"/*.po; do \
1050 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1051 target=$$(basename "$$po"); \
1052 target="$$domain/$$target"; \
1053 if msgfmt -c "$$po" && [ "$$translated" != "0" ]; then \
1054 msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \
1055 mv "$$po".tmp "$$target"; \
1056 echo "copied $$target."; \
1057 else \
1058 echo "WARN: $$target ($$translated translated messages) was not added/updated."; \
1059 fi; \
1060 done; \
1061 done; \
1062 rm -rf "$$dir"
1063 .PHONY: download-po
1064
1065 ## -------------- ##
1066 ## Silent rules. ##
1067 ## -------------- ##
1068
1069 AM_V_DL = $(AM_V_DL_$(V))
1070 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
1071 AM_V_DL_0 = @echo " DL " $@;
1072
1073 AM_V_DOT = $(AM_V_DOT_$(V))
1074 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
1075 AM_V_DOT_0 = @echo " DOT " $@;
1076
1077 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
1078 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
1079 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
1080
1081 AM_V_PO4A = $(AM_V_PO4A_$(V))
1082 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
1083 AM_V_PO4A_0 = @echo " PO4A" $@;
1084
1085 AM_V_POXREF = $(AM_V_POXREF_$(V))
1086 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
1087 AM_V_POXREF_0 = @echo " POXREF" $@;