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 \
50 guix/serialization.scm \
52 guix/derivations.scm \
54 guix/gnu-maintenance.scm \
59 guix/build-system.scm \
60 guix/build-system/ant.scm \
61 guix/build-system/cmake.scm \
62 guix/build-system/emacs.scm \
63 guix/build-system/glib-or-gtk.scm \
64 guix/build-system/gnu.scm \
65 guix/build-system/haskell.scm \
66 guix/build-system/perl.scm \
67 guix/build-system/python.scm \
68 guix/build-system/waf.scm \
69 guix/build-system/r.scm \
70 guix/build-system/ruby.scm \
71 guix/build-system/trivial.scm \
73 guix/http-client.scm \
77 guix/cvs-download.scm \
78 guix/svn-download.scm \
80 guix/build/ant-build-system.scm \
81 guix/build/download.scm \
82 guix/build/cmake-build-system.scm \
83 guix/build/emacs-build-system.scm \
85 guix/build/glib-or-gtk-build-system.scm \
86 guix/build/gnu-build-system.scm \
87 guix/build/gnu-dist.scm \
88 guix/build/perl-build-system.scm \
89 guix/build/python-build-system.scm \
90 guix/build/r-build-system.scm \
91 guix/build/ruby-build-system.scm \
92 guix/build/waf-build-system.scm \
93 guix/build/haskell-build-system.scm \
94 guix/build/store-copy.scm \
95 guix/build/utils.scm \
96 guix/build/union.scm \
97 guix/build/profiles.scm \
99 guix/build/rpath.scm \
102 guix/build/gremlin.scm \
103 guix/build/emacs-utils.scm \
104 guix/build/graft.scm \
105 guix/build/bournish.scm \
106 guix/search-paths.scm \
108 guix/import/utils.scm \
109 guix/import/gnu.scm \
110 guix/import/snix.scm \
111 guix/import/cabal.scm \
112 guix/import/cran.scm \
113 guix/import/hackage.scm \
114 guix/import/elpa.scm \
116 guix/scripts/download.scm \
117 guix/scripts/build.scm \
118 guix/scripts/archive.scm \
119 guix/scripts/import.scm \
120 guix/scripts/package.scm \
121 guix/scripts/gc.scm \
122 guix/scripts/hash.scm \
123 guix/scripts/pull.scm \
124 guix/scripts/substitute.scm \
125 guix/scripts/authenticate.scm \
126 guix/scripts/refresh.scm \
127 guix/scripts/system.scm \
128 guix/scripts/lint.scm \
129 guix/scripts/challenge.scm \
130 guix/scripts/import/cran.scm \
131 guix/scripts/import/gnu.scm \
132 guix/scripts/import/nix.scm \
133 guix/scripts/import/hackage.scm \
134 guix/scripts/import/elpa.scm \
135 guix/scripts/environment.scm \
136 guix/scripts/publish.scm \
137 guix/scripts/edit.scm \
138 guix/scripts/size.scm \
139 guix/scripts/graph.scm \
140 guix/scripts/container.scm \
141 guix/scripts/container/exec.scm \
143 $(GNU_SYSTEM_MODULES)
148 guix/import/github.scm \
149 guix/import/json.scm \
150 guix/import/pypi.scm \
151 guix/scripts/import/pypi.scm \
152 guix/import/cpan.scm \
153 guix/scripts/import/gem.scm \
158 if BUILD_SYSCALLS_MODULE
161 guix/build/syscalls.scm
165 if BUILD_DAEMON_OFFLOAD
168 guix/scripts/offload.scm
170 endif BUILD_DAEMON_OFFLOAD
172 # Internal module with test suite support.
173 dist_noinst_DATA = guix/tests.scm
175 # Linux-Libre configurations.
177 gnu/packages/linux-libre-4.6-i686.conf \
178 gnu/packages/linux-libre-4.6-x86_64.conf \
179 gnu/packages/linux-libre-4.4-i686.conf \
180 gnu/packages/linux-libre-4.4-x86_64.conf \
181 gnu/packages/linux-libre-4.1-i686.conf \
182 gnu/packages/linux-libre-4.1-x86_64.conf
184 # Templates, examples.
186 gnu/system/examples/bare-bones.tmpl \
187 gnu/system/examples/desktop.tmpl \
188 gnu/system/examples/lightweight-desktop.tmpl
190 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
192 nobase_dist_guilemodule_DATA = \
193 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
195 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
197 # Do we need to provide our own non-broken (srfi srfi-37) module?
200 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
201 GOBJECTS += srfi/srfi-37.go
203 srfi/srfi-37.scm: srfi/srfi-37.scm.in
207 endif INSTALL_SRFI_37
209 # Handy way to remove the .go files without removing all the rest.
211 -$(RM) -f $(GOBJECTS)
214 # Test extensions; has to be unconditional.
215 TEST_EXTENSIONS = .scm .sh
224 tests/pk-crypto.scm \
227 tests/gnu-maintenance.scm \
228 tests/substitute.scm \
230 tests/derivations.scm \
235 tests/combinators.scm \
237 tests/build-utils.scm \
256 tests/challenge.scm \
258 tests/file-systems.scm \
261 tests/scripts-build.scm \
262 tests/containers.scm \
263 tests/import-utils.scm
275 tests/guix-build.sh \
276 tests/guix-download.sh \
279 tests/guix-package.sh \
280 tests/guix-package-net.sh \
281 tests/guix-system.sh \
282 tests/guix-archive.sh \
283 tests/guix-authenticate.sh \
284 tests/guix-environment.sh \
285 tests/guix-environment-container.sh \
286 tests/guix-graph.sh \
291 SH_TESTS += tests/guix-register.sh
296 TESTS = $(SCM_TESTS) $(SH_TESTS)
298 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
301 $(top_builddir)/test-env --quiet-stderr \
302 $(GUILE) --no-auto-compile -e main \
303 $(top_srcdir)/build-aux/test-driver.scm
305 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
307 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
308 AM_SH_LOG_FLAGS = -x -e
310 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
311 # could end up removing files from the store while they are being used by
312 # other instances of the daemon.
314 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
315 $(SCM_TESTS:%.scm=%.log)
323 # Automake always generates a 'check' target, so better not override it.
326 @echo "Cannot run tests because file name limits would be exceeded." >&2
327 @echo "Look for 'length' in the 'config.log' file for details." >&2
333 check-system: $(GOBJECTS)
334 $(AM_V_at)echo "Running system tests..."
335 $(AM_V_at)$(top_builddir)/pre-inst-env \
336 $(GUILE) --no-auto-compile \
337 -e '(@@ (run-system-tests) run-system-tests)' \
338 $(top_srcdir)/build-aux/run-system-tests.scm
340 # Public key used to sign substitutes from hydra.gnu.org.
341 dist_pkgdata_DATA = hydra.gnu.org.pub
343 # Bash completion file.
344 dist_bashcompletion_DATA = etc/completion/bash/guix
352 build-aux/build-self.scm \
353 build-aux/compile-all.scm \
354 build-aux/hydra/evaluate.scm \
355 build-aux/hydra/gnu-system.scm \
356 build-aux/hydra/demo-os.scm \
357 build-aux/hydra/guix.scm \
358 build-aux/check-available-binaries.scm \
359 build-aux/check-final-inputs-self-contained.scm \
360 build-aux/download.scm \
361 build-aux/make-binary-tarball.scm \
362 build-aux/generate-authors.scm \
363 build-aux/test-driver.scm \
364 build-aux/run-system-tests.scm \
365 srfi/srfi-37.scm.in \
367 srfi/srfi-64.upstream.scm \
369 tests/signing-key.pub \
370 tests/signing-key.sec \
371 tests/cve-sample.xml \
372 build-aux/config.rpath \
377 if !BUILD_DAEMON_OFFLOAD
380 guix/scripts/offload.scm
382 endif !BUILD_DAEMON_OFFLOAD
384 if !BUILD_SYSCALLS_MODULE
387 guix/build/syscalls.scm
389 endif !BUILD_SYSCALLS_MODULE
394 $(SCM_TESTS:tests/%.scm=%.log)
396 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
397 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
398 # there that are newer than the local .scm files (for instance because the
399 # user ran 'make install' recently). When that happens, we end up loading
400 # those previously-installed .go files, which may be stale, thereby breaking
403 make-go: $(MODULES) guix/config.scm guix/tests.scm
404 $(AM_V_at)echo "Compiling Scheme modules..." ; \
405 unset GUILE_LOAD_COMPILED_PATH ; \
406 host=$(host) srcdir="$(top_srcdir)" \
407 $(top_builddir)/pre-inst-env \
408 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
410 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
414 # Make sure source files are installed first, so that the mtime of
415 # installed compiled files is greater than that of installed source
417 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
419 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
420 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
422 # The above trick doesn't work for 'config.go' because both 'config.scm' and
423 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
425 install-data-hook: set-bootstrap-executable-permissions
426 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
429 SUBDIRS = po/guix po/packages
440 ACLOCAL_AMFLAGS = -I m4
442 # Pass an explicit '--localstatedir' so that configure does not error out if
443 # it finds an existing installation with a different localstatedir.
444 AM_DISTCHECK_CONFIGURE_FLAGS = \
445 --localstatedir="$$dc_install_base/var" \
446 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
447 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
448 --with-nix-prefix="$(NIX_PREFIX)" \
451 dist_emacsui_DATA = emacs/guix-main.scm
452 nodist_emacsui_DATA = emacs/guix-helper.scm
453 include emacs/local.mk
455 # The self-contained tarball.
456 guix-binary.%.tar.xz:
457 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
458 $(top_builddir)/pre-inst-env "$(GUILE)" \
459 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
462 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
463 dist-hook: assert-no-store-file-names
465 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
468 $(AM_V_at)GUIX_PACKAGE_PATH= \
469 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
472 $(AM_V_GEN)if test -d .git; then \
473 $(top_srcdir)/build-aux/gitlog-to-changelog \
475 rm -f $(distdir)/ChangeLog; \
476 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
480 $(AM_V_GEN)if test -d .git; then \
481 rm -f "$(distdir)/AUTHORS"; \
482 $(top_builddir)/pre-inst-env "$(GUILE)" \
483 "$(top_srcdir)/build-aux/generate-authors.scm" \
484 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
487 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
488 assert-no-store-file-names:
489 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
490 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
492 echo "error: store file names embedded in the distribution" >&2 ; \
496 # Make sure hydra.gnu.org has the important binaries.
497 assert-binaries-available: $(GOBJECTS)
498 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
499 "$(top_srcdir)/build-aux/check-available-binaries.scm"
501 # Make sure the final inputs don't refer to bootstrap tools.
502 assert-final-inputs-self-contained: $(GOBJECTS)
503 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
504 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
506 # Compute the Hydra jobs and write them in the target file.
507 hydra-jobs.scm: $(GOBJECTS)
508 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
509 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
510 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
511 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
512 $(AM_V_at)mv "$@.tmp" "$@"
514 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
515 .PHONY: assert-no-store-file-names assert-binaries-available
516 .PHONY: assert-final-inputs-self-contained
522 AM_V_DL = $(AM_V_DL_$(V))
523 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
524 AM_V_DL_0 = @echo " DL " $@;
526 AM_V_DOT = $(AM_V_DOT_$(V))
527 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
528 AM_V_DOT_0 = @echo " DOT " $@;
530 AM_V_EMACS = $(AM_V_EMACS_$(V))
531 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
532 AM_V_EMACS_0 = @echo " EMACS " $@;
534 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
535 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
536 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;