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 \
46 guix/git-download.scm \
47 guix/hg-download.scm \
52 guix/serialization.scm \
54 guix/derivations.scm \
56 guix/gnu-maintenance.scm \
62 guix/build-system.scm \
63 guix/build-system/ant.scm \
64 guix/build-system/cargo.scm \
65 guix/build-system/cmake.scm \
66 guix/build-system/emacs.scm \
67 guix/build-system/asdf.scm \
68 guix/build-system/glib-or-gtk.scm \
69 guix/build-system/gnu.scm \
70 guix/build-system/haskell.scm \
71 guix/build-system/perl.scm \
72 guix/build-system/python.scm \
73 guix/build-system/waf.scm \
74 guix/build-system/r.scm \
75 guix/build-system/ruby.scm \
76 guix/build-system/trivial.scm \
78 guix/http-client.scm \
82 guix/cvs-download.scm \
83 guix/svn-download.scm \
85 guix/build/ant-build-system.scm \
86 guix/build/download.scm \
87 guix/build/cargo-build-system.scm \
88 guix/build/cmake-build-system.scm \
89 guix/build/emacs-build-system.scm \
90 guix/build/asdf-build-system.scm \
93 guix/build/glib-or-gtk-build-system.scm \
94 guix/build/gnu-build-system.scm \
95 guix/build/gnu-dist.scm \
96 guix/build/perl-build-system.scm \
97 guix/build/python-build-system.scm \
98 guix/build/r-build-system.scm \
99 guix/build/ruby-build-system.scm \
100 guix/build/waf-build-system.scm \
101 guix/build/haskell-build-system.scm \
102 guix/build/store-copy.scm \
103 guix/build/utils.scm \
104 guix/build/union.scm \
105 guix/build/profiles.scm \
106 guix/build/pull.scm \
107 guix/build/rpath.scm \
110 guix/build/syscalls.scm \
111 guix/build/gremlin.scm \
112 guix/build/emacs-utils.scm \
113 guix/build/lisp-utils.scm \
114 guix/build/graft.scm \
115 guix/build/bournish.scm \
116 guix/build/qt-utils.scm \
117 guix/build/make-bootstrap.scm \
118 guix/search-paths.scm \
120 guix/import/utils.scm \
121 guix/import/gnu.scm \
122 guix/import/snix.scm \
123 guix/import/cabal.scm \
124 guix/import/cran.scm \
125 guix/import/crate.scm \
126 guix/import/hackage.scm \
127 guix/import/elpa.scm \
129 guix/scripts/download.scm \
130 guix/scripts/perform-download.scm \
131 guix/scripts/build.scm \
132 guix/scripts/archive.scm \
133 guix/scripts/import.scm \
134 guix/scripts/package.scm \
135 guix/scripts/gc.scm \
136 guix/scripts/hash.scm \
137 guix/scripts/pull.scm \
138 guix/scripts/substitute.scm \
139 guix/scripts/authenticate.scm \
140 guix/scripts/refresh.scm \
141 guix/scripts/system.scm \
142 guix/scripts/lint.scm \
143 guix/scripts/challenge.scm \
144 guix/scripts/import/cran.scm \
145 guix/scripts/import/crate.scm \
146 guix/scripts/import/gnu.scm \
147 guix/scripts/import/nix.scm \
148 guix/scripts/import/hackage.scm \
149 guix/scripts/import/elpa.scm \
150 guix/scripts/environment.scm \
151 guix/scripts/publish.scm \
152 guix/scripts/edit.scm \
153 guix/scripts/size.scm \
154 guix/scripts/graph.scm \
155 guix/scripts/container.scm \
156 guix/scripts/container/exec.scm \
158 $(GNU_SYSTEM_MODULES)
163 guix/import/github.scm \
164 guix/import/json.scm \
165 guix/import/pypi.scm \
166 guix/scripts/import/pypi.scm \
167 guix/import/cpan.scm \
168 guix/scripts/import/gem.scm \
173 if BUILD_DAEMON_OFFLOAD
176 guix/scripts/offload.scm
178 endif BUILD_DAEMON_OFFLOAD
180 # Internal modules with test suite support.
181 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
183 # Linux-Libre configurations.
185 gnu/packages/linux-libre-4.8-i686.conf \
186 gnu/packages/linux-libre-4.8-x86_64.conf \
187 gnu/packages/linux-libre-4.4-i686.conf \
188 gnu/packages/linux-libre-4.4-x86_64.conf \
189 gnu/packages/linux-libre-4.1-i686.conf \
190 gnu/packages/linux-libre-4.1-x86_64.conf
192 # Templates, examples.
194 gnu/system/examples/bare-bones.tmpl \
195 gnu/system/examples/desktop.tmpl \
196 gnu/system/examples/lightweight-desktop.tmpl
198 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
200 nobase_dist_guilemodule_DATA = \
201 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
203 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
205 # Do we need to provide our own non-broken (srfi srfi-37) module?
208 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
209 GOBJECTS += srfi/srfi-37.go
211 srfi/srfi-37.scm: srfi/srfi-37.scm.in
215 endif INSTALL_SRFI_37
217 # Handy way to remove the .go files without removing all the rest.
219 -$(RM) -f $(GOBJECTS)
220 @find . -name '*.go' -print | \
222 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
224 xargs -r echo "warning: stray .go files:"; \
228 # Test extensions; has to be unconditional.
229 TEST_EXTENSIONS = .scm .sh
238 tests/pk-crypto.scm \
242 tests/gnu-maintenance.scm \
243 tests/substitute.scm \
245 tests/derivations.scm \
250 tests/combinators.scm \
252 tests/build-utils.scm \
272 tests/challenge.scm \
275 tests/file-systems.scm \
278 tests/scripts-build.scm \
279 tests/containers.scm \
280 tests/import-utils.scm
293 tests/guix-build.sh \
294 tests/guix-download.sh \
297 tests/guix-package.sh \
298 tests/guix-package-net.sh \
299 tests/guix-system.sh \
300 tests/guix-archive.sh \
301 tests/guix-authenticate.sh \
302 tests/guix-environment.sh \
303 tests/guix-environment-container.sh \
304 tests/guix-graph.sh \
309 SH_TESTS += tests/guix-register.sh
314 TESTS = $(SCM_TESTS) $(SH_TESTS)
316 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
319 $(top_builddir)/test-env --quiet-stderr \
320 $(GUILE) --no-auto-compile -e main \
321 $(top_srcdir)/build-aux/test-driver.scm
323 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
325 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
326 AM_SH_LOG_FLAGS = -x -e
328 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
329 # could end up removing files from the store while they are being used by
330 # other instances of the daemon.
332 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
333 $(SCM_TESTS:%.scm=%.log)
341 # Automake always generates a 'check' target, so better not override it.
344 @echo "Cannot run tests because file name limits would be exceeded." >&2
345 @echo "Look for 'length' in the 'config.log' file for details." >&2
351 check-system: $(GOBJECTS)
352 $(AM_V_at)$(top_builddir)/pre-inst-env \
353 $(GUILE) --no-auto-compile \
354 -e '(@@ (run-system-tests) run-system-tests)' \
355 $(top_srcdir)/build-aux/run-system-tests.scm
357 # Public key used to sign substitutes from hydra.gnu.org.
358 dist_pkgdata_DATA = hydra.gnu.org.pub
360 # Bash completion file.
361 dist_bashcompletion_DATA = etc/completion/bash/guix
363 # Zsh completion file.
364 dist_zshcompletion_DATA = etc/completion/zsh/_guix
372 build-aux/build-self.scm \
373 build-aux/compile-all.scm \
374 build-aux/hydra/evaluate.scm \
375 build-aux/hydra/gnu-system.scm \
376 build-aux/hydra/demo-os.scm \
377 build-aux/hydra/guix.scm \
378 build-aux/check-available-binaries.scm \
379 build-aux/check-final-inputs-self-contained.scm \
380 build-aux/download.scm \
381 build-aux/make-binary-tarball.scm \
382 build-aux/generate-authors.scm \
383 build-aux/test-driver.scm \
384 build-aux/run-system-tests.scm \
387 srfi/srfi-37.scm.in \
389 srfi/srfi-64.upstream.scm \
391 tests/signing-key.pub \
392 tests/signing-key.sec \
393 tests/cve-sample.xml \
394 build-aux/config.rpath \
399 if !BUILD_DAEMON_OFFLOAD
402 guix/scripts/offload.scm
404 endif !BUILD_DAEMON_OFFLOAD
409 $(SCM_TESTS:tests/%.scm=%.log)
411 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
412 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
413 # there that are newer than the local .scm files (for instance because the
414 # user ran 'make install' recently). When that happens, we end up loading
415 # those previously-installed .go files, which may be stale, thereby breaking
416 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
417 # stale files from ~/.cache/guile/ccache.
419 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
420 $(AM_V_at)echo "Compiling Scheme modules..." ; \
421 unset GUILE_LOAD_COMPILED_PATH ; \
422 XDG_CACHE_HOME=/nowhere \
423 host=$(host) srcdir="$(top_srcdir)" \
424 $(top_builddir)/pre-inst-env \
425 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
427 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
431 # Make sure source files are installed first, so that the mtime of
432 # installed compiled files is greater than that of installed source
434 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
436 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
437 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
439 # The above trick doesn't work for 'config.go' because both 'config.scm' and
440 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
442 install-data-hook: set-bootstrap-executable-permissions
443 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
446 SUBDIRS = po/guix po/packages
457 ACLOCAL_AMFLAGS = -I m4
459 # Pass an explicit '--localstatedir' so that configure does not error out if
460 # it finds an existing installation with a different localstatedir.
461 AM_DISTCHECK_CONFIGURE_FLAGS = \
462 --localstatedir="$$dc_install_base/var" \
463 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
464 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
465 --with-nix-prefix="$(NIX_PREFIX)" \
468 dist_emacsui_DATA = emacs/guix-main.scm
469 nodist_emacsui_DATA = emacs/guix-helper.scm
470 include emacs/local.mk
472 # The self-contained tarball.
473 guix-binary.%.tar.xz:
474 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
475 $(top_builddir)/pre-inst-env "$(GUILE)" \
476 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
479 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
480 dist-hook: assert-no-store-file-names
482 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
485 $(AM_V_at)GUIX_PACKAGE_PATH= \
486 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
489 $(AM_V_GEN)if test -d .git; then \
490 $(top_srcdir)/build-aux/gitlog-to-changelog \
492 rm -f $(distdir)/ChangeLog; \
493 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
497 $(AM_V_GEN)if test -d .git; then \
498 rm -f "$(distdir)/AUTHORS"; \
499 $(top_builddir)/pre-inst-env "$(GUILE)" \
500 "$(top_srcdir)/build-aux/generate-authors.scm" \
501 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
504 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
505 assert-no-store-file-names:
506 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
507 --exclude=*.info-[0-9] --exclude=*.dot \
508 --exclude=*.eps --exclude-dir=bootstrap \
509 --exclude=guix-prettify.el \
510 --exclude=ChangeLog \
511 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
513 echo "error: store file names embedded in the distribution" >&2 ; \
517 # Make sure hydra.gnu.org has the important binaries.
518 assert-binaries-available: $(GOBJECTS)
519 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
520 "$(top_srcdir)/build-aux/check-available-binaries.scm"
522 # Make sure the final inputs don't refer to bootstrap tools.
523 assert-final-inputs-self-contained: $(GOBJECTS)
524 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
525 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
527 # Compute the Hydra jobs and write them in the target file.
528 hydra-jobs.scm: $(GOBJECTS)
529 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
530 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
531 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
532 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
533 $(AM_V_at)mv "$@.tmp" "$@"
535 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
536 .PHONY: assert-no-store-file-names assert-binaries-available
537 .PHONY: assert-final-inputs-self-contained
543 AM_V_DL = $(AM_V_DL_$(V))
544 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
545 AM_V_DL_0 = @echo " DL " $@;
547 AM_V_DOT = $(AM_V_DOT_$(V))
548 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
549 AM_V_DOT_0 = @echo " DOT " $@;
551 AM_V_EMACS = $(AM_V_EMACS_$(V))
552 AM_V_EMACS_ = $(AM_V_EMACS_$(AM_DEFAULT_VERBOSITY))
553 AM_V_EMACS_0 = @echo " EMACS " $@;
555 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
556 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
557 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;