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