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