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