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