gnu: rottlog: Adjust the default 'weekly' config.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016 Mark H Weaver <mhw@netris.org>
7 #
8 # This file is part of GNU Guix.
9 #
10 # GNU Guix is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GNU Guix is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 bin_SCRIPTS = \
24 scripts/guix
25
26 nodist_noinst_SCRIPTS = \
27 pre-inst-env \
28 test-env
29
30 include gnu/local.mk
31
32 MODULES = \
33 guix/base32.scm \
34 guix/base64.scm \
35 guix/cpio.scm \
36 guix/records.scm \
37 guix/gcrypt.scm \
38 guix/hash.scm \
39 guix/pk-crypto.scm \
40 guix/pki.scm \
41 guix/combinators.scm \
42 guix/utils.scm \
43 guix/sets.scm \
44 guix/modules.scm \
45 guix/download.scm \
46 guix/git-download.scm \
47 guix/hg-download.scm \
48 guix/monads.scm \
49 guix/monad-repl.scm \
50 guix/gexp.scm \
51 guix/profiles.scm \
52 guix/serialization.scm \
53 guix/nar.scm \
54 guix/derivations.scm \
55 guix/grafts.scm \
56 guix/gnu-maintenance.scm \
57 guix/upstream.scm \
58 guix/licenses.scm \
59 guix/graph.scm \
60 guix/cve.scm \
61 guix/zlib.scm \
62 guix/build-system.scm \
63 guix/build-system/ant.scm \
64 guix/build-system/cmake.scm \
65 guix/build-system/emacs.scm \
66 guix/build-system/glib-or-gtk.scm \
67 guix/build-system/gnu.scm \
68 guix/build-system/haskell.scm \
69 guix/build-system/perl.scm \
70 guix/build-system/python.scm \
71 guix/build-system/waf.scm \
72 guix/build-system/r.scm \
73 guix/build-system/ruby.scm \
74 guix/build-system/trivial.scm \
75 guix/ftp-client.scm \
76 guix/http-client.scm \
77 guix/gnupg.scm \
78 guix/elf.scm \
79 guix/store.scm \
80 guix/cvs-download.scm \
81 guix/svn-download.scm \
82 guix/ui.scm \
83 guix/build/ant-build-system.scm \
84 guix/build/download.scm \
85 guix/build/cmake-build-system.scm \
86 guix/build/emacs-build-system.scm \
87 guix/build/git.scm \
88 guix/build/hg.scm \
89 guix/build/glib-or-gtk-build-system.scm \
90 guix/build/gnu-build-system.scm \
91 guix/build/gnu-dist.scm \
92 guix/build/perl-build-system.scm \
93 guix/build/python-build-system.scm \
94 guix/build/r-build-system.scm \
95 guix/build/ruby-build-system.scm \
96 guix/build/waf-build-system.scm \
97 guix/build/haskell-build-system.scm \
98 guix/build/store-copy.scm \
99 guix/build/utils.scm \
100 guix/build/union.scm \
101 guix/build/profiles.scm \
102 guix/build/pull.scm \
103 guix/build/rpath.scm \
104 guix/build/cvs.scm \
105 guix/build/svn.scm \
106 guix/build/syscalls.scm \
107 guix/build/gremlin.scm \
108 guix/build/emacs-utils.scm \
109 guix/build/graft.scm \
110 guix/build/bournish.scm \
111 guix/build/qt-utils.scm \
112 guix/search-paths.scm \
113 guix/packages.scm \
114 guix/import/utils.scm \
115 guix/import/gnu.scm \
116 guix/import/snix.scm \
117 guix/import/cabal.scm \
118 guix/import/cran.scm \
119 guix/import/hackage.scm \
120 guix/import/elpa.scm \
121 guix/scripts.scm \
122 guix/scripts/download.scm \
123 guix/scripts/build.scm \
124 guix/scripts/archive.scm \
125 guix/scripts/import.scm \
126 guix/scripts/package.scm \
127 guix/scripts/gc.scm \
128 guix/scripts/hash.scm \
129 guix/scripts/pull.scm \
130 guix/scripts/substitute.scm \
131 guix/scripts/authenticate.scm \
132 guix/scripts/refresh.scm \
133 guix/scripts/system.scm \
134 guix/scripts/lint.scm \
135 guix/scripts/challenge.scm \
136 guix/scripts/import/cran.scm \
137 guix/scripts/import/gnu.scm \
138 guix/scripts/import/nix.scm \
139 guix/scripts/import/hackage.scm \
140 guix/scripts/import/elpa.scm \
141 guix/scripts/environment.scm \
142 guix/scripts/publish.scm \
143 guix/scripts/edit.scm \
144 guix/scripts/size.scm \
145 guix/scripts/graph.scm \
146 guix/scripts/container.scm \
147 guix/scripts/container/exec.scm \
148 guix.scm \
149 $(GNU_SYSTEM_MODULES)
150
151 if HAVE_GUILE_JSON
152
153 MODULES += \
154 guix/import/github.scm \
155 guix/import/json.scm \
156 guix/import/pypi.scm \
157 guix/scripts/import/pypi.scm \
158 guix/import/cpan.scm \
159 guix/scripts/import/gem.scm \
160 guix/import/gem.scm
161
162 endif
163
164 if BUILD_DAEMON_OFFLOAD
165
166 MODULES += \
167 guix/scripts/offload.scm
168
169 endif BUILD_DAEMON_OFFLOAD
170
171 # Internal module with test suite support.
172 dist_noinst_DATA = guix/tests.scm
173
174 # Linux-Libre configurations.
175 KCONFIGS = \
176 gnu/packages/linux-libre-4.7-i686.conf \
177 gnu/packages/linux-libre-4.7-x86_64.conf \
178 gnu/packages/linux-libre-4.4-i686.conf \
179 gnu/packages/linux-libre-4.4-x86_64.conf \
180 gnu/packages/linux-libre-4.1-i686.conf \
181 gnu/packages/linux-libre-4.1-x86_64.conf
182
183 # Templates, examples.
184 EXAMPLES = \
185 gnu/system/examples/bare-bones.tmpl \
186 gnu/system/examples/desktop.tmpl \
187 gnu/system/examples/lightweight-desktop.tmpl
188
189 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
190
191 nobase_dist_guilemodule_DATA = \
192 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
193 $(MISC_DISTRO_FILES)
194 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
195
196 # Do we need to provide our own non-broken (srfi srfi-37) module?
197 if INSTALL_SRFI_37
198
199 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
200 GOBJECTS += srfi/srfi-37.go
201
202 srfi/srfi-37.scm: srfi/srfi-37.scm.in
203 $(MKDIR_P) srfi
204 cp "$<" "$@"
205
206 endif INSTALL_SRFI_37
207
208 # Handy way to remove the .go files without removing all the rest.
209 clean-go:
210 -$(RM) -f $(GOBJECTS)
211
212
213 # Test extensions; has to be unconditional.
214 TEST_EXTENSIONS = .scm .sh
215
216 if CAN_RUN_TESTS
217
218 SCM_TESTS = \
219 tests/base32.scm \
220 tests/base64.scm \
221 tests/cpio.scm \
222 tests/hash.scm \
223 tests/pk-crypto.scm \
224 tests/pki.scm \
225 tests/sets.scm \
226 tests/modules.scm \
227 tests/gnu-maintenance.scm \
228 tests/substitute.scm \
229 tests/builders.scm \
230 tests/derivations.scm \
231 tests/grafts.scm \
232 tests/ui.scm \
233 tests/records.scm \
234 tests/upstream.scm \
235 tests/combinators.scm \
236 tests/utils.scm \
237 tests/build-utils.scm \
238 tests/packages.scm \
239 tests/snix.scm \
240 tests/hackage.scm \
241 tests/cran.scm \
242 tests/elpa.scm \
243 tests/store.scm \
244 tests/monads.scm \
245 tests/gexp.scm \
246 tests/nar.scm \
247 tests/union.scm \
248 tests/profiles.scm \
249 tests/syscalls.scm \
250 tests/gremlin.scm \
251 tests/bournish.scm \
252 tests/lint.scm \
253 tests/publish.scm \
254 tests/scripts.scm \
255 tests/size.scm \
256 tests/graph.scm \
257 tests/challenge.scm \
258 tests/cve.scm \
259 tests/zlib.scm \
260 tests/file-systems.scm \
261 tests/system.scm \
262 tests/services.scm \
263 tests/scripts-build.scm \
264 tests/containers.scm \
265 tests/import-utils.scm
266
267 if HAVE_GUILE_JSON
268
269 SCM_TESTS += \
270 tests/pypi.scm \
271 tests/cpan.scm \
272 tests/gem.scm
273
274 endif
275
276 SH_TESTS = \
277 tests/guix-build.sh \
278 tests/guix-download.sh \
279 tests/guix-gc.sh \
280 tests/guix-hash.sh \
281 tests/guix-package.sh \
282 tests/guix-package-net.sh \
283 tests/guix-system.sh \
284 tests/guix-archive.sh \
285 tests/guix-authenticate.sh \
286 tests/guix-environment.sh \
287 tests/guix-environment-container.sh \
288 tests/guix-graph.sh \
289 tests/guix-lint.sh
290
291 if BUILD_DAEMON
292
293 SH_TESTS += tests/guix-register.sh
294
295 endif BUILD_DAEMON
296
297
298 TESTS = $(SCM_TESTS) $(SH_TESTS)
299
300 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
301
302 SCM_LOG_DRIVER = \
303 $(top_builddir)/test-env --quiet-stderr \
304 $(GUILE) --no-auto-compile -e main \
305 $(top_srcdir)/build-aux/test-driver.scm
306
307 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
308
309 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
310 AM_SH_LOG_FLAGS = -x -e
311
312 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
313 # could end up removing files from the store while they are being used by
314 # other instances of the daemon.
315 tests/guix-gc.log: \
316 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
317 $(SCM_TESTS:%.scm=%.log)
318
319 else !CAN_RUN_TESTS
320
321 TESTS =
322 SH_TESTS =
323 SCM_TESTS =
324
325 # Automake always generates a 'check' target, so better not override it.
326 check-local:
327 @echo
328 @echo "Cannot run tests because file name limits would be exceeded." >&2
329 @echo "Look for 'length' in the 'config.log' file for details." >&2
330 @echo
331 @exit 1
332
333 endif !CAN_RUN_TESTS
334
335 check-system: $(GOBJECTS)
336 $(AM_V_at)$(top_builddir)/pre-inst-env \
337 $(GUILE) --no-auto-compile \
338 -e '(@@ (run-system-tests) run-system-tests)' \
339 $(top_srcdir)/build-aux/run-system-tests.scm
340
341 # Public key used to sign substitutes from hydra.gnu.org.
342 dist_pkgdata_DATA = hydra.gnu.org.pub
343
344 # Bash completion file.
345 dist_bashcompletion_DATA = etc/completion/bash/guix
346
347 EXTRA_DIST = \
348 HACKING \
349 ROADMAP \
350 TODO \
351 CODE-OF-CONDUCT \
352 .dir-locals.el \
353 build-aux/build-self.scm \
354 build-aux/compile-all.scm \
355 build-aux/hydra/evaluate.scm \
356 build-aux/hydra/gnu-system.scm \
357 build-aux/hydra/demo-os.scm \
358 build-aux/hydra/guix.scm \
359 build-aux/check-available-binaries.scm \
360 build-aux/check-final-inputs-self-contained.scm \
361 build-aux/download.scm \
362 build-aux/make-binary-tarball.scm \
363 build-aux/generate-authors.scm \
364 build-aux/test-driver.scm \
365 build-aux/run-system-tests.scm \
366 srfi/srfi-37.scm.in \
367 srfi/srfi-64.scm \
368 srfi/srfi-64.upstream.scm \
369 tests/test.drv \
370 tests/signing-key.pub \
371 tests/signing-key.sec \
372 tests/cve-sample.xml \
373 build-aux/config.rpath \
374 bootstrap \
375 release.nix \
376 $(TESTS)
377
378 if !BUILD_DAEMON_OFFLOAD
379
380 EXTRA_DIST += \
381 guix/scripts/offload.scm
382
383 endif !BUILD_DAEMON_OFFLOAD
384
385
386 CLEANFILES = \
387 $(GOBJECTS) \
388 $(SCM_TESTS:tests/%.scm=%.log)
389
390 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
391 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
392 # there that are newer than the local .scm files (for instance because the
393 # user ran 'make install' recently). When that happens, we end up loading
394 # those previously-installed .go files, which may be stale, thereby breaking
395 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
396 # stale files from ~/.cache/guile/ccache.
397 %.go: make-go ; @:
398 make-go: $(MODULES) guix/config.scm guix/tests.scm
399 $(AM_V_at)echo "Compiling Scheme modules..." ; \
400 unset GUILE_LOAD_COMPILED_PATH ; \
401 XDG_CACHE_HOME=/nowhere \
402 host=$(host) srcdir="$(top_srcdir)" \
403 $(top_builddir)/pre-inst-env \
404 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
405 --no-auto-compile \
406 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
407
408 SUFFIXES = .go
409
410 # Make sure source files are installed first, so that the mtime of
411 # installed compiled files is greater than that of installed source
412 # files. See
413 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
414 # for details.
415 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
416 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
417
418 # The above trick doesn't work for 'config.go' because both 'config.scm' and
419 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
420 # special treatment.
421 install-data-hook: set-bootstrap-executable-permissions
422 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
423
424
425 SUBDIRS = po/guix po/packages
426 BUILT_SOURCES =
427
428 include doc/local.mk
429
430 if BUILD_DAEMON
431
432 include nix/local.mk
433
434 endif BUILD_DAEMON
435
436 ACLOCAL_AMFLAGS = -I m4
437
438 # Pass an explicit '--localstatedir' so that configure does not error out if
439 # it finds an existing installation with a different localstatedir.
440 AM_DISTCHECK_CONFIGURE_FLAGS = \
441 --localstatedir="$$dc_install_base/var" \
442 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
443 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
444 --with-nix-prefix="$(NIX_PREFIX)" \
445 --enable-daemon
446
447 dist_emacsui_DATA = emacs/guix-main.scm
448 nodist_emacsui_DATA = emacs/guix-helper.scm
449 include emacs/local.mk
450
451 # The self-contained tarball.
452 guix-binary.%.tar.xz:
453 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
454 $(top_builddir)/pre-inst-env "$(GUILE)" \
455 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
456
457
458 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
459 dist-hook: assert-no-store-file-names
460
461 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
462
463 sync-descriptions:
464 $(AM_V_at)GUIX_PACKAGE_PATH= \
465 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
466
467 gen-ChangeLog:
468 $(AM_V_GEN)if test -d .git; then \
469 $(top_srcdir)/build-aux/gitlog-to-changelog \
470 > $(distdir)/cl-t; \
471 rm -f $(distdir)/ChangeLog; \
472 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
473 fi
474
475 gen-AUTHORS:
476 $(AM_V_GEN)if test -d .git; then \
477 rm -f "$(distdir)/AUTHORS"; \
478 $(top_builddir)/pre-inst-env "$(GUILE)" \
479 "$(top_srcdir)/build-aux/generate-authors.scm" \
480 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
481 fi
482
483 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
484 assert-no-store-file-names:
485 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
486 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
487 then \
488 echo "error: store file names embedded in the distribution" >&2 ; \
489 exit 1 ; \
490 fi
491
492 # Make sure hydra.gnu.org has the important binaries.
493 assert-binaries-available: $(GOBJECTS)
494 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
495 "$(top_srcdir)/build-aux/check-available-binaries.scm"
496
497 # Make sure the final inputs don't refer to bootstrap tools.
498 assert-final-inputs-self-contained: $(GOBJECTS)
499 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
500 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
501
502 # Compute the Hydra jobs and write them in the target file.
503 hydra-jobs.scm: $(GOBJECTS)
504 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
505 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
506 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
507 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
508 $(AM_V_at)mv "$@.tmp" "$@"
509
510 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
511 .PHONY: assert-no-store-file-names assert-binaries-available
512 .PHONY: assert-final-inputs-self-contained
513
514 ## -------------- ##
515 ## Silent rules. ##
516 ## -------------- ##
517
518 AM_V_DL = $(AM_V_DL_$(V))
519 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
520 AM_V_DL_0 = @echo " DL " $@;
521
522 AM_V_DOT = $(AM_V_DOT_$(V))
523 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
524 AM_V_DOT_0 = @echo " DOT " $@;
525
526 AM_V_EMACS = $(AM_V_EMACS_$(V))
527 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
528 AM_V_EMACS_0 = @echo " EMACS " $@;
529
530 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
531 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
532 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;