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>
8 # This file is part of GNU Guix.
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.
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.
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/>.
26 nodist_noinst_SCRIPTS = \
41 guix/combinators.scm \
42 guix/memoization.scm \
47 guix/git-download.scm \
48 guix/hg-download.scm \
53 guix/serialization.scm \
55 guix/derivations.scm \
57 guix/gnu-maintenance.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/emacs.scm \
68 guix/build-system/asdf.scm \
69 guix/build-system/glib-or-gtk.scm \
70 guix/build-system/gnu.scm \
71 guix/build-system/haskell.scm \
72 guix/build-system/perl.scm \
73 guix/build-system/python.scm \
74 guix/build-system/ocaml.scm \
75 guix/build-system/waf.scm \
76 guix/build-system/r.scm \
77 guix/build-system/ruby.scm \
78 guix/build-system/trivial.scm \
80 guix/http-client.scm \
84 guix/cvs-download.scm \
85 guix/svn-download.scm \
87 guix/build/ant-build-system.scm \
88 guix/build/download.scm \
89 guix/build/cargo-build-system.scm \
90 guix/build/cmake-build-system.scm \
91 guix/build/emacs-build-system.scm \
92 guix/build/asdf-build-system.scm \
95 guix/build/glib-or-gtk-build-system.scm \
96 guix/build/gnu-build-system.scm \
97 guix/build/gnu-dist.scm \
98 guix/build/perl-build-system.scm \
99 guix/build/python-build-system.scm \
100 guix/build/ocaml-build-system.scm \
101 guix/build/r-build-system.scm \
102 guix/build/ruby-build-system.scm \
103 guix/build/waf-build-system.scm \
104 guix/build/haskell-build-system.scm \
105 guix/build/store-copy.scm \
106 guix/build/utils.scm \
107 guix/build/union.scm \
108 guix/build/profiles.scm \
109 guix/build/pull.scm \
110 guix/build/rpath.scm \
113 guix/build/syscalls.scm \
114 guix/build/gremlin.scm \
115 guix/build/emacs-utils.scm \
116 guix/build/lisp-utils.scm \
117 guix/build/graft.scm \
118 guix/build/bournish.scm \
119 guix/build/qt-utils.scm \
120 guix/build/make-bootstrap.scm \
121 guix/search-paths.scm \
123 guix/import/utils.scm \
124 guix/import/gnu.scm \
125 guix/import/snix.scm \
126 guix/import/cabal.scm \
127 guix/import/cran.scm \
128 guix/import/hackage.scm \
129 guix/import/elpa.scm \
131 guix/scripts/download.scm \
132 guix/scripts/perform-download.scm \
133 guix/scripts/build.scm \
134 guix/scripts/archive.scm \
135 guix/scripts/import.scm \
136 guix/scripts/package.scm \
137 guix/scripts/gc.scm \
138 guix/scripts/hash.scm \
139 guix/scripts/pull.scm \
140 guix/scripts/substitute.scm \
141 guix/scripts/authenticate.scm \
142 guix/scripts/refresh.scm \
143 guix/scripts/system.scm \
144 guix/scripts/lint.scm \
145 guix/scripts/challenge.scm \
146 guix/scripts/import/cran.scm \
147 guix/scripts/import/gnu.scm \
148 guix/scripts/import/nix.scm \
149 guix/scripts/import/hackage.scm \
150 guix/scripts/import/elpa.scm \
151 guix/scripts/environment.scm \
152 guix/scripts/publish.scm \
153 guix/scripts/edit.scm \
154 guix/scripts/size.scm \
155 guix/scripts/graph.scm \
156 guix/scripts/container.scm \
157 guix/scripts/container/exec.scm \
159 $(GNU_SYSTEM_MODULES)
165 guix/import/github.scm \
166 guix/import/json.scm \
167 guix/import/crate.scm \
168 guix/scripts/import/crate.scm \
169 guix/import/pypi.scm \
170 guix/scripts/import/pypi.scm \
171 guix/import/cpan.scm \
172 guix/scripts/import/gem.scm \
181 guix/scripts/copy.scm
185 if BUILD_DAEMON_OFFLOAD
188 guix/scripts/offload.scm
190 endif BUILD_DAEMON_OFFLOAD
192 # Internal modules with test suite support.
193 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
195 # Linux-Libre configurations.
197 gnu/packages/linux-libre-4.9-i686.conf \
198 gnu/packages/linux-libre-4.9-x86_64.conf \
199 gnu/packages/linux-libre-4.4-i686.conf \
200 gnu/packages/linux-libre-4.4-x86_64.conf \
201 gnu/packages/linux-libre-4.1-i686.conf \
202 gnu/packages/linux-libre-4.1-x86_64.conf
204 # Templates, examples.
206 gnu/system/examples/bare-bones.tmpl \
207 gnu/system/examples/desktop.tmpl \
208 gnu/system/examples/lightweight-desktop.tmpl
210 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
212 nobase_dist_guilemodule_DATA = \
213 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
215 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
217 # Do we need to provide our own non-broken (srfi srfi-37) module?
220 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
221 GOBJECTS += srfi/srfi-37.go
223 srfi/srfi-37.scm: srfi/srfi-37.scm.in
227 endif INSTALL_SRFI_37
229 # Handy way to remove the .go files without removing all the rest.
231 -$(RM) -f $(GOBJECTS)
232 @find . -name '*.go' -print | \
234 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
236 xargs -r echo "warning: stray .go files:"; \
240 # Test extensions; has to be unconditional.
241 TEST_EXTENSIONS = .scm .sh
250 tests/pk-crypto.scm \
254 tests/gnu-maintenance.scm \
255 tests/substitute.scm \
257 tests/derivations.scm \
262 tests/combinators.scm \
264 tests/build-utils.scm \
284 tests/challenge.scm \
287 tests/file-systems.scm \
290 tests/scripts-build.scm \
291 tests/containers.scm \
292 tests/import-utils.scm
305 tests/guix-build.sh \
306 tests/guix-download.sh \
309 tests/guix-package.sh \
310 tests/guix-package-net.sh \
311 tests/guix-system.sh \
312 tests/guix-archive.sh \
313 tests/guix-authenticate.sh \
314 tests/guix-environment.sh \
315 tests/guix-environment-container.sh \
316 tests/guix-graph.sh \
321 SH_TESTS += tests/guix-register.sh
326 TESTS = $(SCM_TESTS) $(SH_TESTS)
328 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
331 $(top_builddir)/test-env --quiet-stderr \
332 $(GUILE) --no-auto-compile -e main \
333 $(top_srcdir)/build-aux/test-driver.scm
335 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
337 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
338 AM_SH_LOG_FLAGS = -x -e
340 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
341 # could end up removing files from the store while they are being used by
342 # other instances of the daemon.
344 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
345 $(SCM_TESTS:%.scm=%.log)
353 # Automake always generates a 'check' target, so better not override it.
356 @echo "Cannot run tests because file name limits would be exceeded." >&2
357 @echo "Look for 'length' in the 'config.log' file for details." >&2
363 check-system: $(GOBJECTS)
364 $(AM_V_at)$(top_builddir)/pre-inst-env \
365 $(GUILE) --no-auto-compile \
366 -e '(@@ (run-system-tests) run-system-tests)' \
367 $(top_srcdir)/build-aux/run-system-tests.scm
369 # Public key used to sign substitutes from hydra.gnu.org.
370 dist_pkgdata_DATA = hydra.gnu.org.pub
372 # Bash completion file.
373 dist_bashcompletion_DATA = etc/completion/bash/guix
375 # Zsh completion file.
376 dist_zshcompletion_DATA = etc/completion/zsh/_guix
384 build-aux/build-self.scm \
385 build-aux/compile-all.scm \
386 build-aux/hydra/evaluate.scm \
387 build-aux/hydra/gnu-system.scm \
388 build-aux/hydra/demo-os.scm \
389 build-aux/hydra/guix.scm \
390 build-aux/check-available-binaries.scm \
391 build-aux/check-final-inputs-self-contained.scm \
392 build-aux/download.scm \
393 build-aux/make-binary-tarball.scm \
394 build-aux/generate-authors.scm \
395 build-aux/test-driver.scm \
396 build-aux/run-system-tests.scm \
399 srfi/srfi-37.scm.in \
401 srfi/srfi-64.upstream.scm \
403 tests/signing-key.pub \
404 tests/signing-key.sec \
405 tests/cve-sample.xml \
406 build-aux/config.rpath \
411 if !BUILD_DAEMON_OFFLOAD
414 guix/scripts/offload.scm
416 endif !BUILD_DAEMON_OFFLOAD
421 $(SCM_TESTS:tests/%.scm=%.log)
423 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
424 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
425 # there that are newer than the local .scm files (for instance because the
426 # user ran 'make install' recently). When that happens, we end up loading
427 # those previously-installed .go files, which may be stale, thereby breaking
428 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
429 # stale files from ~/.cache/guile/ccache.
431 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
432 $(AM_V_at)echo "Compiling Scheme modules..." ; \
433 unset GUILE_LOAD_COMPILED_PATH ; \
434 XDG_CACHE_HOME=/nowhere \
435 host=$(host) srcdir="$(top_srcdir)" \
436 $(top_builddir)/pre-inst-env \
437 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
439 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
443 # Make sure source files are installed first, so that the mtime of
444 # installed compiled files is greater than that of installed source
446 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
448 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
449 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
451 # The above trick doesn't work for 'config.go' because both 'config.scm' and
452 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
454 install-data-hook: set-bootstrap-executable-permissions
455 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
458 SUBDIRS = po/guix po/packages
469 ACLOCAL_AMFLAGS = -I m4
471 # Pass an explicit '--localstatedir' so that configure does not error out if
472 # it finds an existing installation with a different localstatedir.
473 AM_DISTCHECK_CONFIGURE_FLAGS = \
474 --localstatedir="$$dc_install_base/var" \
475 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
476 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
477 --with-nix-prefix="$(NIX_PREFIX)" \
480 # The self-contained tarball.
481 guix-binary.%.tar.xz:
482 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
483 $(top_builddir)/pre-inst-env "$(GUILE)" \
484 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
487 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
488 dist-hook: assert-no-store-file-names
490 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
493 $(AM_V_at)GUIX_PACKAGE_PATH= \
494 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
497 $(AM_V_GEN)if test -d .git; then \
498 $(top_srcdir)/build-aux/gitlog-to-changelog \
500 rm -f $(distdir)/ChangeLog; \
501 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
505 $(AM_V_GEN)if test -d .git; then \
506 rm -f "$(distdir)/AUTHORS"; \
507 $(top_builddir)/pre-inst-env "$(GUILE)" \
508 "$(top_srcdir)/build-aux/generate-authors.scm" \
509 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
512 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
513 assert-no-store-file-names:
514 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
515 --exclude=*.info-[0-9] --exclude=*.dot \
516 --exclude=*.eps --exclude-dir=bootstrap \
517 --exclude=guix-prettify.el \
518 --exclude=ChangeLog \
519 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
521 echo "error: store file names embedded in the distribution" >&2 ; \
525 # Make sure hydra.gnu.org has the important binaries.
526 assert-binaries-available: $(GOBJECTS)
527 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
528 "$(top_srcdir)/build-aux/check-available-binaries.scm"
530 # Make sure the final inputs don't refer to bootstrap tools.
531 assert-final-inputs-self-contained: $(GOBJECTS)
532 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
533 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
535 # Compute the Hydra jobs and write them in the target file.
536 hydra-jobs.scm: $(GOBJECTS)
537 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
538 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
539 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
540 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
541 $(AM_V_at)mv "$@.tmp" "$@"
543 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
544 .PHONY: assert-no-store-file-names assert-binaries-available
545 .PHONY: assert-final-inputs-self-contained
551 AM_V_DL = $(AM_V_DL_$(V))
552 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
553 AM_V_DL_0 = @echo " DL " $@;
555 AM_V_DOT = $(AM_V_DOT_$(V))
556 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
557 AM_V_DOT_0 = @echo " DOT " $@;
559 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
560 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
561 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;