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