Fix ambiguous imports.
[guix.git] / Makefile.am
blobfd6f9729c9a8401c1e8474fce1b0a0e4d1dc5766
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016, 2017 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>
12 # This file is part of GNU Guix.
14 # GNU Guix is free software; you can redistribute it and/or modify it
15 # under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 3 of the License, or (at
17 # your option) any later version.
19 # GNU Guix is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
27 bin_SCRIPTS =                                   \
28   scripts/guix
30 nodist_noinst_SCRIPTS =                         \
31   pre-inst-env                                  \
32   test-env
34 # Modules that are not compiled but are installed nonetheless, such as
35 # build-side modules with unusual dependencies.
36 MODULES_NOT_COMPILED =
38 include gnu/local.mk
40 MODULES =                                       \
41   guix/base16.scm                               \
42   guix/base32.scm                               \
43   guix/base64.scm                               \
44   guix/cpio.scm                                 \
45   guix/records.scm                              \
46   guix/gcrypt.scm                               \
47   guix/hash.scm                                 \
48   guix/pk-crypto.scm                            \
49   guix/pki.scm                                  \
50   guix/progress.scm                             \
51   guix/combinators.scm                          \
52   guix/memoization.scm                          \
53   guix/utils.scm                                \
54   guix/sets.scm                                 \
55   guix/modules.scm                              \
56   guix/download.scm                             \
57   guix/discovery.scm                            \
58   guix/git-download.scm                         \
59   guix/hg-download.scm                          \
60   guix/monads.scm                               \
61   guix/monad-repl.scm                           \
62   guix/gexp.scm                                 \
63   guix/profiles.scm                             \
64   guix/serialization.scm                        \
65   guix/nar.scm                                  \
66   guix/derivations.scm                          \
67   guix/grafts.scm                               \
68   guix/gnu-maintenance.scm                      \
69   guix/upstream.scm                             \
70   guix/licenses.scm                             \
71   guix/git.scm                                  \
72   guix/graph.scm                                \
73   guix/cache.scm                                \
74   guix/cve.scm                                  \
75   guix/workers.scm                              \
76   guix/zlib.scm                                 \
77   guix/build-system.scm                         \
78   guix/build-system/ant.scm                     \
79   guix/build-system/cargo.scm                   \
80   guix/build-system/cmake.scm                   \
81   guix/build-system/dub.scm                     \
82   guix/build-system/emacs.scm                   \
83   guix/build-system/font.scm                    \
84   guix/build-system/go.scm                      \
85   guix/build-system/meson.scm                   \
86   guix/build-system/minify.scm                  \
87   guix/build-system/asdf.scm                    \
88   guix/build-system/glib-or-gtk.scm             \
89   guix/build-system/gnu.scm                     \
90   guix/build-system/haskell.scm                 \
91   guix/build-system/perl.scm                    \
92   guix/build-system/python.scm                  \
93   guix/build-system/ocaml.scm                   \
94   guix/build-system/waf.scm                     \
95   guix/build-system/r.scm                       \
96   guix/build-system/ruby.scm                    \
97   guix/build-system/texlive.scm                 \
98   guix/build-system/trivial.scm                 \
99   guix/ftp-client.scm                           \
100   guix/http-client.scm                          \
101   guix/gnupg.scm                                \
102   guix/elf.scm                                  \
103   guix/store.scm                                \
104   guix/cvs-download.scm                         \
105   guix/svn-download.scm                         \
106   guix/ui.scm                                   \
107   guix/build/ant-build-system.scm               \
108   guix/build/download.scm                       \
109   guix/build/download-nar.scm                   \
110   guix/build/cargo-build-system.scm             \
111   guix/build/cmake-build-system.scm             \
112   guix/build/dub-build-system.scm               \
113   guix/build/emacs-build-system.scm             \
114   guix/build/meson-build-system.scm             \
115   guix/build/minify-build-system.scm            \
116   guix/build/font-build-system.scm              \
117   guix/build/go-build-system.scm                \
118   guix/build/asdf-build-system.scm              \
119   guix/build/git.scm                            \
120   guix/build/hg.scm                             \
121   guix/build/glib-or-gtk-build-system.scm       \
122   guix/build/gnu-build-system.scm               \
123   guix/build/gnu-dist.scm                       \
124   guix/build/perl-build-system.scm              \
125   guix/build/python-build-system.scm            \
126   guix/build/ocaml-build-system.scm             \
127   guix/build/r-build-system.scm                 \
128   guix/build/ruby-build-system.scm              \
129   guix/build/texlive-build-system.scm           \
130   guix/build/waf-build-system.scm               \
131   guix/build/haskell-build-system.scm           \
132   guix/build/store-copy.scm                     \
133   guix/build/utils.scm                          \
134   guix/build/union.scm                          \
135   guix/build/profiles.scm                       \
136   guix/build/compile.scm                        \
137   guix/build/pull.scm                           \
138   guix/build/rpath.scm                          \
139   guix/build/cvs.scm                            \
140   guix/build/svn.scm                            \
141   guix/build/syscalls.scm                       \
142   guix/build/gremlin.scm                        \
143   guix/build/emacs-utils.scm                    \
144   guix/build/java-utils.scm                     \
145   guix/build/lisp-utils.scm                     \
146   guix/build/graft.scm                          \
147   guix/build/bournish.scm                       \
148   guix/build/qt-utils.scm                       \
149   guix/build/make-bootstrap.scm                 \
150   guix/search-paths.scm                         \
151   guix/packages.scm                             \
152   guix/import/print.scm                         \
153   guix/import/utils.scm                         \
154   guix/import/gnu.scm                           \
155   guix/import/snix.scm                          \
156   guix/import/cabal.scm                         \
157   guix/import/cran.scm                          \
158   guix/import/hackage.scm                       \
159   guix/import/elpa.scm                          \
160   guix/import/texlive.scm                       \
161   guix/scripts.scm                              \
162   guix/scripts/download.scm                     \
163   guix/scripts/perform-download.scm             \
164   guix/scripts/build.scm                        \
165   guix/scripts/archive.scm                      \
166   guix/scripts/import.scm                       \
167   guix/scripts/package.scm                      \
168   guix/scripts/gc.scm                           \
169   guix/scripts/hash.scm                         \
170   guix/scripts/pack.scm                         \
171   guix/scripts/pull.scm                         \
172   guix/scripts/substitute.scm                   \
173   guix/scripts/authenticate.scm                 \
174   guix/scripts/refresh.scm                      \
175   guix/scripts/system.scm                       \
176   guix/scripts/system/search.scm                \
177   guix/scripts/lint.scm                         \
178   guix/scripts/challenge.scm                    \
179   guix/scripts/import/cran.scm                  \
180   guix/scripts/import/gnu.scm                   \
181   guix/scripts/import/nix.scm                   \
182   guix/scripts/import/hackage.scm               \
183   guix/scripts/import/json.scm                  \
184   guix/scripts/import/elpa.scm                  \
185   guix/scripts/import/texlive.scm               \
186   guix/scripts/environment.scm                  \
187   guix/scripts/publish.scm                      \
188   guix/scripts/weather.scm                      \
189   guix/scripts/edit.scm                         \
190   guix/scripts/size.scm                         \
191   guix/scripts/graph.scm                        \
192   guix/scripts/container.scm                    \
193   guix/scripts/container/exec.scm               \
194   guix.scm                                      \
195   $(GNU_SYSTEM_MODULES)
197 if HAVE_GUILE_JSON
199 MODULES +=                                      \
200   guix/docker.scm                               \
201   guix/import/cpan.scm                          \
202   guix/import/crate.scm                         \
203   guix/import/gem.scm                           \
204   guix/import/github.scm                        \
205   guix/import/gnome.scm                         \
206   guix/import/json.scm                          \
207   guix/import/pypi.scm                          \
208   guix/import/stackage.scm                      \
209   guix/scripts/import/crate.scm                 \
210   guix/scripts/import/gem.scm                   \
211   guix/scripts/import/pypi.scm                  \
212   guix/scripts/import/stackage.scm
214 endif
216 if HAVE_GUILE_SSH
218 MODULES +=                                      \
219   guix/ssh.scm                                  \
220   guix/scripts/copy.scm                         \
221   guix/store/ssh.scm
223 endif HAVE_GUILE_SSH
225 if BUILD_DAEMON_OFFLOAD
227 MODULES +=                                      \
228   guix/scripts/offload.scm
230 endif BUILD_DAEMON_OFFLOAD
232 # Internal modules with test suite support.
233 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
235 # Auxiliary files for packages.
236 AUX_FILES =                                             \
237   gnu/packages/aux-files/emacs/guix-emacs.el            \
238   gnu/packages/aux-files/linux-libre/4.13-i686.conf     \
239   gnu/packages/aux-files/linux-libre/4.13-x86_64.conf   \
240   gnu/packages/aux-files/linux-libre/4.9-i686.conf      \
241   gnu/packages/aux-files/linux-libre/4.9-x86_64.conf    \
242   gnu/packages/aux-files/linux-libre/4.4-i686.conf      \
243   gnu/packages/aux-files/linux-libre/4.4-x86_64.conf    \
244   gnu/packages/aux-files/linux-libre/4.1-i686.conf      \
245   gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
247 # Templates, examples.
248 EXAMPLES =                                      \
249   gnu/system/examples/bare-bones.tmpl           \
250   gnu/system/examples/desktop.tmpl              \
251   gnu/system/examples/lightweight-desktop.tmpl  \
252   gnu/system/examples/vm-image.tmpl
254 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
256 nobase_dist_guilemodule_DATA =                                  \
257   $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES)   \
258   $(MISC_DISTRO_FILES)
259 nobase_nodist_guilemodule_DATA = guix/config.scm
260 nobase_nodist_guileobject_DATA = $(GOBJECTS)
262 # Handy way to remove the .go files without removing all the rest.
263 clean-go:
264         -$(RM) -f $(GOBJECTS)
265         @find . -name '*.go' -print | \
266           if test -t 1; then \
267             xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
268           else \
269             xargs -r echo "warning: stray .go files:"; \
270           fi
273 # Test extensions; has to be unconditional.
274 TEST_EXTENSIONS = .scm .sh
276 if CAN_RUN_TESTS
278 SCM_TESTS =                                     \
279   tests/base16.scm                              \
280   tests/base32.scm                              \
281   tests/base64.scm                              \
282   tests/cpio.scm                                \
283   tests/hash.scm                                \
284   tests/pk-crypto.scm                           \
285   tests/pki.scm                                 \
286   tests/print.scm                               \
287   tests/sets.scm                                \
288   tests/modules.scm                             \
289   tests/gnu-maintenance.scm                     \
290   tests/substitute.scm                          \
291   tests/builders.scm                            \
292   tests/derivations.scm                         \
293   tests/grafts.scm                              \
294   tests/ui.scm                                  \
295   tests/records.scm                             \
296   tests/upstream.scm                            \
297   tests/combinators.scm                         \
298   tests/discovery.scm                           \
299   tests/utils.scm                               \
300   tests/build-utils.scm                         \
301   tests/packages.scm                            \
302   tests/snix.scm                                \
303   tests/hackage.scm                             \
304   tests/cran.scm                                \
305   tests/elpa.scm                                \
306   tests/texlive.scm                             \
307   tests/store.scm                               \
308   tests/monads.scm                              \
309   tests/gexp.scm                                \
310   tests/nar.scm                                 \
311   tests/union.scm                               \
312   tests/profiles.scm                            \
313   tests/search-paths.scm                        \
314   tests/syscalls.scm                            \
315   tests/gremlin.scm                             \
316   tests/bournish.scm                            \
317   tests/lint.scm                                \
318   tests/publish.scm                             \
319   tests/scripts.scm                             \
320   tests/size.scm                                \
321   tests/graph.scm                               \
322   tests/challenge.scm                           \
323   tests/cache.scm                               \
324   tests/cve.scm                                 \
325   tests/workers.scm                             \
326   tests/zlib.scm                                \
327   tests/file-systems.scm                        \
328   tests/uuid.scm                                \
329   tests/system.scm                              \
330   tests/services.scm                            \
331   tests/scripts-build.scm                       \
332   tests/containers.scm                          \
333   tests/pack.scm                                \
334   tests/import-utils.scm
336 if HAVE_GUILE_JSON
338 SCM_TESTS +=                                    \
339   tests/pypi.scm                                \
340   tests/cpan.scm                                \
341   tests/gem.scm                                 \
342   tests/crate.scm
344 endif
346 SH_TESTS =                                      \
347   tests/guix-build.sh                           \
348   tests/guix-download.sh                        \
349   tests/guix-gc.sh                              \
350   tests/guix-hash.sh                            \
351   tests/guix-package.sh                         \
352   tests/guix-package-net.sh                     \
353   tests/guix-system.sh                          \
354   tests/guix-archive.sh                         \
355   tests/guix-authenticate.sh                    \
356   tests/guix-environment.sh                     \
357   tests/guix-environment-container.sh           \
358   tests/guix-graph.sh                           \
359   tests/guix-lint.sh
361 if BUILD_DAEMON
363 SH_TESTS += tests/guix-register.sh
365 endif BUILD_DAEMON
368 TESTS = $(SCM_TESTS) $(SH_TESTS)
370 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
372 SCM_LOG_DRIVER =                                \
373   $(top_builddir)/test-env --quiet-stderr       \
374   $(GUILE) --no-auto-compile -e main            \
375       $(top_srcdir)/build-aux/test-driver.scm
377 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
379 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
380 AM_SH_LOG_FLAGS = -x -e
382 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
383 # could end up removing files from the store while they are being used by
384 # other instances of the daemon.
385 tests/guix-gc.log:                                                      \
386   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
387   $(SCM_TESTS:%.scm=%.log)
389 else !CAN_RUN_TESTS
391 TESTS =
392 SH_TESTS =
393 SCM_TESTS =
395 # Automake always generates a 'check' target, so better not override it.
396 check-local:
397         @echo
398         @echo "Cannot run tests because file name limits would be exceeded." >&2
399         @echo "Look for 'length' in the 'config.log' file for details." >&2
400         @echo
401         @exit 1
403 endif !CAN_RUN_TESTS
405 check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
406         $(AM_V_at)$(top_builddir)/pre-inst-env                  \
407            $(GUILE) --no-auto-compile                           \
408            -e '(@@ (run-system-tests) run-system-tests)'        \
409            $(top_srcdir)/build-aux/run-system-tests.scm
411 # Public key used to sign substitutes from hydra.gnu.org & co.
412 dist_pkgdata_DATA =                             \
413   hydra.gnu.org.pub                             \
414   bayfront.guixsd.org.pub
416 # Bash completion file.
417 dist_bashcompletion_DATA = etc/completion/bash/guix
419 # Zsh completion file.
420 dist_zshcompletion_DATA = etc/completion/zsh/_guix
422 EXTRA_DIST =                                            \
423   HACKING                                               \
424   ROADMAP                                               \
425   TODO                                                  \
426   CODE-OF-CONDUCT                                       \
427   .dir-locals.el                                        \
428   build-aux/build-self.scm                              \
429   build-aux/compile-all.scm                             \
430   build-aux/hydra/evaluate.scm                          \
431   build-aux/hydra/gnu-system.scm                        \
432   build-aux/hydra/guix.scm                              \
433   build-aux/check-available-binaries.scm                \
434   build-aux/check-final-inputs-self-contained.scm       \
435   build-aux/download.scm                                \
436   build-aux/generate-authors.scm                        \
437   build-aux/test-driver.scm                             \
438   build-aux/update-guix-package.scm                     \
439   build-aux/update-NEWS.scm                             \
440   build-aux/run-system-tests.scm                        \
441   d3.v3.js                                              \
442   graph.js                                              \
443   srfi/srfi-64.scm                                      \
444   srfi/srfi-64.upstream.scm                             \
445   tests/test.drv                                        \
446   tests/signing-key.pub                                 \
447   tests/signing-key.sec                                 \
448   tests/cve-sample.xml                                  \
449   build-aux/config.rpath                                \
450   bootstrap                                             \
451   release.nix                                           \
452   $(TESTS)
454 if !BUILD_DAEMON_OFFLOAD
456 EXTRA_DIST +=                                   \
457   guix/scripts/offload.scm
459 endif !BUILD_DAEMON_OFFLOAD
462 CLEANFILES =                                    \
463   $(GOBJECTS)                                   \
464   $(SCM_TESTS:tests/%.scm=%.log)
466 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling.  Otherwise, if
467 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
468 # there that are newer than the local .scm files (for instance because the
469 # user ran 'make install' recently).  When that happens, we end up loading
470 # those previously-installed .go files, which may be stale, thereby breaking
471 # the whole thing.  Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
472 # stale files from ~/.cache/guile/ccache.
473 %.go: make-go ; @:
474 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
475         $(AM_V_at)echo "Compiling Scheme modules..." ;                  \
476         unset GUILE_LOAD_COMPILED_PATH ;                                \
477         XDG_CACHE_HOME=/nowhere                                         \
478         host=$(host) srcdir="$(top_srcdir)"                             \
479         $(top_builddir)/pre-inst-env                                    \
480         $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)"                \
481           --no-auto-compile                                             \
482           -s "$(top_srcdir)"/build-aux/compile-all.scm $^
484 SUFFIXES = .go
486 # Make sure source files are installed first, so that the mtime of
487 # installed compiled files is greater than that of installed source
488 # files.  See
489 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
490 # for details.
491 guix_install_go_files = install-nobase_nodist_guileobjectDATA
492 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
494 # The above trick doesn't work for 'config.go' because both 'config.scm' and
495 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA).  Thus, give it
496 # special treatment.
497 install-data-hook: set-bootstrap-executable-permissions
498         touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
501 SUBDIRS = po/guix po/packages
502 BUILT_SOURCES =
504 include doc/local.mk
506 if BUILD_DAEMON
508 include nix/local.mk
510 endif BUILD_DAEMON
512 ACLOCAL_AMFLAGS = -I m4
514 # Pass an explicit '--localstatedir' so that configure does not error out if
515 # it finds an existing installation with a different localstatedir.  Inherit
516 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
517 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
518 # enough for shebangs.
519 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
520   --localstatedir="$$dc_install_base/var"       \
521   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
522   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
523   --with-nix-prefix="$(NIX_PREFIX)"             \
524   --enable-daemon                               \
525   ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
527 # The self-contained tarball.  Add 'glibc-utf8-locales' along with glibc just
528 # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
529 guix-binary.%.tar.xz:
530         $(AM_V_GEN)GUIX_PACKAGE_PATH=                                   \
531         tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz        \
532           -s "$*" --localstatedir guix glibc-utf8-locales               \
533           -e  '(@@ (gnu packages commencement) glibc-final)'` ;         \
534         cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
537 dist-hook: $(distdir)/ChangeLog gen-AUTHORS gen-tarball-version
538 dist-hook: assert-no-store-file-names
540 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
542 EXTRA_DIST += $(top_srcdir)/.version
543 BUILT_SOURCES += $(top_srcdir)/.version
544 $(top_srcdir)/.version:
545         echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
547 gen-tarball-version:
548         echo $(VERSION) > "$(distdir)/.tarball-version"
550 gen-ChangeLog $(distdir)/ChangeLog:
551         $(AM_V_GEN)if test -d .git; then                \
552           $(top_srcdir)/build-aux/gitlog-to-changelog   \
553             > $(distdir)/cl-t;                          \
554           rm -f $(distdir)/ChangeLog;                   \
555           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
556         fi
558 gen-AUTHORS:
559         $(AM_V_GEN)if test -d .git; then                        \
560           rm -f "$(distdir)/AUTHORS";                           \
561           $(top_builddir)/pre-inst-env "$(GUILE)"               \
562             "$(top_srcdir)/build-aux/generate-authors.scm"      \
563             "$(top_srcdir)" "$(distdir)/AUTHORS";               \
564         fi
568 # Release management.
571 releasedir = release-$(PACKAGE_VERSION)
573 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
575 # List of source tarballs produced.  This must be kept in sync with the
576 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
577 SOURCE_TARBALLS =                                       \
578   $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
580 # Systems supported by Guix.
581 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux
583 # Guix binary tarballs.
584 BINARY_TARBALLS =                                                       \
585   $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
587 # Systems supported by GuixSD.
588 GUIXSD_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
590 # Systems for which we build GuixSD VMs.
591 GUIXSD_VM_SYSTEMS ?= x86_64-linux
593 # Prefix of the GuixSD installation image file name.
594 GUIXSD_IMAGE_BASE = guixsd-install-$(PACKAGE_VERSION)
596 # Prefix of the GuixSD VM image file name.
597 GUIXSD_VM_IMAGE_BASE = guixsd-vm-image-$(PACKAGE_VERSION)
599 # Size of the VM image (for x86_64 typically).
600 GUIXSD_VM_IMAGE_SIZE ?= 2GiB
602 # The release process works in several phases:
604 #   0. We assume the developer created a 'vX.Y' tag.
605 #   1. Build the source tarball.
606 #   2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
607 #   3. Build the binary tarballs for that 'guix' package.
608 #   4. Update the 'guix' package again.
609 #   5. Build the GuixSD installation images.  The images will run 'guix'
610 #      corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
612 # This 'release' target takes care of everything and copies the resulting
613 # files to $(releasedir).
615 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
616 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
617 release: dist
618         cd po; git checkout .
619         @if ! git diff-index --quiet HEAD; then                 \
620           echo "There are uncommitted changes; stopping." >&2 ; \
621           exit 1 ;                                              \
622         fi
623         $(MKDIR_P) "$(releasedir)"
624         rm -f "$(releasedir)"/*
625         mv $(SOURCE_TARBALLS) "$(releasedir)"
626         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
627            $(top_srcdir)/build-aux/update-guix-package.scm      \
628            "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
629         git add $(top_srcdir)/gnu/packages/package-management.scm
630         git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
631         rm -f $(BINARY_TARBALLS)
632         $(MAKE) $(BINARY_TARBALLS)
633         for system in $(SUPPORTED_SYSTEMS) ; do                                 \
634           mv "guix-binary.$$system.tar.xz"                                      \
635               "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ;  \
636         done
637         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
638            $(top_srcdir)/build-aux/update-guix-package.scm      \
639            "`git rev-parse HEAD`"
640         git add $(top_srcdir)/gnu/packages/package-management.scm
641         git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
642         for system in $(GUIXSD_SUPPORTED_SYSTEMS) ; do                                  \
643           image=`$(top_builddir)/pre-inst-env                                           \
644             guix system disk-image                                                      \
645             --file-system-type=iso9660                                                  \
646             --system=$$system                                                           \
647             gnu/system/install.scm` ;                                                   \
648           if [ ! -f "$$image" ] ; then                                                  \
649             echo "failed to produced GuixSD installation image for $$system" >&2 ;      \
650             exit 1 ;                                                                    \
651           fi ;                                                                          \
652           xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" ;       \
653           mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp"                       \
654              "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz" ;                         \
655         done
656         for system in $(GUIXSD_VM_SYSTEMS) ; do                                         \
657           image=`$(top_builddir)/pre-inst-env                                           \
658             guix system vm-image                                                        \
659             --system=$$system                                                           \
660             --image-size=$(GUIXSD_VM_IMAGE_SIZE)                                        \
661             gnu/system/examples/vm-image.tmpl` ;                                        \
662           if [ ! -f "$$image" ] ; then                                                  \
663             echo "failed to produced GuixSD VM image for $$system" >&2 ;                \
664             exit 1 ;                                                                    \
665           fi ;                                                                          \
666           xz < "$$image" > "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp" ;    \
667           mv "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz.tmp"                    \
668              "$(releasedir)/$(GUIXSD_VM_IMAGE_BASE).$$system.xz" ;                      \
669         done
670         @echo
671         @echo "Congratulations!  All the release files are now in $(releasedir)."
672         @echo
674 update-guix-package:
675         git rev-parse HEAD
676         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
677            $(top_srcdir)/build-aux/update-guix-package.scm      \
678            "`git rev-parse HEAD`"
680 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
681 # Package data from this checkout is used by 'update-NEWS.scm'.
682 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
684 update-NEWS: $(GOBJECTS)
685         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
686           $(top_srcdir)/build-aux/update-NEWS.scm                       \
687           $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
689 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
690 assert-no-store-file-names: $(distdir)/ChangeLog
691         $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info                  \
692              --exclude=*.info-[0-9] --exclude=*.dot                             \
693              --exclude=*.eps --exclude-dir=bootstrap                            \
694              --exclude=guix-prettify.el                                         \
695              --exclude=ChangeLog                                                \
696              -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                        \
697         then                                                                    \
698           echo "error: store file names embedded in the distribution" >&2 ;     \
699           exit 1 ;                                                              \
700         fi
702 # Make sure hydra.gnu.org has the important binaries.
703 assert-binaries-available: $(GOBJECTS)
704         $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)"                       \
705           "$(top_srcdir)/build-aux/check-available-binaries.scm"
707 # Make sure the final inputs don't refer to bootstrap tools.
708 assert-final-inputs-self-contained: $(GOBJECTS)
709         $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)"                       \
710           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
712 # Compute the Hydra jobs and write them in the target file.
713 hydra-jobs.scm: $(GOBJECTS)
714         $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
715         $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)"              \
716           "$(top_srcdir)/build-aux/hydra/evaluate.scm"                  \
717           "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
718         $(AM_V_at)mv "$@.tmp" "$@"
720 # Compute the Cuirass jobs and write them in the target file.
721 cuirass-jobs.scm: $(GOBJECTS)
722         $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
723         $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)"              \
724           "$(top_srcdir)/build-aux/hydra/evaluate.scm"                  \
725           "$(top_srcdir)/build-aux/cuirass/gnu-system.scm"              \
726           cuirass > "$@.tmp"
727         $(AM_V_at)mv "$@.tmp" "$@"
729 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
730 .PHONY: assert-no-store-file-names assert-binaries-available
731 .PHONY: assert-final-inputs-self-contained
732 .PHONY: clean-go make-go
733 .PHONY: update-guix-package update-NEWS release
735 ## -------------- ##
736 ## Silent rules.  ##
737 ## -------------- ##
739 AM_V_DL = $(AM_V_DL_$(V))
740 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
741 AM_V_DL_0 = @echo "  DL      " $@;
743 AM_V_DOT = $(AM_V_DOT_$(V))
744 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
745 AM_V_DOT_0 = @echo "  DOT     " $@;
747 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
748 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
749 AM_V_HELP2MAN_0 = @echo "  HELP2MAN" $@;