guix system: 'list-generation' correctly displays file system labels.
[guix.git] / Makefile.am
blobab145065d616c90a8fefc50804ebd697e03562c9
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 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 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 Nils Gillmann <ng0@n0.is>
13 # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
14 # Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
16 # This file is part of GNU Guix.
18 # GNU Guix is free software; you can redistribute it and/or modify it
19 # under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 3 of the License, or (at
21 # your option) any later version.
23 # GNU Guix is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
31 MSGMERGE_UPDATE = @MSGMERGE@ --update
33 bin_SCRIPTS = scripts/guix
35 # Handle substitution of fully-expanded Autoconf variables.
36 do_subst = $(SED)                                       \
37   -e 's,[@]GUILE[@],$(GUILE),g'                         \
38   -e 's,[@]guilemoduledir[@],$(guilemoduledir),g'       \
39   -e 's,[@]guileobjectdir[@],$(guileobjectdir),g'       \
40   -e 's,[@]localedir[@],$(localedir),g'
42 scripts/guix: scripts/guix.in Makefile
43         $(AM_V_at)rm -f $@ $@-t
44         $(AM_V_at)$(MKDIR_P) "$(@D)"
45         $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
46         $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
48 nodist_noinst_SCRIPTS =                         \
49   pre-inst-env                                  \
50   test-env
52 # Modules that are not compiled but are installed nonetheless, such as
53 # build-side modules with unusual dependencies.
54 MODULES_NOT_COMPILED =                          \
55   guix/man-db.scm
57 include gnu/local.mk
58 include po/doc/local.mk
60 MODULES =                                       \
61   guix/base16.scm                               \
62   guix/base32.scm                               \
63   guix/base64.scm                               \
64   guix/cpio.scm                                 \
65   guix/records.scm                              \
66   guix/gcrypt.scm                               \
67   guix/hash.scm                                 \
68   guix/pk-crypto.scm                            \
69   guix/pki.scm                                  \
70   guix/progress.scm                             \
71   guix/combinators.scm                          \
72   guix/memoization.scm                          \
73   guix/utils.scm                                \
74   guix/sets.scm                                 \
75   guix/modules.scm                              \
76   guix/download.scm                             \
77   guix/discovery.scm                            \
78   guix/git-download.scm                         \
79   guix/hg-download.scm                          \
80   guix/monads.scm                               \
81   guix/monad-repl.scm                           \
82   guix/gexp.scm                                 \
83   guix/profiles.scm                             \
84   guix/serialization.scm                        \
85   guix/nar.scm                                  \
86   guix/derivations.scm                          \
87   guix/grafts.scm                               \
88   guix/gnu-maintenance.scm                      \
89   guix/self.scm                                 \
90   guix/upstream.scm                             \
91   guix/licenses.scm                             \
92   guix/glob.scm                                 \
93   guix/git.scm                                  \
94   guix/graph.scm                                \
95   guix/cache.scm                                \
96   guix/cve.scm                                  \
97   guix/workers.scm                              \
98   guix/zlib.scm                                 \
99   guix/build-system.scm                         \
100   guix/build-system/android-ndk.scm             \
101   guix/build-system/ant.scm                     \
102   guix/build-system/cargo.scm                   \
103   guix/build-system/cmake.scm                   \
104   guix/build-system/dub.scm                     \
105   guix/build-system/emacs.scm                   \
106   guix/build-system/font.scm                    \
107   guix/build-system/go.scm                      \
108   guix/build-system/meson.scm                   \
109   guix/build-system/minify.scm                  \
110   guix/build-system/asdf.scm                    \
111   guix/build-system/glib-or-gtk.scm             \
112   guix/build-system/gnu.scm                     \
113   guix/build-system/haskell.scm                 \
114   guix/build-system/perl.scm                    \
115   guix/build-system/python.scm                  \
116   guix/build-system/ocaml.scm                   \
117   guix/build-system/waf.scm                     \
118   guix/build-system/r.scm                       \
119   guix/build-system/ruby.scm                    \
120   guix/build-system/scons.scm                   \
121   guix/build-system/texlive.scm                 \
122   guix/build-system/trivial.scm                 \
123   guix/ftp-client.scm                           \
124   guix/http-client.scm                          \
125   guix/gnupg.scm                                \
126   guix/elf.scm                                  \
127   guix/profiling.scm                            \
128   guix/store.scm                                \
129   guix/cvs-download.scm                         \
130   guix/svn-download.scm                         \
131   guix/i18n.scm                                 \
132   guix/ui.scm                                   \
133   guix/build/android-ndk-build-system.scm       \
134   guix/build/ant-build-system.scm               \
135   guix/build/download.scm                       \
136   guix/build/download-nar.scm                   \
137   guix/build/cargo-build-system.scm             \
138   guix/build/cmake-build-system.scm             \
139   guix/build/dub-build-system.scm               \
140   guix/build/emacs-build-system.scm             \
141   guix/build/meson-build-system.scm             \
142   guix/build/minify-build-system.scm            \
143   guix/build/font-build-system.scm              \
144   guix/build/go-build-system.scm                \
145   guix/build/asdf-build-system.scm              \
146   guix/build/git.scm                            \
147   guix/build/hg.scm                             \
148   guix/build/glib-or-gtk-build-system.scm       \
149   guix/build/gnu-build-system.scm               \
150   guix/build/gnu-dist.scm                       \
151   guix/build/perl-build-system.scm              \
152   guix/build/python-build-system.scm            \
153   guix/build/ocaml-build-system.scm             \
154   guix/build/r-build-system.scm                 \
155   guix/build/ruby-build-system.scm              \
156   guix/build/scons-build-system.scm             \
157   guix/build/texlive-build-system.scm           \
158   guix/build/waf-build-system.scm               \
159   guix/build/haskell-build-system.scm           \
160   guix/build/store-copy.scm                     \
161   guix/build/utils.scm                          \
162   guix/build/union.scm                          \
163   guix/build/profiles.scm                       \
164   guix/build/compile.scm                        \
165   guix/build/pull.scm                           \
166   guix/build/rpath.scm                          \
167   guix/build/cvs.scm                            \
168   guix/build/svn.scm                            \
169   guix/build/syscalls.scm                       \
170   guix/build/gremlin.scm                        \
171   guix/build/emacs-utils.scm                    \
172   guix/build/java-utils.scm                     \
173   guix/build/lisp-utils.scm                     \
174   guix/build/graft.scm                          \
175   guix/build/bournish.scm                       \
176   guix/build/qt-utils.scm                       \
177   guix/build/make-bootstrap.scm                 \
178   guix/search-paths.scm                         \
179   guix/packages.scm                             \
180   guix/import/print.scm                         \
181   guix/import/utils.scm                         \
182   guix/import/gnu.scm                           \
183   guix/import/snix.scm                          \
184   guix/import/cabal.scm                         \
185   guix/import/cran.scm                          \
186   guix/import/hackage.scm                       \
187   guix/import/elpa.scm                          \
188   guix/import/texlive.scm                       \
189   guix/scripts.scm                              \
190   guix/scripts/download.scm                     \
191   guix/scripts/perform-download.scm             \
192   guix/scripts/build.scm                        \
193   guix/scripts/archive.scm                      \
194   guix/scripts/import.scm                       \
195   guix/scripts/package.scm                      \
196   guix/scripts/gc.scm                           \
197   guix/scripts/hash.scm                         \
198   guix/scripts/pack.scm                         \
199   guix/scripts/pull.scm                         \
200   guix/scripts/substitute.scm                   \
201   guix/scripts/authenticate.scm                 \
202   guix/scripts/refresh.scm                      \
203   guix/scripts/system.scm                       \
204   guix/scripts/system/search.scm                \
205   guix/scripts/lint.scm                         \
206   guix/scripts/challenge.scm                    \
207   guix/scripts/import/cran.scm                  \
208   guix/scripts/import/gnu.scm                   \
209   guix/scripts/import/nix.scm                   \
210   guix/scripts/import/hackage.scm               \
211   guix/scripts/import/elpa.scm                  \
212   guix/scripts/import/texlive.scm               \
213   guix/scripts/environment.scm                  \
214   guix/scripts/publish.scm                      \
215   guix/scripts/edit.scm                         \
216   guix/scripts/size.scm                         \
217   guix/scripts/graph.scm                        \
218   guix/scripts/container.scm                    \
219   guix/scripts/container/exec.scm               \
220   guix.scm                                      \
221   $(GNU_SYSTEM_MODULES)
223 if HAVE_GUILE_JSON
225 MODULES +=                                      \
226   guix/ci.scm                                   \
227   guix/docker.scm                               \
228   guix/import/cpan.scm                          \
229   guix/import/crate.scm                         \
230   guix/import/gem.scm                           \
231   guix/import/github.scm                        \
232   guix/import/gnome.scm                         \
233   guix/import/json.scm                          \
234   guix/import/pypi.scm                          \
235   guix/import/stackage.scm                      \
236   guix/scripts/import/crate.scm                 \
237   guix/scripts/import/gem.scm                   \
238   guix/scripts/import/json.scm                  \
239   guix/scripts/import/pypi.scm                  \
240   guix/scripts/import/stackage.scm              \
241   guix/scripts/weather.scm
243 endif
245 if HAVE_GUILE_SSH
247 MODULES +=                                      \
248   guix/ssh.scm                                  \
249   guix/scripts/copy.scm                         \
250   guix/store/ssh.scm
252 endif HAVE_GUILE_SSH
254 if BUILD_DAEMON_OFFLOAD
256 MODULES +=                                      \
257   guix/scripts/offload.scm
259 endif BUILD_DAEMON_OFFLOAD
261 # Scheme implementation of the build daemon and related functionality.
262 STORE_MODULES =                                 \
263   guix/store/database.scm                       \
264   guix/store/deduplication.scm
266 MODULES += $(STORE_MODULES)
268 # Internal modules with test suite support.
269 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
271 # Auxiliary files for packages.
272 AUX_FILES =                                             \
273   gnu/packages/aux-files/emacs/guix-emacs.el            \
274   gnu/packages/aux-files/linux-libre/4.17-arm.conf      \
275   gnu/packages/aux-files/linux-libre/4.17-arm64.conf    \
276   gnu/packages/aux-files/linux-libre/4.17-i686.conf     \
277   gnu/packages/aux-files/linux-libre/4.17-x86_64.conf   \
278   gnu/packages/aux-files/linux-libre/4.14-arm.conf      \
279   gnu/packages/aux-files/linux-libre/4.14-i686.conf     \
280   gnu/packages/aux-files/linux-libre/4.14-x86_64.conf   \
281   gnu/packages/aux-files/linux-libre/4.9-i686.conf      \
282   gnu/packages/aux-files/linux-libre/4.9-x86_64.conf    \
283   gnu/packages/aux-files/linux-libre/4.4-i686.conf      \
284   gnu/packages/aux-files/linux-libre/4.4-x86_64.conf    \
285   gnu/packages/aux-files/linux-libre/4.1-i686.conf      \
286   gnu/packages/aux-files/linux-libre/4.1-x86_64.conf    \
287   gnu/packages/aux-files/run-in-namespace.c
289 # Templates, examples.
290 EXAMPLES =                                      \
291   gnu/system/examples/bare-bones.tmpl           \
292   gnu/system/examples/beaglebone-black.tmpl     \
293   gnu/system/examples/desktop.tmpl              \
294   gnu/system/examples/lightweight-desktop.tmpl  \
295   gnu/system/examples/vm-image.tmpl
297 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
299 nobase_dist_guilemodule_DATA =                                  \
300   guix/store/schema.sql                                         \
301   $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES)   \
302   $(MISC_DISTRO_FILES)
303 nobase_nodist_guilemodule_DATA = guix/config.scm
304 nobase_nodist_guileobject_DATA = $(GOBJECTS)
306 # Handy way to remove the .go files without removing all the rest.
307 clean-go:
308         -$(RM) -f $(GOBJECTS)
309         @find . -name '*.go' -print | \
310           if test -t 1; then \
311             xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
312           else \
313             xargs -r echo "warning: stray .go files:"; \
314           fi
317 # Test extensions; has to be unconditional.
318 TEST_EXTENSIONS = .scm .sh
320 if CAN_RUN_TESTS
322 SCM_TESTS =                                     \
323   tests/base16.scm                              \
324   tests/base32.scm                              \
325   tests/base64.scm                              \
326   tests/cpio.scm                                \
327   tests/hash.scm                                \
328   tests/pk-crypto.scm                           \
329   tests/pki.scm                                 \
330   tests/print.scm                               \
331   tests/sets.scm                                \
332   tests/modules.scm                             \
333   tests/gnu-maintenance.scm                     \
334   tests/substitute.scm                          \
335   tests/builders.scm                            \
336   tests/derivations.scm                         \
337   tests/glob.scm                                \
338   tests/grafts.scm                              \
339   tests/ui.scm                                  \
340   tests/records.scm                             \
341   tests/upstream.scm                            \
342   tests/combinators.scm                         \
343   tests/discovery.scm                           \
344   tests/utils.scm                               \
345   tests/build-utils.scm                         \
346   tests/packages.scm                            \
347   tests/snix.scm                                \
348   tests/hackage.scm                             \
349   tests/cran.scm                                \
350   tests/elpa.scm                                \
351   tests/texlive.scm                             \
352   tests/store.scm                               \
353   tests/monads.scm                              \
354   tests/gexp.scm                                \
355   tests/nar.scm                                 \
356   tests/union.scm                               \
357   tests/profiles.scm                            \
358   tests/search-paths.scm                        \
359   tests/syscalls.scm                            \
360   tests/gremlin.scm                             \
361   tests/bournish.scm                            \
362   tests/lint.scm                                \
363   tests/publish.scm                             \
364   tests/scripts.scm                             \
365   tests/size.scm                                \
366   tests/graph.scm                               \
367   tests/challenge.scm                           \
368   tests/cache.scm                               \
369   tests/cve.scm                                 \
370   tests/workers.scm                             \
371   tests/zlib.scm                                \
372   tests/file-systems.scm                        \
373   tests/uuid.scm                                \
374   tests/system.scm                              \
375   tests/services.scm                            \
376   tests/scripts-build.scm                       \
377   tests/containers.scm                          \
378   tests/pack.scm                                \
379   tests/import-utils.scm                        \
380   tests/store-database.scm                      \
381   tests/store-deduplication.scm
383 if HAVE_GUILE_JSON
385 SCM_TESTS +=                                    \
386   tests/pypi.scm                                \
387   tests/cpan.scm                                \
388   tests/gem.scm                                 \
389   tests/crate.scm
391 endif
393 SH_TESTS =                                      \
394   tests/guix-build.sh                           \
395   tests/guix-download.sh                        \
396   tests/guix-gc.sh                              \
397   tests/guix-hash.sh                            \
398   tests/guix-pack.sh                            \
399   tests/guix-package.sh                         \
400   tests/guix-package-net.sh                     \
401   tests/guix-system.sh                          \
402   tests/guix-archive.sh                         \
403   tests/guix-authenticate.sh                    \
404   tests/guix-environment.sh                     \
405   tests/guix-environment-container.sh           \
406   tests/guix-graph.sh                           \
407   tests/guix-lint.sh
409 TESTS = $(SCM_TESTS) $(SH_TESTS)
411 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
413 SCM_LOG_DRIVER =                                \
414   $(top_builddir)/test-env --quiet-stderr       \
415   $(GUILE) --no-auto-compile -e main            \
416       $(top_srcdir)/build-aux/test-driver.scm
418 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
420 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
421 AM_SH_LOG_FLAGS = -x -e
423 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
424 # could end up removing files from the store while they are being used by
425 # other instances of the daemon.
426 tests/guix-gc.log:                                                      \
427   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
428   $(SCM_TESTS:%.scm=%.log)
430 else !CAN_RUN_TESTS
432 TESTS =
433 SH_TESTS =
434 SCM_TESTS =
436 # Automake always generates a 'check' target, so better not override it.
437 check-local:
438         @echo
439         @echo "Cannot run tests because file name limits would be exceeded." >&2
440         @echo "Look for 'length' in the 'config.log' file for details." >&2
441         @echo
442         @exit 1
444 endif !CAN_RUN_TESTS
446 check-system: $(GOBJECTS)
447         $(AM_V_at)$(top_builddir)/pre-inst-env                  \
448            $(GUILE) --no-auto-compile                           \
449            -e '(@@ (run-system-tests) run-system-tests)'        \
450            $(top_srcdir)/build-aux/run-system-tests.scm
452 # Public key used to sign substitutes from hydra.gnu.org & co.
453 dist_pkgdata_DATA =                             \
454   hydra.gnu.org.pub                             \
455   berlin.guixsd.org.pub
457 # Bash completion file.
458 dist_bashcompletion_DATA = etc/completion/bash/guix     \
459   etc/completion/bash/guix-daemon
461 # Zsh completion file.
462 dist_zshcompletion_DATA = etc/completion/zsh/_guix
464 # Fish completion file.
465 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
467 # SELinux policy
468 dist_selinux_policy_DATA = etc/guix-daemon.cil
470 EXTRA_DIST +=                                           \
471   HACKING                                               \
472   ROADMAP                                               \
473   TODO                                                  \
474   CODE-OF-CONDUCT                                       \
475   .dir-locals.el                                        \
476   scripts/guix.in                                       \
477   etc/guix-install.sh                                   \
478   build-aux/build-self.scm                              \
479   build-aux/compile-all.scm                             \
480   build-aux/hydra/evaluate.scm                          \
481   build-aux/hydra/gnu-system.scm                        \
482   build-aux/hydra/guix.scm                              \
483   build-aux/hydra/guix-modular.scm                      \
484   build-aux/cuirass/gnu-system.scm                      \
485   build-aux/cuirass/guix-modular.scm                    \
486   build-aux/cuirass/hydra-to-cuirass.scm                \
487   build-aux/check-available-binaries.scm                \
488   build-aux/check-final-inputs-self-contained.scm       \
489   build-aux/compile-as-derivation.scm                   \
490   build-aux/generate-authors.scm                        \
491   build-aux/test-driver.scm                             \
492   build-aux/update-guix-package.scm                     \
493   build-aux/update-NEWS.scm                             \
494   build-aux/run-system-tests.scm                        \
495   d3.v3.js                                              \
496   graph.js                                              \
497   srfi/srfi-64.scm                                      \
498   srfi/srfi-64.upstream.scm                             \
499   tests/test.drv                                        \
500   tests/signing-key.pub                                 \
501   tests/signing-key.sec                                 \
502   tests/cve-sample.xml                                  \
503   build-aux/config.rpath                                \
504   bootstrap                                             \
505   release.nix                                           \
506   $(TESTS)
508 if !BUILD_DAEMON_OFFLOAD
510 EXTRA_DIST +=                                   \
511   guix/scripts/offload.scm
513 endif !BUILD_DAEMON_OFFLOAD
516 CLEANFILES =                                    \
517   $(bin_SCRIPTS)                                \
518   $(GOBJECTS)                                   \
519   $(SCM_TESTS:tests/%.scm=%.log)
521 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling.  Otherwise, if
522 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
523 # there that are newer than the local .scm files (for instance because the
524 # user ran 'make install' recently).  When that happens, we end up loading
525 # those previously-installed .go files, which may be stale, thereby breaking
526 # the whole thing.  Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
527 # stale files from ~/.cache/guile/ccache.
528 %.go: make-go ; @:
529 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
530         $(AM_V_at)echo "Compiling Scheme modules..." ;                  \
531         unset GUILE_LOAD_COMPILED_PATH ;                                \
532         XDG_CACHE_HOME=/nowhere                                         \
533         host=$(host) srcdir="$(top_srcdir)"                             \
534         $(top_builddir)/pre-inst-env                                    \
535         $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)"                \
536           --no-auto-compile                                             \
537           -s "$(top_srcdir)"/build-aux/compile-all.scm $^
539 SUFFIXES = .go
541 # Make sure source files are installed first, so that the mtime of
542 # installed compiled files is greater than that of installed source
543 # files.  See
544 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
545 # for details.
546 guix_install_go_files = install-nobase_nodist_guileobjectDATA
547 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
549 # The above trick doesn't work for 'config.go' because both 'config.scm' and
550 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA).  Thus, give it
551 # special treatment.
552 install-data-hook: set-bootstrap-executable-permissions
553         touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
555 # Assuming Guix is already installed and the daemon is up and running, this
556 # rule builds from $(srcdir), creating and building derivations.
557 as-derivation:
558         $(AM_V_at)echo "Building Guix in Guix..." ;             \
559         $(GUILE) --no-auto-compile                              \
560           "$(top_srcdir)/build-aux/compile-as-derivation.scm"   \
561           "$(abs_top_srcdir)"
563 SUBDIRS = po/guix po/packages
564 BUILT_SOURCES =
566 include doc/local.mk
568 if BUILD_DAEMON
570 include nix/local.mk
572 endif BUILD_DAEMON
574 ACLOCAL_AMFLAGS = -I m4
576 # Pass an explicit '--localstatedir' so that configure does not error out if
577 # it finds an existing installation with a different localstatedir.  Inherit
578 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
579 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
580 # enough for shebangs.
581 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
582   --localstatedir="$$dc_install_base/var"       \
583   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
584   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
585   --with-nix-prefix="$(NIX_PREFIX)"             \
586   --enable-daemon                               \
587   ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
589 # The self-contained tarball.  Add 'glibc-utf8-locales' along with glibc just
590 # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
591 guix-binary.%.tar.xz:
592         $(AM_V_GEN)GUIX_PACKAGE_PATH=                                   \
593         tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz        \
594           -s "$*" --localstatedir guix glibc-utf8-locales               \
595           -e  '(@@ (gnu packages commencement) glibc-final)'` ;         \
596         cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
599 dist-hook: $(distdir)/ChangeLog gen-AUTHORS gen-tarball-version
600 dist-hook: assert-no-store-file-names
602 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
604 EXTRA_DIST += $(top_srcdir)/.version
605 BUILT_SOURCES += $(top_srcdir)/.version
606 $(top_srcdir)/.version:
607         echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
609 gen-tarball-version:
610         echo $(VERSION) > "$(distdir)/.tarball-version"
612 gen-ChangeLog $(distdir)/ChangeLog:
613         $(AM_V_GEN)if test -d .git; then                \
614           $(top_srcdir)/build-aux/gitlog-to-changelog   \
615             > $(distdir)/cl-t;                          \
616           rm -f $(distdir)/ChangeLog;                   \
617           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
618         fi
620 gen-AUTHORS:
621         $(AM_V_GEN)if test -d .git; then                        \
622           rm -f "$(distdir)/AUTHORS";                           \
623           $(top_builddir)/pre-inst-env "$(GUILE)"               \
624             "$(top_srcdir)/build-aux/generate-authors.scm"      \
625             "$(top_srcdir)" "$(distdir)/AUTHORS";               \
626         fi
630 # Release management.
633 releasedir = release-$(PACKAGE_VERSION)
635 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
637 # List of source tarballs produced.  This must be kept in sync with the
638 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
639 SOURCE_TARBALLS =                                       \
640   $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
642 # Systems supported by Guix.
643 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux
645 # Guix binary tarballs.
646 BINARY_TARBALLS =                                                       \
647   $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
649 # Systems supported by GuixSD.
650 GUIXSD_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
652 # Systems for which we build GuixSD VMs.
653 GUIXSD_VM_SYSTEMS ?= x86_64-linux
655 # Prefix of the GuixSD installation image file name.
656 GUIXSD_IMAGE_BASE = guixsd-install-$(PACKAGE_VERSION)
658 # Prefix of the GuixSD VM image file name.
659 GUIXSD_VM_IMAGE_BASE = guixsd-vm-image-$(PACKAGE_VERSION)
661 # The release process works in several phases:
663 #   0. We assume the developer created a 'vX.Y' tag.
664 #   1. Build the source tarball.
665 #   2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
666 #   3. Build the binary tarballs for that 'guix' package.
667 #   4. Update the 'guix' package again.
668 #   5. Build the GuixSD installation images.  The images will run 'guix'
669 #      corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
671 # This 'release' target takes care of everything and copies the resulting
672 # files to $(releasedir).
674 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
675 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
676 release: dist
677         cd po; git checkout .
678         @if ! git diff-index --quiet HEAD; then                 \
679           echo "There are uncommitted changes; stopping." >&2 ; \
680           exit 1 ;                                              \
681         fi
682         $(MKDIR_P) "$(releasedir)"
683         rm -f "$(releasedir)"/*
684         mv $(SOURCE_TARBALLS) "$(releasedir)"
685         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
686            $(top_srcdir)/build-aux/update-guix-package.scm      \
687            "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
688         git add $(top_srcdir)/gnu/packages/package-management.scm
689         git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
690         rm -f $(BINARY_TARBALLS)
691         $(MAKE) $(BINARY_TARBALLS)
692         for system in $(SUPPORTED_SYSTEMS) ; do                                 \
693           mv "guix-binary.$$system.tar.xz"                                      \
694               "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ;  \
695         done
696         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
697            $(top_srcdir)/build-aux/update-guix-package.scm      \
698            "`git rev-parse HEAD`"
699         git add $(top_srcdir)/gnu/packages/package-management.scm
700         git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
701         for system in $(GUIXSD_SUPPORTED_SYSTEMS) ; do                                  \
702           image=`$(top_builddir)/pre-inst-env                                           \
703             guix system disk-image                                                      \
704             --file-system-type=iso9660                                                  \
705             --system=$$system                                                           \
706             gnu/system/install.scm` ;                                                   \
707           if [ ! -f "$$image" ] ; then                                                  \
708             echo "failed to produced GuixSD installation image for $$system" >&2 ;      \
709             exit 1 ;                                                                    \
710           fi ;                                                                          \
711           xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz.tmp" ;   \
712           mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz.tmp"                   \
713              "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.iso.xz" ;                     \
714         done
715         for system in $(GUIXSD_VM_SYSTEMS) ; do                                         \
716           image=`$(top_builddir)/pre-inst-env                                           \
717             guix system vm-image                                                        \
718             --system=$$system                                                           \
719             gnu/system/examples/vm-image.tmpl` ;                                        \
720           if [ ! -f "$$image" ] ; then                                                  \
721             echo "failed to produced GuixSD VM image for $$system" >&2 ;                \
722             exit 1 ;                                                                    \
723           fi ;                                                                          \
724           xz < "$$image" > "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp" ;    \
725           mv "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp"                    \
726              "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz" ;                      \
727         done
728         @echo
729         @echo "Congratulations!  All the release files are now in $(releasedir)."
730         @echo
732 update-guix-package:
733         git rev-parse HEAD
734         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
735            $(top_srcdir)/build-aux/update-guix-package.scm      \
736            "`git rev-parse HEAD`"
738 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
739 # Package data from this checkout is used by 'update-NEWS.scm'.
740 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
742 update-NEWS: $(GOBJECTS)
743         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
744           $(top_srcdir)/build-aux/update-NEWS.scm                       \
745           $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
747 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
748 assert-no-store-file-names: $(distdir)/ChangeLog
749         $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info                  \
750              --exclude=*.info-[0-9] --exclude=*.dot                             \
751              --exclude=*.eps --exclude-dir=bootstrap                            \
752                  --exclude=guix-manual.pot --exclude=guix-manual.*.po           \
753              --exclude=guix-prettify.el                                         \
754              --exclude=ChangeLog                                                \
755              -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                        \
756         then                                                                    \
757           echo "error: store file names embedded in the distribution" >&2 ;     \
758           exit 1 ;                                                              \
759         fi
761 # Make sure hydra.gnu.org has the important binaries.
762 assert-binaries-available: $(GOBJECTS)
763         $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)"                       \
764           "$(top_srcdir)/build-aux/check-available-binaries.scm"
766 # Make sure the final inputs don't refer to bootstrap tools.
767 assert-final-inputs-self-contained: $(GOBJECTS)
768         $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)"                       \
769           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
771 # Compute the Hydra jobs and write them in the target file.
772 hydra-jobs.scm: $(GOBJECTS)
773         $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
774         $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)"              \
775           "$(top_srcdir)/build-aux/hydra/evaluate.scm"                  \
776           "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
777         $(AM_V_at)mv "$@.tmp" "$@"
779 # Compute the Cuirass jobs and write them in the target file.
780 cuirass-jobs.scm: $(GOBJECTS)
781         $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
782         $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)"              \
783           "$(top_srcdir)/build-aux/hydra/evaluate.scm"                  \
784           "$(top_srcdir)/build-aux/cuirass/gnu-system.scm"              \
785           cuirass > "$@.tmp"
786         $(AM_V_at)mv "$@.tmp" "$@"
788 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
789 .PHONY: assert-no-store-file-names assert-binaries-available
790 .PHONY: assert-final-inputs-self-contained
791 .PHONY: clean-go make-go as-derivation
792 .PHONY: update-guix-package update-NEWS release
794 ## -------------- ##
795 ## Silent rules.  ##
796 ## -------------- ##
798 AM_V_DL = $(AM_V_DL_$(V))
799 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
800 AM_V_DL_0 = @echo "  DL      " $@;
802 AM_V_DOT = $(AM_V_DOT_$(V))
803 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
804 AM_V_DOT_0 = @echo "  DOT     " $@;
806 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
807 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
808 AM_V_HELP2MAN_0 = @echo "  HELP2MAN" $@;
810 AM_V_PO4A = $(AM_V_PO4A_$(V))
811 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
812 AM_V_PO4A_0 = @echo "  PO4A" $@;
814 AM_V_POXREF = $(AM_V_POXREF_$(V))
815 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
816 AM_V_POXREF_0 = @echo "  POXREF" $@;