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