derivations: Raise an error when a module file is not found.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
bb251307 2# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
a8ac45b1 4# Copyright © 2015 Alex Kost <alezost@gmail.com>
8c3d8894 5# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
adddd5ba 6# Copyright © 2016 Mark H Weaver <mhw@netris.org>
af51c820 7#
233e7676 8# This file is part of GNU Guix.
af51c820 9#
233e7676 10# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
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#
233e7676 15# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
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
233e7676 21# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 22
c52a5bf0 23bin_SCRIPTS = \
e49951eb 24 scripts/guix
14a1c319 25
58867ae7
MW
26nodist_noinst_SCRIPTS = \
27 pre-inst-env \
28 test-env
29
d516736c
LC
30include gnu-system.am
31
af51c820 32MODULES = \
ddc29a78 33 guix/base32.scm \
e9c6c584 34 guix/base64.scm \
7a18c3cc 35 guix/cpio.scm \
c0cd1b3e 36 guix/records.scm \
4862bc4a 37 guix/gcrypt.scm \
72626a71 38 guix/hash.scm \
3476ded9 39 guix/pk-crypto.scm \
8b420f74 40 guix/pki.scm \
73fbb904 41 guix/utils.scm \
d326767e 42 guix/sets.scm \
de1355f1 43 guix/download.scm \
9b5b5c17 44 guix/git-download.scm \
b860f382 45 guix/monads.scm \
b9b86078 46 guix/monad-repl.scm \
21b679f6 47 guix/gexp.scm \
cc4ecc2d 48 guix/profiles.scm \
0f41c26f
LC
49 guix/serialization.scm \
50 guix/nar.scm \
af51c820 51 guix/derivations.scm \
7adf9b84 52 guix/grafts.scm \
22189ed1 53 guix/gnu-maintenance.scm \
0a7c5a09 54 guix/upstream.scm \
838d78e3 55 guix/licenses.scm \
8fb58371 56 guix/graph.scm \
0eef7551 57 guix/cve.scm \
208f7cd1 58 guix/build-system.scm \
5f7a1a4d 59 guix/build-system/ant.scm \
c6bded8a 60 guix/build-system/cmake.scm \
e9137a53 61 guix/build-system/emacs.scm \
be3425e5 62 guix/build-system/glib-or-gtk.scm \
208f7cd1 63 guix/build-system/gnu.scm \
ce6fc7d6 64 guix/build-system/haskell.scm \
08fd1ebe 65 guix/build-system/perl.scm \
40506d5d 66 guix/build-system/python.scm \
a677c726 67 guix/build-system/waf.scm \
f8f3bef6 68 guix/build-system/r.scm \
c08f9818 69 guix/build-system/ruby.scm \
be13fbfa 70 guix/build-system/trivial.scm \
457dd86d 71 guix/ftp-client.scm \
3b8258c5 72 guix/http-client.scm \
0fdd3bea 73 guix/gnupg.scm \
d5d16686 74 guix/elf.scm \
af51c820 75 guix/store.scm \
89328d24 76 guix/cvs-download.scm \
b3acf365 77 guix/svn-download.scm \
073c34d7 78 guix/ui.scm \
5f7a1a4d 79 guix/build/ant-build-system.scm \
62cab99c 80 guix/build/download.scm \
c6bded8a 81 guix/build/cmake-build-system.scm \
e9137a53 82 guix/build/emacs-build-system.scm \
9b5b5c17 83 guix/build/git.scm \
be3425e5 84 guix/build/glib-or-gtk-build-system.scm \
af51c820 85 guix/build/gnu-build-system.scm \
fe12c345 86 guix/build/gnu-dist.scm \
08fd1ebe 87 guix/build/perl-build-system.scm \
40506d5d 88 guix/build/python-build-system.scm \
f8f3bef6 89 guix/build/r-build-system.scm \
c08f9818 90 guix/build/ruby-build-system.scm \
a677c726 91 guix/build/waf-build-system.scm \
9fd6c2ba 92 guix/build/haskell-build-system.scm \
6fd1a796 93 guix/build/store-copy.scm \
1273d44a 94 guix/build/utils.scm \
c8c88afa 95 guix/build/union.scm \
611adb1e 96 guix/build/profiles.scm \
3dbeecd2 97 guix/build/pull.scm \
3309e3a1 98 guix/build/rpath.scm \
89328d24 99 guix/build/cvs.scm \
b3acf365 100 guix/build/svn.scm \
15aa2c38 101 guix/build/gremlin.scm \
75f3b1a1 102 guix/build/emacs-utils.scm \
fb59e275 103 guix/build/graft.scm \
f2e4805b 104 guix/build/bournish.scm \
e89431bf 105 guix/search-paths.scm \
e3ce5d70 106 guix/packages.scm \
1b3e9685 107 guix/import/utils.scm \
7047133f 108 guix/import/gnu.scm \
1b3e9685 109 guix/import/snix.scm \
a4154748 110 guix/import/cabal.scm \
e1248602 111 guix/import/cran.scm \
a4154748 112 guix/import/hackage.scm \
7f74a931 113 guix/import/elpa.scm \
88981dd3 114 guix/scripts.scm \
de1355f1
LC
115 guix/scripts/download.scm \
116 guix/scripts/build.scm \
760c60d6 117 guix/scripts/archive.scm \
de1355f1
LC
118 guix/scripts/import.scm \
119 guix/scripts/package.scm \
120 guix/scripts/gc.scm \
121 guix/scripts/hash.scm \
122 guix/scripts/pull.scm \
2c74fde0 123 guix/scripts/substitute.scm \
526382ff 124 guix/scripts/authenticate.scm \
de1355f1 125 guix/scripts/refresh.scm \
523e4896 126 guix/scripts/system.scm \
b4f5e0e8 127 guix/scripts/lint.scm \
d23c20f1 128 guix/scripts/challenge.scm \
e1248602 129 guix/scripts/import/cran.scm \
7047133f 130 guix/scripts/import/gnu.scm \
1b3e9685 131 guix/scripts/import/nix.scm \
a4154748 132 guix/scripts/import/hackage.scm \
7f74a931 133 guix/scripts/import/elpa.scm \
372c4bbc 134 guix/scripts/environment.scm \
aff8ce7c 135 guix/scripts/publish.scm \
39bee8a2 136 guix/scripts/edit.scm \
fcc58db6 137 guix/scripts/size.scm \
88856916 138 guix/scripts/graph.scm \
32efa254
DT
139 guix/scripts/container.scm \
140 guix/scripts/container/exec.scm \
e3ce5d70 141 guix.scm \
d516736c 142 $(GNU_SYSTEM_MODULES)
af51c820 143
bb251307
LC
144if HAVE_GUILE_JSON
145
146MODULES += \
70161842 147 guix/import/github.scm \
bb251307
LC
148 guix/import/json.scm \
149 guix/import/pypi.scm \
150 guix/scripts/import/pypi.scm \
151 guix/import/cpan.scm \
152 guix/scripts/import/gem.scm \
153 guix/import/gem.scm
154
155endif
156
12e5b266
LC
157if BUILD_SYSCALLS_MODULE
158
159MODULES += \
160 guix/build/syscalls.scm
161
162endif
163
49e6291a
LC
164if BUILD_DAEMON_OFFLOAD
165
166MODULES += \
167 guix/scripts/offload.scm
168
169endif BUILD_DAEMON_OFFLOAD
170
c1bc358f 171# Internal module with test suite support.
02754a5e 172dist_noinst_DATA = guix/tests.scm
c1bc358f 173
a94546ec
LC
174# Linux-Libre configurations.
175KCONFIGS = \
75b314a6
MW
176 gnu/packages/linux-libre-4.5-i686.conf \
177 gnu/packages/linux-libre-4.5-x86_64.conf \
178 gnu/packages/linux-libre-4.4-i686.conf \
179 gnu/packages/linux-libre-4.4-x86_64.conf \
adddd5ba
MW
180 gnu/packages/linux-libre-4.1-i686.conf \
181 gnu/packages/linux-libre-4.1-x86_64.conf
1959fb04 182
ebc32b31
LC
183# Templates, examples.
184EXAMPLES = \
36ffaca2
LC
185 gnu/system/examples/bare-bones.tmpl \
186 gnu/system/examples/desktop.tmpl
ebc32b31 187
c1bc358f 188GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
af51c820 189
74574fd1
RW
190nobase_dist_guilemodule_DATA = \
191 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
192 $(MISC_DISTRO_FILES)
1959fb04 193nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 194
1959fb04
LC
195# Do we need to provide our own non-broken (srfi srfi-37) module?
196if INSTALL_SRFI_37
197
198nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
199GOBJECTS += srfi/srfi-37.go
200
201srfi/srfi-37.scm: srfi/srfi-37.scm.in
202 $(MKDIR_P) srfi
203 cp "$<" "$@"
204
205endif INSTALL_SRFI_37
ac5aa288 206
70a9c720
LC
207# Handy way to remove the .go files without removing all the rest.
208clean-go:
209 -$(RM) -f $(GOBJECTS)
210
af51c820 211
bb251307
LC
212# Test extensions; has to be unconditional.
213TEST_EXTENSIONS = .scm .sh
214
215if CAN_RUN_TESTS
216
30dd8310 217SCM_TESTS = \
ddc29a78 218 tests/base32.scm \
e9c6c584 219 tests/base64.scm \
7a18c3cc 220 tests/cpio.scm \
69927e78 221 tests/hash.scm \
3476ded9 222 tests/pk-crypto.scm \
8b420f74 223 tests/pki.scm \
d326767e 224 tests/sets.scm \
202440e0 225 tests/gnu-maintenance.scm \
2c74fde0 226 tests/substitute.scm \
af51c820
LC
227 tests/builders.scm \
228 tests/derivations.scm \
7adf9b84 229 tests/grafts.scm \
299112d3 230 tests/ui.scm \
c0cd1b3e 231 tests/records.scm \
f1eacbaf 232 tests/upstream.scm \
e3ce5d70 233 tests/utils.scm \
b0e0d0e9 234 tests/build-utils.scm \
c8c88afa 235 tests/packages.scm \
10226c05 236 tests/snix.scm \
a4154748 237 tests/hackage.scm \
e1248602 238 tests/cran.scm \
7f74a931 239 tests/elpa.scm \
3259877d 240 tests/store.scm \
b860f382 241 tests/monads.scm \
21b679f6 242 tests/gexp.scm \
53c63ee9 243 tests/nar.scm \
a2078770 244 tests/union.scm \
29fa45f4 245 tests/profiles.scm \
b4f5e0e8 246 tests/syscalls.scm \
15aa2c38 247 tests/gremlin.scm \
aff8ce7c 248 tests/lint.scm \
fcc58db6 249 tests/publish.scm \
88981dd3 250 tests/scripts.scm \
c1f6a0c2 251 tests/size.scm \
88856916 252 tests/graph.scm \
d23c20f1 253 tests/challenge.scm \
0eef7551 254 tests/cve.scm \
661a1d79 255 tests/file-systems.scm \
6b779207 256 tests/system.scm \
0adfe95a 257 tests/services.scm \
629a064f 258 tests/scripts-build.scm \
a132f7d6
BW
259 tests/containers.scm \
260 tests/import-utils.scm
30dd8310 261
1b3e9685
DT
262if HAVE_GUILE_JSON
263
d45dc6da
EB
264SCM_TESTS += \
265 tests/pypi.scm \
a96524cc
DT
266 tests/cpan.scm \
267 tests/gem.scm
1b3e9685
DT
268
269endif
270
30dd8310 271SH_TESTS = \
0afdc485 272 tests/guix-build.sh \
37d19403 273 tests/guix-download.sh \
fe8ff028 274 tests/guix-gc.sh \
ccbce848 275 tests/guix-hash.sh \
0820098d 276 tests/guix-package.sh \
57b86237 277 tests/guix-package-net.sh \
c1202fb1 278 tests/guix-system.sh \
760c60d6 279 tests/guix-archive.sh \
dd7c013d 280 tests/guix-authenticate.sh \
cad25264 281 tests/guix-environment.sh \
f535dcbe 282 tests/guix-environment-container.sh \
88856916 283 tests/guix-graph.sh \
dd7c013d 284 tests/guix-lint.sh
af51c820 285
a7a4e6a4
LC
286if BUILD_DAEMON
287
288SH_TESTS += tests/guix-register.sh
289
290endif BUILD_DAEMON
291
292
30dd8310
LC
293TESTS = $(SCM_TESTS) $(SH_TESTS)
294
352ec143
LC
295AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
296
69cfce50 297SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
298AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
299
69cfce50 300SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 301AM_SH_LOG_FLAGS = -x -e
af51c820 302
3a33730a
LC
303# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
304# could end up removing files from the store while they are being used by
305# other instances of the daemon.
306tests/guix-gc.log: \
307 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
308 $(SCM_TESTS:%.scm=%.log)
309
bb251307
LC
310else !CAN_RUN_TESTS
311
312TESTS =
313SH_TESTS =
314SCM_TESTS =
315
316# Automake always generates a 'check' target, so better not override it.
317check-local:
318 @echo
319 @echo "Cannot run tests because file name limits would be exceeded." >&2
320 @echo "Look for 'length' in the 'config.log' file for details." >&2
321 @echo
322 @exit 1
323
324endif !CAN_RUN_TESTS
325
bf59c06d 326# Public key used to sign substitutes from hydra.gnu.org.
6c110833 327dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 328
ee3e157d
LC
329# Bash completion file.
330dist_bashcompletion_DATA = etc/completion/bash/guix
331
81f61c17
LC
332EXTRA_DIST = \
333 HACKING \
334 ROADMAP \
335 TODO \
e15fcdd1 336 CODE-OF-CONDUCT \
81f61c17 337 .dir-locals.el \
f81ac34d 338 build-aux/build-self.scm \
de6af327 339 build-aux/compile-all.scm \
81f61c17
LC
340 build-aux/hydra/gnu-system.scm \
341 build-aux/hydra/demo-os.scm \
342 build-aux/hydra/guix.scm \
343 build-aux/check-available-binaries.scm \
344 build-aux/check-final-inputs-self-contained.scm \
345 build-aux/download.scm \
8bc35f85 346 build-aux/make-binary-tarball.scm \
1c2ae810 347 build-aux/generate-authors.scm \
81f61c17
LC
348 srfi/srfi-37.scm.in \
349 srfi/srfi-64.scm \
350 srfi/srfi-64.upstream.scm \
351 tests/test.drv \
352 tests/signing-key.pub \
353 tests/signing-key.sec \
0eef7551 354 tests/cve-sample.xml \
81f61c17
LC
355 build-aux/config.rpath \
356 bootstrap \
357 release.nix \
ed795c06 358 $(TESTS)
d7672884 359
49e6291a
LC
360if !BUILD_DAEMON_OFFLOAD
361
362EXTRA_DIST += \
363 guix/scripts/offload.scm
364
365endif !BUILD_DAEMON_OFFLOAD
366
12e5b266
LC
367if !BUILD_SYSCALLS_MODULE
368
369EXTRA_DIST += \
370 guix/build/syscalls.scm
371
372endif !BUILD_SYSCALLS_MODULE
373
49e6291a 374
30dd8310
LC
375CLEANFILES = \
376 $(GOBJECTS) \
9bff16b3 377 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 378
28561d85
LC
379# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
380# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
381# there that are newer than the local .scm files (for instance because the
382# user ran 'make install' recently). When that happens, we end up loading
383# those previously-installed .go files, which may be stale, thereby breaking
384# the whole thing.
de6af327
TUBK
385%.go: make-go ; @:
386make-go: $(MODULES) guix/config.scm guix/tests.scm
387 $(AM_V_at)echo "Compiling Scheme modules..." ; \
28561d85 388 unset GUILE_LOAD_COMPILED_PATH ; \
de6af327 389 host=$(host) srcdir="$(top_srcdir)" \
671d8f5e 390 $(top_builddir)/pre-inst-env \
de6af327
TUBK
391 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
392 --no-auto-compile \
393 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
af51c820
LC
394
395SUFFIXES = .go
396
397# Make sure source files are installed first, so that the mtime of
398# installed compiled files is greater than that of installed source
399# files. See
400# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
401# for details.
402guix_install_go_files = install-nobase_nodist_guilemoduleDATA
403$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 404
6005bd07
LC
405# The above trick doesn't work for 'config.go' because both 'config.scm' and
406# 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
407# special treatment.
408install-data-hook: set-bootstrap-executable-permissions
409 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
410
411
ee764179 412SUBDIRS = po/guix po/packages
931c132a 413BUILT_SOURCES =
a9424c08
LC
414
415include doc.am
568717fd 416
c2033df4
LC
417if BUILD_DAEMON
418
419include daemon.am
420
421endif BUILD_DAEMON
422
f68b0893 423ACLOCAL_AMFLAGS = -I m4
ef5f5c86
LC
424
425# Pass an explicit '--localstatedir' so that configure does not error out if
426# it finds an existing installation with a different localstatedir.
e76bdf8b 427AM_DISTCHECK_CONFIGURE_FLAGS = \
ef5f5c86 428 --localstatedir="$$dc_install_base/var" \
d388c2c4 429 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 430 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
431 --with-nix-prefix="$(NIX_PREFIX)" \
432 --enable-daemon
0e993428 433
457f60fa
AK
434dist_emacsui_DATA = emacs/guix-main.scm
435nodist_emacsui_DATA = emacs/guix-helper.scm
436include emacs.am
437
9d3fb6c7
LC
438# The self-contained tarball.
439guix-binary.%.tar.xz:
e71ad29d 440 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
9d3fb6c7
LC
441 $(top_builddir)/pre-inst-env "$(GUILE)" \
442 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
443
444
a8ac45b1
AK
445dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
446dist-hook: assert-no-store-file-names
447
81f61c17 448distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 449
668d48a6 450sync-descriptions:
e71ad29d 451 $(AM_V_at)GUIX_PACKAGE_PATH= \
36c45230 452 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
e793178a
LC
453
454gen-ChangeLog:
e71ad29d 455 $(AM_V_GEN)if test -d .git; then \
e793178a
LC
456 $(top_srcdir)/build-aux/gitlog-to-changelog \
457 > $(distdir)/cl-t; \
458 rm -f $(distdir)/ChangeLog; \
459 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
460 fi
461
a8ac45b1 462gen-AUTHORS:
e71ad29d 463 $(AM_V_GEN)if test -d .git; then \
ac140f79
LC
464 rm -f "$(distdir)/AUTHORS"; \
465 $(top_builddir)/pre-inst-env "$(GUILE)" \
466 "$(top_srcdir)/build-aux/generate-authors.scm" \
467 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
468 fi
a8ac45b1 469
834129e0 470# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9 471assert-no-store-file-names:
e71ad29d 472 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
a463ffd9
LC
473 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
474 then \
475 echo "error: store file names embedded in the distribution" >&2 ; \
476 exit 1 ; \
477 fi
478
56fbf262
LC
479# Make sure hydra.gnu.org has the important binaries.
480assert-binaries-available:
e71ad29d 481 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
56fbf262
LC
482 "$(top_srcdir)/build-aux/check-available-binaries.scm"
483
81f61c17
LC
484# Make sure the final inputs don't refer to bootstrap tools.
485assert-final-inputs-self-contained:
e71ad29d 486 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
81f61c17
LC
487 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
488
de6af327 489.PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
56fbf262 490.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 491.PHONY: assert-final-inputs-self-contained
8c3d8894
ML
492
493## -------------- ##
494## Silent rules. ##
495## -------------- ##
496
497AM_V_DL = $(AM_V_DL_$(V))
498AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
499AM_V_DL_0 = @echo " DL " $@;
4c48878d
ML
500
501AM_V_DOT = $(AM_V_DOT_$(V))
502AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
503AM_V_DOT_0 = @echo " DOT " $@;
71ed439b
ML
504
505AM_V_EMACS = $(AM_V_EMACS_$(V))
506AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
507AM_V_EMACS_0 = @echo " EMACS " $@;
8dddedf7
ML
508
509AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
510AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
511AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;