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