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