maint: update-guix-package: Protect the checkout from GC.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
fcd75bdb 2# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
7994250f 4# Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
8c3d8894 5# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
52d901da 6# Copyright © 2016, 2017 Mark H Weaver <mhw@netris.org>
960887b2 7# Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
af51c820 8#
233e7676 9# This file is part of GNU Guix.
af51c820 10#
233e7676 11# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
12# under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 3 of the License, or (at
14# your option) any later version.
15#
233e7676 16# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
17# WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
233e7676 22# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 23
c52a5bf0 24bin_SCRIPTS = \
e49951eb 25 scripts/guix
14a1c319 26
58867ae7
MW
27nodist_noinst_SCRIPTS = \
28 pre-inst-env \
29 test-env
30
4aabc8ea
LC
31# Modules that are not compiled but are installed nonetheless, such as
32# build-side modules with unusual dependencies.
33MODULES_NOT_COMPILED =
34
03d0e2d2 35include gnu/local.mk
d516736c 36
af51c820 37MODULES = \
4c0c4db0 38 guix/base16.scm \
ddc29a78 39 guix/base32.scm \
e9c6c584 40 guix/base64.scm \
7a18c3cc 41 guix/cpio.scm \
c0cd1b3e 42 guix/records.scm \
4862bc4a 43 guix/gcrypt.scm \
72626a71 44 guix/hash.scm \
3476ded9 45 guix/pk-crypto.scm \
8b420f74 46 guix/pki.scm \
958dd3ce 47 guix/combinators.scm \
f9704f17 48 guix/memoization.scm \
73fbb904 49 guix/utils.scm \
d326767e 50 guix/sets.scm \
7ca87354 51 guix/modules.scm \
de1355f1 52 guix/download.scm \
cd903ef7 53 guix/discovery.scm \
9b5b5c17 54 guix/git-download.scm \
c4e48b68 55 guix/hg-download.scm \
b860f382 56 guix/monads.scm \
b9b86078 57 guix/monad-repl.scm \
21b679f6 58 guix/gexp.scm \
cc4ecc2d 59 guix/profiles.scm \
0f41c26f
LC
60 guix/serialization.scm \
61 guix/nar.scm \
af51c820 62 guix/derivations.scm \
7adf9b84 63 guix/grafts.scm \
22189ed1 64 guix/gnu-maintenance.scm \
0a7c5a09 65 guix/upstream.scm \
838d78e3 66 guix/licenses.scm \
8fb58371 67 guix/graph.scm \
2ea2aac6 68 guix/cache.scm \
0eef7551 69 guix/cve.scm \
1563d6c7 70 guix/workers.scm \
72153902 71 guix/zlib.scm \
208f7cd1 72 guix/build-system.scm \
5f7a1a4d 73 guix/build-system/ant.scm \
4b3cb7f4 74 guix/build-system/cargo.scm \
c6bded8a 75 guix/build-system/cmake.scm \
65e862d1 76 guix/build-system/dub.scm \
e9137a53 77 guix/build-system/emacs.scm \
a1b30f99 78 guix/build-system/asdf.scm \
be3425e5 79 guix/build-system/glib-or-gtk.scm \
208f7cd1 80 guix/build-system/gnu.scm \
ce6fc7d6 81 guix/build-system/haskell.scm \
08fd1ebe 82 guix/build-system/perl.scm \
40506d5d 83 guix/build-system/python.scm \
e6876cb9 84 guix/build-system/ocaml.scm \
a677c726 85 guix/build-system/waf.scm \
f8f3bef6 86 guix/build-system/r.scm \
c08f9818 87 guix/build-system/ruby.scm \
be13fbfa 88 guix/build-system/trivial.scm \
457dd86d 89 guix/ftp-client.scm \
3b8258c5 90 guix/http-client.scm \
0fdd3bea 91 guix/gnupg.scm \
d5d16686 92 guix/elf.scm \
af51c820 93 guix/store.scm \
89328d24 94 guix/cvs-download.scm \
b3acf365 95 guix/svn-download.scm \
073c34d7 96 guix/ui.scm \
5f7a1a4d 97 guix/build/ant-build-system.scm \
62cab99c 98 guix/build/download.scm \
4b3cb7f4 99 guix/build/cargo-build-system.scm \
c6bded8a 100 guix/build/cmake-build-system.scm \
65e862d1 101 guix/build/dub-build-system.scm \
e9137a53 102 guix/build/emacs-build-system.scm \
a1b30f99 103 guix/build/asdf-build-system.scm \
9b5b5c17 104 guix/build/git.scm \
c4e48b68 105 guix/build/hg.scm \
be3425e5 106 guix/build/glib-or-gtk-build-system.scm \
af51c820 107 guix/build/gnu-build-system.scm \
fe12c345 108 guix/build/gnu-dist.scm \
08fd1ebe 109 guix/build/perl-build-system.scm \
40506d5d 110 guix/build/python-build-system.scm \
e6876cb9 111 guix/build/ocaml-build-system.scm \
f8f3bef6 112 guix/build/r-build-system.scm \
c08f9818 113 guix/build/ruby-build-system.scm \
a677c726 114 guix/build/waf-build-system.scm \
9fd6c2ba 115 guix/build/haskell-build-system.scm \
6fd1a796 116 guix/build/store-copy.scm \
1273d44a 117 guix/build/utils.scm \
c8c88afa 118 guix/build/union.scm \
611adb1e 119 guix/build/profiles.scm \
3dbeecd2 120 guix/build/pull.scm \
3309e3a1 121 guix/build/rpath.scm \
89328d24 122 guix/build/cvs.scm \
b3acf365 123 guix/build/svn.scm \
875715ca 124 guix/build/syscalls.scm \
15aa2c38 125 guix/build/gremlin.scm \
75f3b1a1 126 guix/build/emacs-utils.scm \
a1b30f99 127 guix/build/lisp-utils.scm \
fb59e275 128 guix/build/graft.scm \
f2e4805b 129 guix/build/bournish.scm \
2098d024 130 guix/build/qt-utils.scm \
f13f60cb 131 guix/build/make-bootstrap.scm \
e89431bf 132 guix/search-paths.scm \
e3ce5d70 133 guix/packages.scm \
1b3e9685 134 guix/import/utils.scm \
7047133f 135 guix/import/gnu.scm \
1b3e9685 136 guix/import/snix.scm \
a4154748 137 guix/import/cabal.scm \
e1248602 138 guix/import/cran.scm \
a4154748 139 guix/import/hackage.scm \
7f74a931 140 guix/import/elpa.scm \
88981dd3 141 guix/scripts.scm \
de1355f1 142 guix/scripts/download.scm \
94d92c77 143 guix/scripts/perform-download.scm \
de1355f1 144 guix/scripts/build.scm \
760c60d6 145 guix/scripts/archive.scm \
de1355f1
LC
146 guix/scripts/import.scm \
147 guix/scripts/package.scm \
148 guix/scripts/gc.scm \
149 guix/scripts/hash.scm \
239c2266 150 guix/scripts/pack.scm \
de1355f1 151 guix/scripts/pull.scm \
2c74fde0 152 guix/scripts/substitute.scm \
526382ff 153 guix/scripts/authenticate.scm \
de1355f1 154 guix/scripts/refresh.scm \
523e4896 155 guix/scripts/system.scm \
b4f5e0e8 156 guix/scripts/lint.scm \
d23c20f1 157 guix/scripts/challenge.scm \
e1248602 158 guix/scripts/import/cran.scm \
7047133f 159 guix/scripts/import/gnu.scm \
1b3e9685 160 guix/scripts/import/nix.scm \
a4154748 161 guix/scripts/import/hackage.scm \
bc5844d1 162 guix/scripts/import/stackage.scm \
7f74a931 163 guix/scripts/import/elpa.scm \
372c4bbc 164 guix/scripts/environment.scm \
aff8ce7c 165 guix/scripts/publish.scm \
39bee8a2 166 guix/scripts/edit.scm \
fcc58db6 167 guix/scripts/size.scm \
88856916 168 guix/scripts/graph.scm \
32efa254
DT
169 guix/scripts/container.scm \
170 guix/scripts/container/exec.scm \
e3ce5d70 171 guix.scm \
d516736c 172 $(GNU_SYSTEM_MODULES)
af51c820 173
bb251307
LC
174if HAVE_GUILE_JSON
175
176MODULES += \
03476a23 177 guix/docker.scm \
3089b5d3
MW
178 guix/import/cpan.scm \
179 guix/import/crate.scm \
180 guix/import/gem.scm \
70161842 181 guix/import/github.scm \
bb251307
LC
182 guix/import/json.scm \
183 guix/import/pypi.scm \
3089b5d3
MW
184 guix/import/stackage.scm \
185 guix/scripts/import/crate.scm \
bb251307 186 guix/scripts/import/gem.scm \
3089b5d3 187 guix/scripts/import/pypi.scm
bb251307
LC
188
189endif
190
987a29ba
LC
191if HAVE_GUILE_SSH
192
193MODULES += \
f11c444d 194 guix/ssh.scm \
285f63e8
LC
195 guix/scripts/copy.scm \
196 guix/store/ssh.scm
987a29ba
LC
197
198endif HAVE_GUILE_SSH
199
49e6291a
LC
200if BUILD_DAEMON_OFFLOAD
201
202MODULES += \
203 guix/scripts/offload.scm
204
205endif BUILD_DAEMON_OFFLOAD
206
17ab08bc
LC
207# Internal modules with test suite support.
208dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
c1bc358f 209
7994250f
AK
210# Auxiliary files for packages.
211AUX_FILES = \
59d04f63 212 gnu/packages/aux-files/emacs/guix-emacs.el \
60c9e804
MW
213 gnu/packages/aux-files/linux-libre/4.11-i686.conf \
214 gnu/packages/aux-files/linux-libre/4.11-x86_64.conf \
7994250f
AK
215 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
216 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
217 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
218 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
219 gnu/packages/aux-files/linux-libre/4.1-i686.conf \
220 gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
1959fb04 221
ebc32b31
LC
222# Templates, examples.
223EXAMPLES = \
36ffaca2 224 gnu/system/examples/bare-bones.tmpl \
d038b674
LC
225 gnu/system/examples/desktop.tmpl \
226 gnu/system/examples/lightweight-desktop.tmpl
ebc32b31 227
17ab08bc 228GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
af51c820 229
4aabc8ea
LC
230nobase_dist_guilemodule_DATA = \
231 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
74574fd1 232 $(MISC_DISTRO_FILES)
9437fd73
LC
233nobase_nodist_guilemodule_DATA = guix/config.scm
234nobase_nodist_guileobject_DATA = $(GOBJECTS)
800cdeef 235
1959fb04
LC
236# Do we need to provide our own non-broken (srfi srfi-37) module?
237if INSTALL_SRFI_37
238
239nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
240GOBJECTS += srfi/srfi-37.go
241
242srfi/srfi-37.scm: srfi/srfi-37.scm.in
243 $(MKDIR_P) srfi
244 cp "$<" "$@"
245
246endif INSTALL_SRFI_37
ac5aa288 247
70a9c720
LC
248# Handy way to remove the .go files without removing all the rest.
249clean-go:
250 -$(RM) -f $(GOBJECTS)
cdf26f40
EB
251 @find . -name '*.go' -print | \
252 if test -t 1; then \
253 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
254 else \
255 xargs -r echo "warning: stray .go files:"; \
256 fi
70a9c720 257
af51c820 258
bb251307
LC
259# Test extensions; has to be unconditional.
260TEST_EXTENSIONS = .scm .sh
261
262if CAN_RUN_TESTS
263
30dd8310 264SCM_TESTS = \
4c0c4db0 265 tests/base16.scm \
ddc29a78 266 tests/base32.scm \
e9c6c584 267 tests/base64.scm \
7a18c3cc 268 tests/cpio.scm \
69927e78 269 tests/hash.scm \
3476ded9 270 tests/pk-crypto.scm \
8b420f74 271 tests/pki.scm \
d326767e 272 tests/sets.scm \
7ca87354 273 tests/modules.scm \
202440e0 274 tests/gnu-maintenance.scm \
2c74fde0 275 tests/substitute.scm \
af51c820
LC
276 tests/builders.scm \
277 tests/derivations.scm \
7adf9b84 278 tests/grafts.scm \
299112d3 279 tests/ui.scm \
c0cd1b3e 280 tests/records.scm \
f1eacbaf 281 tests/upstream.scm \
958dd3ce 282 tests/combinators.scm \
cd903ef7 283 tests/discovery.scm \
e3ce5d70 284 tests/utils.scm \
b0e0d0e9 285 tests/build-utils.scm \
c8c88afa 286 tests/packages.scm \
10226c05 287 tests/snix.scm \
a4154748 288 tests/hackage.scm \
e1248602 289 tests/cran.scm \
7f74a931 290 tests/elpa.scm \
3259877d 291 tests/store.scm \
b860f382 292 tests/monads.scm \
21b679f6 293 tests/gexp.scm \
53c63ee9 294 tests/nar.scm \
a2078770 295 tests/union.scm \
29fa45f4 296 tests/profiles.scm \
fcd75bdb 297 tests/search-paths.scm \
b4f5e0e8 298 tests/syscalls.scm \
15aa2c38 299 tests/gremlin.scm \
f82c5853 300 tests/bournish.scm \
aff8ce7c 301 tests/lint.scm \
fcc58db6 302 tests/publish.scm \
88981dd3 303 tests/scripts.scm \
c1f6a0c2 304 tests/size.scm \
88856916 305 tests/graph.scm \
d23c20f1 306 tests/challenge.scm \
2ea2aac6 307 tests/cache.scm \
0eef7551 308 tests/cve.scm \
1563d6c7 309 tests/workers.scm \
72153902 310 tests/zlib.scm \
661a1d79 311 tests/file-systems.scm \
6b779207 312 tests/system.scm \
0adfe95a 313 tests/services.scm \
629a064f 314 tests/scripts-build.scm \
a132f7d6 315 tests/containers.scm \
850edd77 316 tests/pack.scm \
a132f7d6 317 tests/import-utils.scm
30dd8310 318
1b3e9685
DT
319if HAVE_GUILE_JSON
320
d45dc6da
EB
321SCM_TESTS += \
322 tests/pypi.scm \
a96524cc 323 tests/cpan.scm \
3e0c0365
DC
324 tests/gem.scm \
325 tests/crate.scm
1b3e9685
DT
326
327endif
328
30dd8310 329SH_TESTS = \
0afdc485 330 tests/guix-build.sh \
37d19403 331 tests/guix-download.sh \
fe8ff028 332 tests/guix-gc.sh \
ccbce848 333 tests/guix-hash.sh \
0820098d 334 tests/guix-package.sh \
57b86237 335 tests/guix-package-net.sh \
c1202fb1 336 tests/guix-system.sh \
760c60d6 337 tests/guix-archive.sh \
dd7c013d 338 tests/guix-authenticate.sh \
cad25264 339 tests/guix-environment.sh \
f535dcbe 340 tests/guix-environment-container.sh \
88856916 341 tests/guix-graph.sh \
dd7c013d 342 tests/guix-lint.sh
af51c820 343
a7a4e6a4
LC
344if BUILD_DAEMON
345
346SH_TESTS += tests/guix-register.sh
347
348endif BUILD_DAEMON
349
350
30dd8310
LC
351TESTS = $(SCM_TESTS) $(SH_TESTS)
352
a9edb211 353AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
352ec143 354
4d9ed584
LC
355SCM_LOG_DRIVER = \
356 $(top_builddir)/test-env --quiet-stderr \
357 $(GUILE) --no-auto-compile -e main \
358 $(top_srcdir)/build-aux/test-driver.scm
359
a9edb211 360AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
97298ffa 361
69cfce50 362SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 363AM_SH_LOG_FLAGS = -x -e
af51c820 364
3a33730a
LC
365# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
366# could end up removing files from the store while they are being used by
367# other instances of the daemon.
368tests/guix-gc.log: \
369 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
370 $(SCM_TESTS:%.scm=%.log)
371
bb251307
LC
372else !CAN_RUN_TESTS
373
374TESTS =
375SH_TESTS =
376SCM_TESTS =
377
378# Automake always generates a 'check' target, so better not override it.
379check-local:
380 @echo
381 @echo "Cannot run tests because file name limits would be exceeded." >&2
382 @echo "Look for 'length' in the 'config.log' file for details." >&2
383 @echo
384 @exit 1
385
386endif !CAN_RUN_TESTS
387
693f12ce 388check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
e9f693d0
LC
389 $(AM_V_at)$(top_builddir)/pre-inst-env \
390 $(GUILE) --no-auto-compile \
391 -e '(@@ (run-system-tests) run-system-tests)' \
392 $(top_srcdir)/build-aux/run-system-tests.scm
393
d9a0bd4c
LC
394# Public key used to sign substitutes from hydra.gnu.org & co.
395dist_pkgdata_DATA = \
396 hydra.gnu.org.pub \
397 bayfront.guixsd.org.pub
3a33730a 398
ee3e157d
LC
399# Bash completion file.
400dist_bashcompletion_DATA = etc/completion/bash/guix
401
96dbc930
ELB
402# Zsh completion file.
403dist_zshcompletion_DATA = etc/completion/zsh/_guix
404
81f61c17
LC
405EXTRA_DIST = \
406 HACKING \
407 ROADMAP \
408 TODO \
e15fcdd1 409 CODE-OF-CONDUCT \
81f61c17 410 .dir-locals.el \
f81ac34d 411 build-aux/build-self.scm \
de6af327 412 build-aux/compile-all.scm \
89cbec89 413 build-aux/hydra/evaluate.scm \
81f61c17 414 build-aux/hydra/gnu-system.scm \
81f61c17
LC
415 build-aux/hydra/guix.scm \
416 build-aux/check-available-binaries.scm \
417 build-aux/check-final-inputs-self-contained.scm \
418 build-aux/download.scm \
1c2ae810 419 build-aux/generate-authors.scm \
3cf0dbda 420 build-aux/test-driver.scm \
94fa8d76 421 build-aux/update-guix-package.scm \
41c569d9 422 build-aux/run-system-tests.scm \
4d93f312
RW
423 d3.v3.js \
424 graph.js \
81f61c17
LC
425 srfi/srfi-37.scm.in \
426 srfi/srfi-64.scm \
427 srfi/srfi-64.upstream.scm \
428 tests/test.drv \
429 tests/signing-key.pub \
430 tests/signing-key.sec \
0eef7551 431 tests/cve-sample.xml \
81f61c17
LC
432 build-aux/config.rpath \
433 bootstrap \
434 release.nix \
ed795c06 435 $(TESTS)
d7672884 436
49e6291a
LC
437if !BUILD_DAEMON_OFFLOAD
438
439EXTRA_DIST += \
440 guix/scripts/offload.scm
441
442endif !BUILD_DAEMON_OFFLOAD
443
444
30dd8310
LC
445CLEANFILES = \
446 $(GOBJECTS) \
9bff16b3 447 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 448
28561d85
LC
449# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
450# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
451# there that are newer than the local .scm files (for instance because the
452# user ran 'make install' recently). When that happens, we end up loading
453# those previously-installed .go files, which may be stale, thereby breaking
d92e23dc
LC
454# the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
455# stale files from ~/.cache/guile/ccache.
de6af327 456%.go: make-go ; @:
17ab08bc 457make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
de6af327 458 $(AM_V_at)echo "Compiling Scheme modules..." ; \
28561d85 459 unset GUILE_LOAD_COMPILED_PATH ; \
d92e23dc 460 XDG_CACHE_HOME=/nowhere \
de6af327 461 host=$(host) srcdir="$(top_srcdir)" \
671d8f5e 462 $(top_builddir)/pre-inst-env \
de6af327
TUBK
463 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
464 --no-auto-compile \
465 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
af51c820
LC
466
467SUFFIXES = .go
468
469# Make sure source files are installed first, so that the mtime of
470# installed compiled files is greater than that of installed source
471# files. See
472# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
473# for details.
9437fd73 474guix_install_go_files = install-nobase_nodist_guileobjectDATA
af51c820 475$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 476
6005bd07 477# The above trick doesn't work for 'config.go' because both 'config.scm' and
9437fd73 478# 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
6005bd07
LC
479# special treatment.
480install-data-hook: set-bootstrap-executable-permissions
9437fd73 481 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
6005bd07
LC
482
483
ee764179 484SUBDIRS = po/guix po/packages
931c132a 485BUILT_SOURCES =
a9424c08 486
03d0e2d2 487include doc/local.mk
568717fd 488
c2033df4
LC
489if BUILD_DAEMON
490
03d0e2d2 491include nix/local.mk
c2033df4
LC
492
493endif BUILD_DAEMON
494
f68b0893 495ACLOCAL_AMFLAGS = -I m4
ef5f5c86
LC
496
497# Pass an explicit '--localstatedir' so that configure does not error out if
ddce2d3a
LC
498# it finds an existing installation with a different localstatedir. Inherit
499# 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
500# repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
501# enough for shebangs.
e76bdf8b 502AM_DISTCHECK_CONFIGURE_FLAGS = \
ef5f5c86 503 --localstatedir="$$dc_install_base/var" \
d388c2c4 504 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 505 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39 506 --with-nix-prefix="$(NIX_PREFIX)" \
ddce2d3a
LC
507 --enable-daemon \
508 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
0e993428 509
1165b08f
LC
510# The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
511# so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
9d3fb6c7 512guix-binary.%.tar.xz:
33349e91
LC
513 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
514 tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
515 -s "$*" --localstatedir guix glibc-utf8-locales \
516 -e '(@@ (gnu packages commencement) glibc-final)'` ; \
239c2266 517 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
9d3fb6c7
LC
518
519
e6860b5e 520dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
a8ac45b1
AK
521dist-hook: assert-no-store-file-names
522
81f61c17 523distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 524
e6860b5e
LC
525EXTRA_DIST += $(top_srcdir)/.version
526BUILT_SOURCES += $(top_srcdir)/.version
527$(top_srcdir)/.version:
528 echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
529
530gen-tarball-version:
531 echo $(VERSION) > "$(distdir)/.tarball-version"
532
e793178a 533gen-ChangeLog:
e71ad29d 534 $(AM_V_GEN)if test -d .git; then \
e793178a
LC
535 $(top_srcdir)/build-aux/gitlog-to-changelog \
536 > $(distdir)/cl-t; \
537 rm -f $(distdir)/ChangeLog; \
538 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
539 fi
540
a8ac45b1 541gen-AUTHORS:
e71ad29d 542 $(AM_V_GEN)if test -d .git; then \
ac140f79
LC
543 rm -f "$(distdir)/AUTHORS"; \
544 $(top_builddir)/pre-inst-env "$(GUILE)" \
545 "$(top_srcdir)/build-aux/generate-authors.scm" \
546 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
547 fi
a8ac45b1 548
334dce14
LC
549\f
550#
551# Release management.
552#
553
554releasedir = release-$(PACKAGE_VERSION)
555
556PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
557
558# List of source tarballs produced. This must be kept in sync with the
559# 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
560SOURCE_TARBALLS = \
561 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
562
563# Systems supported by Guix.
564SUPPORTED_SYSTEMS = x86_64-linux i686-linux armhf-linux
565
566# Guix binary tarballs.
567BINARY_TARBALLS = \
568 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
569
570# Systems supported by GuixSD.
571GUIXSD_SUPPORTED_SYSTEMS = x86_64-linux #i686-linux
572
573# Prefix of the GuixSD installation image file name.
574GUIXSD_IMAGE_BASE = guixsd-usb-install-$(PACKAGE_VERSION)
575
576# Size of the installation image (for x86_64 typically).
577GUIXSD_INSTALLATION_IMAGE_SIZE ?= 950MiB
578
579# The release process works in several phases:
580#
581# 0. We assume the developer created a 'vX.Y' tag.
582# 1. Build the source tarball.
583# 2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
584# 3. Build the binary tarballs for that 'guix' package.
585# 4. Update the 'guix' package again.
586# 5. Build the GuixSD installation images. The images will run 'guix'
587# corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
588#
589# This 'release' target takes care of everything and copies the resulting
590# files to $(releasedir).
591release: distcheck
592 $(MKDIR_P) "$(releasedir)"
593 rm -f "$(releasedir)"/*
594 mv $(SOURCE_TARBALLS) "$(releasedir)"
595 cd po; git checkout .
596 $(top_builddir)/pre-inst-env "$(GUILE)" \
597 $(top_srcdir)/build-aux/update-guix-package.scm \
598 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
599 git add $(top_srcdir)/gnu/packages/package-management.scm
600 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
601 rm -f $(BINARY_TARBALLS)
602 $(MAKE) $(BINARY_TARBALLS)
603 for system in $(SUPPORTED_SYSTEMS) ; do \
604 mv "guix-binary.$$system.tar.xz" \
605 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
606 done
607 $(top_builddir)/pre-inst-env "$(GUILE)" \
608 $(top_srcdir)/build-aux/update-guix-package.scm \
609 "`git rev-parse HEAD`"
610 git add $(top_srcdir)/gnu/packages/package-management.scm
611 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
612 for system in $(GUIXSD_SUPPORTED_SYSTEMS) ; do \
613 image=`$(top_builddir)/pre-inst-env \
614 guix system disk-image \
615 --image-size=$(GUIXSD_INSTALLATION_IMAGE_SIZE) \
616 gnu/system/install.scm` ; \
617 if [ ! -f "$$image" ] ; then \
618 echo "failed to produced GuixSD installation image for $$system" >&2 ; \
619 exit 1 ; \
620 fi ; \
621 xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" ; \
622 mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" \
623 "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz" ; \
624 done
625
94fa8d76
LC
626update-guix-package:
627 git rev-parse HEAD
628 $(top_builddir)/pre-inst-env "$(GUILE)" \
629 $(top_srcdir)/build-aux/update-guix-package.scm \
630 "`git rev-parse HEAD`"
631
834129e0 632# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9 633assert-no-store-file-names:
e71ad29d 634 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
69e7322f
LC
635 --exclude=*.info-[0-9] --exclude=*.dot \
636 --exclude=*.eps --exclude-dir=bootstrap \
637 --exclude=guix-prettify.el \
76b3fbbc 638 --exclude=ChangeLog \
69e7322f 639 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
a463ffd9
LC
640 then \
641 echo "error: store file names embedded in the distribution" >&2 ; \
642 exit 1 ; \
643 fi
644
56fbf262 645# Make sure hydra.gnu.org has the important binaries.
93cba30c 646assert-binaries-available: $(GOBJECTS)
e71ad29d 647 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
56fbf262
LC
648 "$(top_srcdir)/build-aux/check-available-binaries.scm"
649
81f61c17 650# Make sure the final inputs don't refer to bootstrap tools.
93cba30c 651assert-final-inputs-self-contained: $(GOBJECTS)
e71ad29d 652 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
81f61c17
LC
653 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
654
89cbec89
LC
655# Compute the Hydra jobs and write them in the target file.
656hydra-jobs.scm: $(GOBJECTS)
657 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
658 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
659 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
660 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
28dee3d2 661 $(AM_V_at)mv "$@.tmp" "$@"
89cbec89 662
e6860b5e 663.PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
56fbf262 664.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 665.PHONY: assert-final-inputs-self-contained
e6860b5e 666.PHONY: clean-go make-go
334dce14 667.PHONY: update-guix-package release
8c3d8894
ML
668
669## -------------- ##
670## Silent rules. ##
671## -------------- ##
672
673AM_V_DL = $(AM_V_DL_$(V))
674AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
675AM_V_DL_0 = @echo " DL " $@;
4c48878d
ML
676
677AM_V_DOT = $(AM_V_DOT_$(V))
678AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
679AM_V_DOT_0 = @echo " DOT " $@;
71ed439b 680
8dddedf7
ML
681AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
682AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
683AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;