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