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