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