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>
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 \
45 guix/git-download.scm \
46 guix/hg-download.scm \
51 guix/serialization.scm \
53 guix/derivations.scm \
55 guix/gnu-maintenance.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 \
75 guix/http-client.scm \
79 guix/cvs-download.scm \
80 guix/svn-download.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 \
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 \
105 guix/build/syscalls.scm \
106 guix/build/gremlin.scm \
107 guix/build/emacs-utils.scm \
108 guix/build/graft.scm \
109 guix/build/bournish.scm \
110 guix/search-paths.scm \
112 guix/import/utils.scm \
113 guix/import/gnu.scm \
114 guix/import/snix.scm \
115 guix/import/cabal.scm \
116 guix/import/cran.scm \
117 guix/import/hackage.scm \
118 guix/import/elpa.scm \
120 guix/scripts/download.scm \
121 guix/scripts/build.scm \
122 guix/scripts/archive.scm \
123 guix/scripts/import.scm \
124 guix/scripts/package.scm \
125 guix/scripts/gc.scm \
126 guix/scripts/hash.scm \
127 guix/scripts/pull.scm \
128 guix/scripts/substitute.scm \
129 guix/scripts/authenticate.scm \
130 guix/scripts/refresh.scm \
131 guix/scripts/system.scm \
132 guix/scripts/lint.scm \
133 guix/scripts/challenge.scm \
134 guix/scripts/import/cran.scm \
135 guix/scripts/import/gnu.scm \
136 guix/scripts/import/nix.scm \
137 guix/scripts/import/hackage.scm \
138 guix/scripts/import/elpa.scm \
139 guix/scripts/environment.scm \
140 guix/scripts/publish.scm \
141 guix/scripts/edit.scm \
142 guix/scripts/size.scm \
143 guix/scripts/graph.scm \
144 guix/scripts/container.scm \
145 guix/scripts/container/exec.scm \
147 $(GNU_SYSTEM_MODULES)
152 guix/import/github.scm \
153 guix/import/json.scm \
154 guix/import/pypi.scm \
155 guix/scripts/import/pypi.scm \
156 guix/import/cpan.scm \
157 guix/scripts/import/gem.scm \
162 if BUILD_DAEMON_OFFLOAD
165 guix/scripts/offload.scm
167 endif BUILD_DAEMON_OFFLOAD
169 # Internal module with test suite support.
170 dist_noinst_DATA = guix/tests.scm
172 # Linux-Libre configurations.
174 gnu/packages/linux-libre-4.7-i686.conf \
175 gnu/packages/linux-libre-4.7-x86_64.conf \
176 gnu/packages/linux-libre-4.4-i686.conf \
177 gnu/packages/linux-libre-4.4-x86_64.conf \
178 gnu/packages/linux-libre-4.1-i686.conf \
179 gnu/packages/linux-libre-4.1-x86_64.conf
181 # Templates, examples.
183 gnu/system/examples/bare-bones.tmpl \
184 gnu/system/examples/desktop.tmpl \
185 gnu/system/examples/lightweight-desktop.tmpl
187 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
189 nobase_dist_guilemodule_DATA = \
190 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
192 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
194 # Do we need to provide our own non-broken (srfi srfi-37) module?
197 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
198 GOBJECTS += srfi/srfi-37.go
200 srfi/srfi-37.scm: srfi/srfi-37.scm.in
204 endif INSTALL_SRFI_37
206 # Handy way to remove the .go files without removing all the rest.
208 -$(RM) -f $(GOBJECTS)
211 # Test extensions; has to be unconditional.
212 TEST_EXTENSIONS = .scm .sh
221 tests/pk-crypto.scm \
224 tests/gnu-maintenance.scm \
225 tests/substitute.scm \
227 tests/derivations.scm \
232 tests/combinators.scm \
234 tests/build-utils.scm \
254 tests/challenge.scm \
257 tests/file-systems.scm \
260 tests/scripts-build.scm \
261 tests/containers.scm \
262 tests/import-utils.scm
274 tests/guix-build.sh \
275 tests/guix-download.sh \
278 tests/guix-package.sh \
279 tests/guix-package-net.sh \
280 tests/guix-system.sh \
281 tests/guix-archive.sh \
282 tests/guix-authenticate.sh \
283 tests/guix-environment.sh \
284 tests/guix-environment-container.sh \
285 tests/guix-graph.sh \
290 SH_TESTS += tests/guix-register.sh
295 TESTS = $(SCM_TESTS) $(SH_TESTS)
297 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
300 $(top_builddir)/test-env --quiet-stderr \
301 $(GUILE) --no-auto-compile -e main \
302 $(top_srcdir)/build-aux/test-driver.scm
304 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
306 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
307 AM_SH_LOG_FLAGS = -x -e
309 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
310 # could end up removing files from the store while they are being used by
311 # other instances of the daemon.
313 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
314 $(SCM_TESTS:%.scm=%.log)
322 # Automake always generates a 'check' target, so better not override it.
325 @echo "Cannot run tests because file name limits would be exceeded." >&2
326 @echo "Look for 'length' in the 'config.log' file for details." >&2
332 check-system: $(GOBJECTS)
333 $(AM_V_at)$(top_builddir)/pre-inst-env \
334 $(GUILE) --no-auto-compile \
335 -e '(@@ (run-system-tests) run-system-tests)' \
336 $(top_srcdir)/build-aux/run-system-tests.scm
338 # Public key used to sign substitutes from hydra.gnu.org.
339 dist_pkgdata_DATA = hydra.gnu.org.pub
341 # Bash completion file.
342 dist_bashcompletion_DATA = etc/completion/bash/guix
350 build-aux/build-self.scm \
351 build-aux/compile-all.scm \
352 build-aux/hydra/evaluate.scm \
353 build-aux/hydra/gnu-system.scm \
354 build-aux/hydra/demo-os.scm \
355 build-aux/hydra/guix.scm \
356 build-aux/check-available-binaries.scm \
357 build-aux/check-final-inputs-self-contained.scm \
358 build-aux/download.scm \
359 build-aux/make-binary-tarball.scm \
360 build-aux/generate-authors.scm \
361 build-aux/test-driver.scm \
362 build-aux/run-system-tests.scm \
363 srfi/srfi-37.scm.in \
365 srfi/srfi-64.upstream.scm \
367 tests/signing-key.pub \
368 tests/signing-key.sec \
369 tests/cve-sample.xml \
370 build-aux/config.rpath \
375 if !BUILD_DAEMON_OFFLOAD
378 guix/scripts/offload.scm
380 endif !BUILD_DAEMON_OFFLOAD
385 $(SCM_TESTS:tests/%.scm=%.log)
387 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
388 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
389 # there that are newer than the local .scm files (for instance because the
390 # user ran 'make install' recently). When that happens, we end up loading
391 # those previously-installed .go files, which may be stale, thereby breaking
392 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
393 # stale files from ~/.cache/guile/ccache.
395 make-go: $(MODULES) guix/config.scm guix/tests.scm
396 $(AM_V_at)echo "Compiling Scheme modules..." ; \
397 unset GUILE_LOAD_COMPILED_PATH ; \
398 XDG_CACHE_HOME=/nowhere \
399 host=$(host) srcdir="$(top_srcdir)" \
400 $(top_builddir)/pre-inst-env \
401 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
403 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
407 # Make sure source files are installed first, so that the mtime of
408 # installed compiled files is greater than that of installed source
410 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
412 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
413 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
415 # The above trick doesn't work for 'config.go' because both 'config.scm' and
416 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
418 install-data-hook: set-bootstrap-executable-permissions
419 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
422 SUBDIRS = po/guix po/packages
433 ACLOCAL_AMFLAGS = -I m4
435 # Pass an explicit '--localstatedir' so that configure does not error out if
436 # it finds an existing installation with a different localstatedir.
437 AM_DISTCHECK_CONFIGURE_FLAGS = \
438 --localstatedir="$$dc_install_base/var" \
439 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
440 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
441 --with-nix-prefix="$(NIX_PREFIX)" \
444 dist_emacsui_DATA = emacs/guix-main.scm
445 nodist_emacsui_DATA = emacs/guix-helper.scm
446 include emacs/local.mk
448 # The self-contained tarball.
449 guix-binary.%.tar.xz:
450 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
451 $(top_builddir)/pre-inst-env "$(GUILE)" \
452 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
455 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
456 dist-hook: assert-no-store-file-names
458 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
461 $(AM_V_at)GUIX_PACKAGE_PATH= \
462 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
465 $(AM_V_GEN)if test -d .git; then \
466 $(top_srcdir)/build-aux/gitlog-to-changelog \
468 rm -f $(distdir)/ChangeLog; \
469 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
473 $(AM_V_GEN)if test -d .git; then \
474 rm -f "$(distdir)/AUTHORS"; \
475 $(top_builddir)/pre-inst-env "$(GUILE)" \
476 "$(top_srcdir)/build-aux/generate-authors.scm" \
477 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
480 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
481 assert-no-store-file-names:
482 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
483 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
485 echo "error: store file names embedded in the distribution" >&2 ; \
489 # Make sure hydra.gnu.org has the important binaries.
490 assert-binaries-available: $(GOBJECTS)
491 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
492 "$(top_srcdir)/build-aux/check-available-binaries.scm"
494 # Make sure the final inputs don't refer to bootstrap tools.
495 assert-final-inputs-self-contained: $(GOBJECTS)
496 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
497 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
499 # Compute the Hydra jobs and write them in the target file.
500 hydra-jobs.scm: $(GOBJECTS)
501 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
502 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
503 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
504 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
505 $(AM_V_at)mv "$@.tmp" "$@"
507 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
508 .PHONY: assert-no-store-file-names assert-binaries-available
509 .PHONY: assert-final-inputs-self-contained
515 AM_V_DL = $(AM_V_DL_$(V))
516 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
517 AM_V_DL_0 = @echo " DL " $@;
519 AM_V_DOT = $(AM_V_DOT_$(V))
520 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
521 AM_V_DOT_0 = @echo " DOT " $@;
523 AM_V_EMACS = $(AM_V_EMACS_$(V))
524 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
525 AM_V_EMACS_0 = @echo " EMACS " $@;
527 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
528 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
529 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;