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