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>
7 # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
9 # This file is part of GNU Guix.
11 # GNU Guix is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or (at
14 # your option) any later version.
16 # GNU Guix is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 nodist_noinst_SCRIPTS = \
31 # Modules that are not compiled but are installed nonetheless, such as
32 # build-side modules with unusual dependencies.
33 MODULES_NOT_COMPILED =
47 guix/combinators.scm \
48 guix/memoization.scm \
54 guix/git-download.scm \
55 guix/hg-download.scm \
60 guix/serialization.scm \
62 guix/derivations.scm \
64 guix/gnu-maintenance.scm \
72 guix/build-system.scm \
73 guix/build-system/ant.scm \
74 guix/build-system/cargo.scm \
75 guix/build-system/cmake.scm \
76 guix/build-system/dub.scm \
77 guix/build-system/emacs.scm \
78 guix/build-system/asdf.scm \
79 guix/build-system/glib-or-gtk.scm \
80 guix/build-system/gnu.scm \
81 guix/build-system/haskell.scm \
82 guix/build-system/perl.scm \
83 guix/build-system/python.scm \
84 guix/build-system/ocaml.scm \
85 guix/build-system/waf.scm \
86 guix/build-system/r.scm \
87 guix/build-system/ruby.scm \
88 guix/build-system/trivial.scm \
90 guix/http-client.scm \
94 guix/cvs-download.scm \
95 guix/svn-download.scm \
97 guix/build/ant-build-system.scm \
98 guix/build/download.scm \
99 guix/build/cargo-build-system.scm \
100 guix/build/cmake-build-system.scm \
101 guix/build/dub-build-system.scm \
102 guix/build/emacs-build-system.scm \
103 guix/build/asdf-build-system.scm \
106 guix/build/glib-or-gtk-build-system.scm \
107 guix/build/gnu-build-system.scm \
108 guix/build/gnu-dist.scm \
109 guix/build/perl-build-system.scm \
110 guix/build/python-build-system.scm \
111 guix/build/ocaml-build-system.scm \
112 guix/build/r-build-system.scm \
113 guix/build/ruby-build-system.scm \
114 guix/build/waf-build-system.scm \
115 guix/build/haskell-build-system.scm \
116 guix/build/store-copy.scm \
117 guix/build/utils.scm \
118 guix/build/union.scm \
119 guix/build/profiles.scm \
120 guix/build/pull.scm \
121 guix/build/rpath.scm \
124 guix/build/syscalls.scm \
125 guix/build/gremlin.scm \
126 guix/build/emacs-utils.scm \
127 guix/build/java-utils.scm \
128 guix/build/lisp-utils.scm \
129 guix/build/graft.scm \
130 guix/build/bournish.scm \
131 guix/build/qt-utils.scm \
132 guix/build/make-bootstrap.scm \
133 guix/search-paths.scm \
135 guix/import/utils.scm \
136 guix/import/gnu.scm \
137 guix/import/snix.scm \
138 guix/import/cabal.scm \
139 guix/import/cran.scm \
140 guix/import/hackage.scm \
141 guix/import/elpa.scm \
143 guix/scripts/download.scm \
144 guix/scripts/perform-download.scm \
145 guix/scripts/build.scm \
146 guix/scripts/archive.scm \
147 guix/scripts/import.scm \
148 guix/scripts/package.scm \
149 guix/scripts/gc.scm \
150 guix/scripts/hash.scm \
151 guix/scripts/pack.scm \
152 guix/scripts/pull.scm \
153 guix/scripts/substitute.scm \
154 guix/scripts/authenticate.scm \
155 guix/scripts/refresh.scm \
156 guix/scripts/system.scm \
157 guix/scripts/lint.scm \
158 guix/scripts/challenge.scm \
159 guix/scripts/import/cran.scm \
160 guix/scripts/import/gnu.scm \
161 guix/scripts/import/nix.scm \
162 guix/scripts/import/hackage.scm \
163 guix/scripts/import/stackage.scm \
164 guix/scripts/import/elpa.scm \
165 guix/scripts/environment.scm \
166 guix/scripts/publish.scm \
167 guix/scripts/edit.scm \
168 guix/scripts/size.scm \
169 guix/scripts/graph.scm \
170 guix/scripts/container.scm \
171 guix/scripts/container/exec.scm \
173 $(GNU_SYSTEM_MODULES)
179 guix/import/cpan.scm \
180 guix/import/crate.scm \
181 guix/import/gem.scm \
182 guix/import/github.scm \
183 guix/import/json.scm \
184 guix/import/pypi.scm \
185 guix/import/stackage.scm \
186 guix/scripts/import/crate.scm \
187 guix/scripts/import/gem.scm \
188 guix/scripts/import/pypi.scm
196 guix/scripts/copy.scm \
201 if BUILD_DAEMON_OFFLOAD
204 guix/scripts/offload.scm
206 endif BUILD_DAEMON_OFFLOAD
208 # Internal modules with test suite support.
209 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
211 # Auxiliary files for packages.
213 gnu/packages/aux-files/emacs/guix-emacs.el \
214 gnu/packages/aux-files/linux-libre/4.11-i686.conf \
215 gnu/packages/aux-files/linux-libre/4.11-x86_64.conf \
216 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
217 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
218 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
219 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
220 gnu/packages/aux-files/linux-libre/4.1-i686.conf \
221 gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
223 # Templates, examples.
225 gnu/system/examples/bare-bones.tmpl \
226 gnu/system/examples/desktop.tmpl \
227 gnu/system/examples/lightweight-desktop.tmpl
229 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
231 nobase_dist_guilemodule_DATA = \
232 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
234 nobase_nodist_guilemodule_DATA = guix/config.scm
235 nobase_nodist_guileobject_DATA = $(GOBJECTS)
237 # Do we need to provide our own non-broken (srfi srfi-37) module?
240 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
241 GOBJECTS += srfi/srfi-37.go
243 srfi/srfi-37.scm: srfi/srfi-37.scm.in
247 endif INSTALL_SRFI_37
249 # Handy way to remove the .go files without removing all the rest.
251 -$(RM) -f $(GOBJECTS)
252 @find . -name '*.go' -print | \
254 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
256 xargs -r echo "warning: stray .go files:"; \
260 # Test extensions; has to be unconditional.
261 TEST_EXTENSIONS = .scm .sh
271 tests/pk-crypto.scm \
275 tests/gnu-maintenance.scm \
276 tests/substitute.scm \
278 tests/derivations.scm \
283 tests/combinators.scm \
284 tests/discovery.scm \
286 tests/build-utils.scm \
298 tests/search-paths.scm \
307 tests/challenge.scm \
312 tests/file-systems.scm \
315 tests/scripts-build.scm \
316 tests/containers.scm \
318 tests/import-utils.scm
331 tests/guix-build.sh \
332 tests/guix-download.sh \
335 tests/guix-package.sh \
336 tests/guix-package-net.sh \
337 tests/guix-system.sh \
338 tests/guix-archive.sh \
339 tests/guix-authenticate.sh \
340 tests/guix-environment.sh \
341 tests/guix-environment-container.sh \
342 tests/guix-graph.sh \
347 SH_TESTS += tests/guix-register.sh
352 TESTS = $(SCM_TESTS) $(SH_TESTS)
354 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
357 $(top_builddir)/test-env --quiet-stderr \
358 $(GUILE) --no-auto-compile -e main \
359 $(top_srcdir)/build-aux/test-driver.scm
361 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
363 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
364 AM_SH_LOG_FLAGS = -x -e
366 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
367 # could end up removing files from the store while they are being used by
368 # other instances of the daemon.
370 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
371 $(SCM_TESTS:%.scm=%.log)
379 # Automake always generates a 'check' target, so better not override it.
382 @echo "Cannot run tests because file name limits would be exceeded." >&2
383 @echo "Look for 'length' in the 'config.log' file for details." >&2
389 check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
390 $(AM_V_at)$(top_builddir)/pre-inst-env \
391 $(GUILE) --no-auto-compile \
392 -e '(@@ (run-system-tests) run-system-tests)' \
393 $(top_srcdir)/build-aux/run-system-tests.scm
395 # Public key used to sign substitutes from hydra.gnu.org & co.
396 dist_pkgdata_DATA = \
398 bayfront.guixsd.org.pub
400 # Bash completion file.
401 dist_bashcompletion_DATA = etc/completion/bash/guix
403 # Zsh completion file.
404 dist_zshcompletion_DATA = etc/completion/zsh/_guix
412 build-aux/build-self.scm \
413 build-aux/compile-all.scm \
414 build-aux/hydra/evaluate.scm \
415 build-aux/hydra/gnu-system.scm \
416 build-aux/hydra/guix.scm \
417 build-aux/check-available-binaries.scm \
418 build-aux/check-final-inputs-self-contained.scm \
419 build-aux/download.scm \
420 build-aux/generate-authors.scm \
421 build-aux/test-driver.scm \
422 build-aux/update-guix-package.scm \
423 build-aux/update-NEWS.scm \
424 build-aux/run-system-tests.scm \
427 srfi/srfi-37.scm.in \
429 srfi/srfi-64.upstream.scm \
431 tests/signing-key.pub \
432 tests/signing-key.sec \
433 tests/cve-sample.xml \
434 build-aux/config.rpath \
439 if !BUILD_DAEMON_OFFLOAD
442 guix/scripts/offload.scm
444 endif !BUILD_DAEMON_OFFLOAD
449 $(SCM_TESTS:tests/%.scm=%.log)
451 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
452 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
453 # there that are newer than the local .scm files (for instance because the
454 # user ran 'make install' recently). When that happens, we end up loading
455 # those previously-installed .go files, which may be stale, thereby breaking
456 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
457 # stale files from ~/.cache/guile/ccache.
459 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
460 $(AM_V_at)echo "Compiling Scheme modules..." ; \
461 unset GUILE_LOAD_COMPILED_PATH ; \
462 XDG_CACHE_HOME=/nowhere \
463 host=$(host) srcdir="$(top_srcdir)" \
464 $(top_builddir)/pre-inst-env \
465 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
467 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
471 # Make sure source files are installed first, so that the mtime of
472 # installed compiled files is greater than that of installed source
474 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
476 guix_install_go_files = install-nobase_nodist_guileobjectDATA
477 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
479 # The above trick doesn't work for 'config.go' because both 'config.scm' and
480 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
482 install-data-hook: set-bootstrap-executable-permissions
483 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
486 SUBDIRS = po/guix po/packages
497 ACLOCAL_AMFLAGS = -I m4
499 # Pass an explicit '--localstatedir' so that configure does not error out if
500 # it finds an existing installation with a different localstatedir. Inherit
501 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
502 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
503 # enough for shebangs.
504 AM_DISTCHECK_CONFIGURE_FLAGS = \
505 --localstatedir="$$dc_install_base/var" \
506 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
507 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
508 --with-nix-prefix="$(NIX_PREFIX)" \
510 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
512 # The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
513 # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
514 guix-binary.%.tar.xz:
515 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
516 tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
517 -s "$*" --localstatedir guix glibc-utf8-locales \
518 -e '(@@ (gnu packages commencement) glibc-final)'` ; \
519 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
522 dist-hook: $(distdir)/ChangeLog gen-AUTHORS gen-tarball-version
523 dist-hook: assert-no-store-file-names
525 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
527 EXTRA_DIST += $(top_srcdir)/.version
528 BUILT_SOURCES += $(top_srcdir)/.version
529 $(top_srcdir)/.version:
530 echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
533 echo $(VERSION) > "$(distdir)/.tarball-version"
535 gen-ChangeLog $(distdir)/ChangeLog:
536 $(AM_V_GEN)if test -d .git; then \
537 $(top_srcdir)/build-aux/gitlog-to-changelog \
539 rm -f $(distdir)/ChangeLog; \
540 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
544 $(AM_V_GEN)if test -d .git; then \
545 rm -f "$(distdir)/AUTHORS"; \
546 $(top_builddir)/pre-inst-env "$(GUILE)" \
547 "$(top_srcdir)/build-aux/generate-authors.scm" \
548 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
553 # Release management.
556 releasedir = release-$(PACKAGE_VERSION)
558 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
560 # List of source tarballs produced. This must be kept in sync with the
561 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
563 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
565 # Systems supported by Guix.
566 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux
568 # Guix binary tarballs.
570 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
572 # Systems supported by GuixSD.
573 GUIXSD_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
575 # Prefix of the GuixSD installation image file name.
576 GUIXSD_IMAGE_BASE = guixsd-usb-install-$(PACKAGE_VERSION)
578 # Size of the installation image (for x86_64 typically).
579 GUIXSD_INSTALLATION_IMAGE_SIZE ?= 950MiB
581 # The release process works in several phases:
583 # 0. We assume the developer created a 'vX.Y' tag.
584 # 1. Build the source tarball.
585 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
586 # 3. Build the binary tarballs for that 'guix' package.
587 # 4. Update the 'guix' package again.
588 # 5. Build the GuixSD installation images. The images will run 'guix'
589 # corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
591 # This 'release' target takes care of everything and copies the resulting
592 # files to $(releasedir).
594 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
595 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
597 cd po; git checkout .
598 @if ! git diff-index --quiet HEAD; then \
599 echo "There are uncommitted changes; stopping." >&2 ; \
602 $(MKDIR_P) "$(releasedir)"
603 rm -f "$(releasedir)"/*
604 mv $(SOURCE_TARBALLS) "$(releasedir)"
605 $(top_builddir)/pre-inst-env "$(GUILE)" \
606 $(top_srcdir)/build-aux/update-guix-package.scm \
607 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
608 git add $(top_srcdir)/gnu/packages/package-management.scm
609 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
610 rm -f $(BINARY_TARBALLS)
611 $(MAKE) $(BINARY_TARBALLS)
612 for system in $(SUPPORTED_SYSTEMS) ; do \
613 mv "guix-binary.$$system.tar.xz" \
614 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
616 $(top_builddir)/pre-inst-env "$(GUILE)" \
617 $(top_srcdir)/build-aux/update-guix-package.scm \
618 "`git rev-parse HEAD`"
619 git add $(top_srcdir)/gnu/packages/package-management.scm
620 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
621 for system in $(GUIXSD_SUPPORTED_SYSTEMS) ; do \
622 image=`$(top_builddir)/pre-inst-env \
623 guix system disk-image \
625 --image-size=$(GUIXSD_INSTALLATION_IMAGE_SIZE) \
626 gnu/system/install.scm` ; \
627 if [ ! -f "$$image" ] ; then \
628 echo "failed to produced GuixSD installation image for $$system" >&2 ; \
631 xz < "$$image" > "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" ; \
632 mv "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz.tmp" \
633 "$(releasedir)/$(GUIXSD_IMAGE_BASE).$$system.xz" ; \
636 @echo "Congratulations! All the release files are now in $(releasedir)."
641 $(top_builddir)/pre-inst-env "$(GUILE)" \
642 $(top_srcdir)/build-aux/update-guix-package.scm \
643 "`git rev-parse HEAD`"
645 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
646 # Package data from this checkout is used by 'update-NEWS.scm'.
647 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
649 update-NEWS: $(GOBJECTS)
650 $(top_builddir)/pre-inst-env "$(GUILE)" \
651 $(top_srcdir)/build-aux/update-NEWS.scm \
652 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
654 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
655 assert-no-store-file-names: $(distdir)/ChangeLog
656 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
657 --exclude=*.info-[0-9] --exclude=*.dot \
658 --exclude=*.eps --exclude-dir=bootstrap \
659 --exclude=guix-prettify.el \
660 --exclude=ChangeLog \
661 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
663 echo "error: store file names embedded in the distribution" >&2 ; \
667 # Make sure hydra.gnu.org has the important binaries.
668 assert-binaries-available: $(GOBJECTS)
669 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
670 "$(top_srcdir)/build-aux/check-available-binaries.scm"
672 # Make sure the final inputs don't refer to bootstrap tools.
673 assert-final-inputs-self-contained: $(GOBJECTS)
674 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
675 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
677 # Compute the Hydra jobs and write them in the target file.
678 hydra-jobs.scm: $(GOBJECTS)
679 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
680 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
681 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
682 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
683 $(AM_V_at)mv "$@.tmp" "$@"
685 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
686 .PHONY: assert-no-store-file-names assert-binaries-available
687 .PHONY: assert-final-inputs-self-contained
688 .PHONY: clean-go make-go
689 .PHONY: update-guix-package update-NEWS release
695 AM_V_DL = $(AM_V_DL_$(V))
696 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
697 AM_V_DL_0 = @echo " DL " $@;
699 AM_V_DOT = $(AM_V_DOT_$(V))
700 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
701 AM_V_DOT_0 = @echo " DOT " $@;
703 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
704 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
705 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;