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