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, 2017 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016, 2017 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 = \
42 guix/combinators.scm \
43 guix/memoization.scm \
48 guix/git-download.scm \
49 guix/hg-download.scm \
54 guix/serialization.scm \
56 guix/derivations.scm \
58 guix/gnu-maintenance.scm \
64 guix/build-system.scm \
65 guix/build-system/ant.scm \
66 guix/build-system/cargo.scm \
67 guix/build-system/cmake.scm \
68 guix/build-system/dub.scm \
69 guix/build-system/emacs.scm \
70 guix/build-system/asdf.scm \
71 guix/build-system/glib-or-gtk.scm \
72 guix/build-system/gnu.scm \
73 guix/build-system/haskell.scm \
74 guix/build-system/perl.scm \
75 guix/build-system/python.scm \
76 guix/build-system/ocaml.scm \
77 guix/build-system/waf.scm \
78 guix/build-system/r.scm \
79 guix/build-system/ruby.scm \
80 guix/build-system/trivial.scm \
82 guix/http-client.scm \
86 guix/cvs-download.scm \
87 guix/svn-download.scm \
89 guix/build/ant-build-system.scm \
90 guix/build/download.scm \
91 guix/build/cargo-build-system.scm \
92 guix/build/cmake-build-system.scm \
93 guix/build/dub-build-system.scm \
94 guix/build/emacs-build-system.scm \
95 guix/build/asdf-build-system.scm \
98 guix/build/glib-or-gtk-build-system.scm \
99 guix/build/gnu-build-system.scm \
100 guix/build/gnu-dist.scm \
101 guix/build/perl-build-system.scm \
102 guix/build/python-build-system.scm \
103 guix/build/ocaml-build-system.scm \
104 guix/build/r-build-system.scm \
105 guix/build/ruby-build-system.scm \
106 guix/build/waf-build-system.scm \
107 guix/build/haskell-build-system.scm \
108 guix/build/store-copy.scm \
109 guix/build/utils.scm \
110 guix/build/union.scm \
111 guix/build/profiles.scm \
112 guix/build/pull.scm \
113 guix/build/rpath.scm \
116 guix/build/syscalls.scm \
117 guix/build/gremlin.scm \
118 guix/build/emacs-utils.scm \
119 guix/build/lisp-utils.scm \
120 guix/build/graft.scm \
121 guix/build/bournish.scm \
122 guix/build/qt-utils.scm \
123 guix/build/make-bootstrap.scm \
124 guix/search-paths.scm \
126 guix/import/utils.scm \
127 guix/import/gnu.scm \
128 guix/import/snix.scm \
129 guix/import/cabal.scm \
130 guix/import/cran.scm \
131 guix/import/hackage.scm \
132 guix/import/elpa.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/pack.scm \
143 guix/scripts/pull.scm \
144 guix/scripts/substitute.scm \
145 guix/scripts/authenticate.scm \
146 guix/scripts/refresh.scm \
147 guix/scripts/system.scm \
148 guix/scripts/lint.scm \
149 guix/scripts/challenge.scm \
150 guix/scripts/import/cran.scm \
151 guix/scripts/import/gnu.scm \
152 guix/scripts/import/nix.scm \
153 guix/scripts/import/hackage.scm \
154 guix/scripts/import/stackage.scm \
155 guix/scripts/import/elpa.scm \
156 guix/scripts/environment.scm \
157 guix/scripts/publish.scm \
158 guix/scripts/edit.scm \
159 guix/scripts/size.scm \
160 guix/scripts/graph.scm \
161 guix/scripts/container.scm \
162 guix/scripts/container/exec.scm \
164 $(GNU_SYSTEM_MODULES)
170 guix/import/cpan.scm \
171 guix/import/crate.scm \
172 guix/import/gem.scm \
173 guix/import/github.scm \
174 guix/import/json.scm \
175 guix/import/pypi.scm \
176 guix/import/stackage.scm \
177 guix/scripts/import/crate.scm \
178 guix/scripts/import/gem.scm \
179 guix/scripts/import/pypi.scm
187 guix/scripts/copy.scm
191 if BUILD_DAEMON_OFFLOAD
194 guix/scripts/offload.scm
196 endif BUILD_DAEMON_OFFLOAD
198 # Internal modules with test suite support.
199 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
201 # Auxiliary files for packages.
203 gnu/packages/aux-files/emacs/guix-emacs.el \
204 gnu/packages/aux-files/linux-libre/4.10-i686.conf \
205 gnu/packages/aux-files/linux-libre/4.10-x86_64.conf \
206 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
207 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
208 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
209 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
210 gnu/packages/aux-files/linux-libre/4.1-i686.conf \
211 gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
213 # Templates, examples.
215 gnu/system/examples/bare-bones.tmpl \
216 gnu/system/examples/desktop.tmpl \
217 gnu/system/examples/lightweight-desktop.tmpl
219 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
221 nobase_dist_guilemodule_DATA = \
222 $(MODULES) $(AUX_FILES) $(EXAMPLES) \
224 nobase_nodist_guilemodule_DATA = guix/config.scm
225 nobase_nodist_guileobject_DATA = $(GOBJECTS)
227 # Do we need to provide our own non-broken (srfi srfi-37) module?
230 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
231 GOBJECTS += srfi/srfi-37.go
233 srfi/srfi-37.scm: srfi/srfi-37.scm.in
237 endif INSTALL_SRFI_37
239 # Handy way to remove the .go files without removing all the rest.
241 -$(RM) -f $(GOBJECTS)
242 @find . -name '*.go' -print | \
244 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
246 xargs -r echo "warning: stray .go files:"; \
250 # Test extensions; has to be unconditional.
251 TEST_EXTENSIONS = .scm .sh
261 tests/pk-crypto.scm \
265 tests/gnu-maintenance.scm \
266 tests/substitute.scm \
268 tests/derivations.scm \
273 tests/combinators.scm \
275 tests/build-utils.scm \
287 tests/search-paths.scm \
296 tests/challenge.scm \
299 tests/file-systems.scm \
302 tests/scripts-build.scm \
303 tests/containers.scm \
305 tests/import-utils.scm
318 tests/guix-build.sh \
319 tests/guix-download.sh \
322 tests/guix-package.sh \
323 tests/guix-package-net.sh \
324 tests/guix-system.sh \
325 tests/guix-archive.sh \
326 tests/guix-authenticate.sh \
327 tests/guix-environment.sh \
328 tests/guix-environment-container.sh \
329 tests/guix-graph.sh \
334 SH_TESTS += tests/guix-register.sh
339 TESTS = $(SCM_TESTS) $(SH_TESTS)
341 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
344 $(top_builddir)/test-env --quiet-stderr \
345 $(GUILE) --no-auto-compile -e main \
346 $(top_srcdir)/build-aux/test-driver.scm
348 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
350 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
351 AM_SH_LOG_FLAGS = -x -e
353 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
354 # could end up removing files from the store while they are being used by
355 # other instances of the daemon.
357 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
358 $(SCM_TESTS:%.scm=%.log)
366 # Automake always generates a 'check' target, so better not override it.
369 @echo "Cannot run tests because file name limits would be exceeded." >&2
370 @echo "Look for 'length' in the 'config.log' file for details." >&2
376 check-system: $(GOBJECTS)
377 $(AM_V_at)$(top_builddir)/pre-inst-env \
378 $(GUILE) --no-auto-compile \
379 -e '(@@ (run-system-tests) run-system-tests)' \
380 $(top_srcdir)/build-aux/run-system-tests.scm
382 # Public key used to sign substitutes from hydra.gnu.org.
383 dist_pkgdata_DATA = hydra.gnu.org.pub
385 # Bash completion file.
386 dist_bashcompletion_DATA = etc/completion/bash/guix
388 # Zsh completion file.
389 dist_zshcompletion_DATA = etc/completion/zsh/_guix
397 build-aux/build-self.scm \
398 build-aux/compile-all.scm \
399 build-aux/hydra/evaluate.scm \
400 build-aux/hydra/gnu-system.scm \
401 build-aux/hydra/demo-os.scm \
402 build-aux/hydra/guix.scm \
403 build-aux/check-available-binaries.scm \
404 build-aux/check-final-inputs-self-contained.scm \
405 build-aux/download.scm \
406 build-aux/generate-authors.scm \
407 build-aux/test-driver.scm \
408 build-aux/run-system-tests.scm \
411 srfi/srfi-37.scm.in \
413 srfi/srfi-64.upstream.scm \
415 tests/signing-key.pub \
416 tests/signing-key.sec \
417 tests/cve-sample.xml \
418 build-aux/config.rpath \
423 if !BUILD_DAEMON_OFFLOAD
426 guix/scripts/offload.scm
428 endif !BUILD_DAEMON_OFFLOAD
433 $(SCM_TESTS:tests/%.scm=%.log)
435 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
436 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
437 # there that are newer than the local .scm files (for instance because the
438 # user ran 'make install' recently). When that happens, we end up loading
439 # those previously-installed .go files, which may be stale, thereby breaking
440 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
441 # stale files from ~/.cache/guile/ccache.
443 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
444 $(AM_V_at)echo "Compiling Scheme modules..." ; \
445 unset GUILE_LOAD_COMPILED_PATH ; \
446 XDG_CACHE_HOME=/nowhere \
447 host=$(host) srcdir="$(top_srcdir)" \
448 $(top_builddir)/pre-inst-env \
449 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
451 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
455 # Make sure source files are installed first, so that the mtime of
456 # installed compiled files is greater than that of installed source
458 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
460 guix_install_go_files = install-nobase_nodist_guileobjectDATA
461 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
463 # The above trick doesn't work for 'config.go' because both 'config.scm' and
464 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
466 install-data-hook: set-bootstrap-executable-permissions
467 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
470 SUBDIRS = po/guix po/packages
481 ACLOCAL_AMFLAGS = -I m4
483 # Pass an explicit '--localstatedir' so that configure does not error out if
484 # it finds an existing installation with a different localstatedir.
485 AM_DISTCHECK_CONFIGURE_FLAGS = \
486 --localstatedir="$$dc_install_base/var" \
487 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
488 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
489 --with-nix-prefix="$(NIX_PREFIX)" \
492 # The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
493 # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
494 guix-binary.%.tar.xz:
495 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
496 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
497 -s "$*" --localstatedir guix glibc-utf8-locales \
498 -e '(@@ (gnu packages commencement) glibc-final)'` ; \
499 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
502 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
503 dist-hook: assert-no-store-file-names
505 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
508 $(AM_V_at)GUIX_PACKAGE_PATH= \
509 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
512 $(AM_V_GEN)if test -d .git; then \
513 $(top_srcdir)/build-aux/gitlog-to-changelog \
515 rm -f $(distdir)/ChangeLog; \
516 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
520 $(AM_V_GEN)if test -d .git; then \
521 rm -f "$(distdir)/AUTHORS"; \
522 $(top_builddir)/pre-inst-env "$(GUILE)" \
523 "$(top_srcdir)/build-aux/generate-authors.scm" \
524 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
527 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
528 assert-no-store-file-names:
529 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
530 --exclude=*.info-[0-9] --exclude=*.dot \
531 --exclude=*.eps --exclude-dir=bootstrap \
532 --exclude=guix-prettify.el \
533 --exclude=ChangeLog \
534 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
536 echo "error: store file names embedded in the distribution" >&2 ; \
540 # Make sure hydra.gnu.org has the important binaries.
541 assert-binaries-available: $(GOBJECTS)
542 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
543 "$(top_srcdir)/build-aux/check-available-binaries.scm"
545 # Make sure the final inputs don't refer to bootstrap tools.
546 assert-final-inputs-self-contained: $(GOBJECTS)
547 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
548 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
550 # Compute the Hydra jobs and write them in the target file.
551 hydra-jobs.scm: $(GOBJECTS)
552 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
553 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
554 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
555 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
556 $(AM_V_at)mv "$@.tmp" "$@"
558 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
559 .PHONY: assert-no-store-file-names assert-binaries-available
560 .PHONY: assert-final-inputs-self-contained
566 AM_V_DL = $(AM_V_DL_$(V))
567 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
568 AM_V_DL_0 = @echo " DL " $@;
570 AM_V_DOT = $(AM_V_DOT_$(V))
571 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
572 AM_V_DOT_0 = @echo " DOT " $@;
574 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
575 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
576 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;