1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 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, 2018 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
7 # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
8 # Copyright © 2017 Leo Famulari <leo@famulari.name>
9 # Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
10 # Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
11 # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
12 # Copyright © 2018 Nikita <nikita@n0.is>
13 # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
14 # Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
15 # Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
16 # Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
17 # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
18 # Copyright © 2021 Andrew Tropin <andrew@trop.in>
20 # This file is part of GNU Guix.
22 # GNU Guix is free software; you can redistribute it and/or modify it
23 # under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 3 of the License, or (at
25 # your option) any later version.
27 # GNU Guix is distributed in the hope that it will be useful, but
28 # WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 MSGMERGE_UPDATE = @MSGMERGE@ --update
37 bin_SCRIPTS = scripts/guix
39 # Handle substitution of fully-expanded Autoconf variables.
41 -e 's,[@]GUILE[@],$(GUILE),g' \
42 -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
43 -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
44 -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
45 -e 's,[@]localedir[@],$(localedir),g'
47 scripts/guix: scripts/guix.in Makefile
48 $(AM_V_at)rm -f $@ $@-t
49 $(AM_V_at)$(MKDIR_P) "$(@D)"
50 $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
51 $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
53 # This is our variant of the 'guile' executable, one that doesn't complain
55 pkglibexec_PROGRAMS = guile
56 guile_SOURCES = gnu/packages/aux-files/guile-launcher.c
57 guile_LDADD = $(GUILE_LIBS)
58 guile_CFLAGS = $(GUILE_CFLAGS)
60 # Have the 'guix' command refer to our 'guile'.
62 $(SED) -i "$(DESTDIR)$(bindir)/guix" \
63 -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g'
65 nodist_noinst_SCRIPTS = \
69 # Modules that are not compiled but are installed nonetheless, such as
70 # build-side modules with unusual dependencies.
71 MODULES_NOT_COMPILED = \
76 include po/doc/local.mk
84 guix/deprecation.scm \
90 guix/combinators.scm \
91 guix/memoization.scm \
97 guix/android-repo-download.scm \
98 guix/bzr-download.scm \
99 guix/extracting-download.scm \
100 guix/git-download.scm \
101 guix/hg-download.scm \
104 guix/monad-repl.scm \
107 guix/serialization.scm \
110 guix/derivations.scm \
113 guix/transformations.scm \
118 guix/gnu-maintenance.scm \
120 guix/substitutes.scm \
126 guix/git-authenticate.scm \
132 guix/build-system.scm \
133 guix/build-system/android-ndk.scm \
134 guix/build-system/ant.scm \
135 guix/build-system/cargo.scm \
136 guix/build-system/chicken.scm \
137 guix/build-system/clojure.scm \
138 guix/build-system/cmake.scm \
139 guix/build-system/dub.scm \
140 guix/build-system/dune.scm \
141 guix/build-system/emacs.scm \
142 guix/build-system/font.scm \
143 guix/build-system/go.scm \
144 guix/build-system/meson.scm \
145 guix/build-system/minify.scm \
146 guix/build-system/minetest.scm \
147 guix/build-system/asdf.scm \
148 guix/build-system/copy.scm \
149 guix/build-system/glib-or-gtk.scm \
150 guix/build-system/gnu.scm \
151 guix/build-system/guile.scm \
152 guix/build-system/haskell.scm \
153 guix/build-system/julia.scm \
154 guix/build-system/linux-module.scm \
155 guix/build-system/maven.scm \
156 guix/build-system/node.scm \
157 guix/build-system/perl.scm \
158 guix/build-system/python.scm \
159 guix/build-system/renpy.scm \
160 guix/build-system/ocaml.scm \
161 guix/build-system/qt.scm \
162 guix/build-system/waf.scm \
163 guix/build-system/r.scm \
164 guix/build-system/rakudo.scm \
165 guix/build-system/ruby.scm \
166 guix/build-system/scons.scm \
167 guix/build-system/texlive.scm \
168 guix/build-system/trivial.scm \
169 guix/ftp-client.scm \
170 guix/http-client.scm \
175 guix/cvs-download.scm \
176 guix/svn-download.scm \
179 guix/diagnostics.scm \
182 guix/build/android-ndk-build-system.scm \
183 guix/build/ant-build-system.scm \
184 guix/build/download.scm \
185 guix/build/download-nar.scm \
186 guix/build/cargo-build-system.scm \
187 guix/build/cargo-utils.scm \
188 guix/build/chicken-build-system.scm \
189 guix/build/cmake-build-system.scm \
190 guix/build/dub-build-system.scm \
191 guix/build/dune-build-system.scm \
192 guix/build/emacs-build-system.scm \
193 guix/build/meson-build-system.scm \
194 guix/build/minify-build-system.scm \
195 guix/build/font-build-system.scm \
196 guix/build/go-build-system.scm \
197 guix/build/android-repo.scm \
198 guix/build/asdf-build-system.scm \
200 guix/build/copy-build-system.scm \
203 guix/build/glib-or-gtk-build-system.scm \
204 guix/build/gnu-bootstrap.scm \
205 guix/build/gnu-build-system.scm \
206 guix/build/gnu-dist.scm \
207 guix/build/guile-build-system.scm \
208 guix/build/maven-build-system.scm \
209 guix/build/minetest-build-system.scm \
210 guix/build/node-build-system.scm \
211 guix/build/perl-build-system.scm \
212 guix/build/python-build-system.scm \
213 guix/build/ocaml-build-system.scm \
214 guix/build/qt-build-system.scm \
215 guix/build/r-build-system.scm \
216 guix/build/renpy-build-system.scm \
217 guix/build/rakudo-build-system.scm \
218 guix/build/ruby-build-system.scm \
219 guix/build/scons-build-system.scm \
220 guix/build/texlive-build-system.scm \
221 guix/build/waf-build-system.scm \
222 guix/build/haskell-build-system.scm \
223 guix/build/julia-build-system.scm \
224 guix/build/linux-module-build-system.scm \
225 guix/build/store-copy.scm \
226 guix/build/json.scm \
227 guix/build/pack.scm \
228 guix/build/utils.scm \
229 guix/build/union.scm \
230 guix/build/profiles.scm \
231 guix/build/compile.scm \
234 guix/build/syscalls.scm \
235 guix/build/gremlin.scm \
236 guix/build/debug-link.scm \
237 guix/build/clojure-build-system.scm \
238 guix/build/clojure-utils.scm \
239 guix/build/emacs-utils.scm \
240 guix/build/java-utils.scm \
241 guix/build/lisp-utils.scm \
242 guix/build/meson-configuration.scm \
243 guix/build/maven/java.scm \
244 guix/build/maven/plugin.scm \
245 guix/build/maven/pom.scm \
246 guix/build/graft.scm \
247 guix/build/bournish.scm \
248 guix/build/qt-utils.scm \
249 guix/build/make-bootstrap.scm \
250 guix/search-paths.scm \
252 guix/import/cabal.scm \
253 guix/import/cpan.scm \
254 guix/import/cran.scm \
255 guix/import/crate.scm \
256 guix/import/egg.scm \
257 guix/import/elpa.scm \
258 guix/import/gem.scm \
259 guix/import/git.scm \
260 guix/import/github.scm \
261 guix/import/gnome.scm \
262 guix/import/gnu.scm \
264 guix/import/hackage.scm \
265 guix/import/json.scm \
266 guix/import/kde.scm \
267 guix/import/launchpad.scm \
268 guix/import/minetest.scm \
269 guix/import/opam.scm \
270 guix/import/print.scm \
271 guix/import/pypi.scm \
272 guix/import/stackage.scm \
273 guix/import/texlive.scm \
274 guix/import/utils.scm \
276 guix/scripts/download.scm \
277 guix/scripts/perform-download.scm \
278 guix/scripts/build.scm \
279 guix/scripts/archive.scm \
280 guix/scripts/import.scm \
281 guix/scripts/package.scm \
282 guix/scripts/install.scm \
283 guix/scripts/remove.scm \
284 guix/scripts/upgrade.scm \
285 guix/scripts/search.scm \
286 guix/scripts/show.scm \
287 guix/scripts/gc.scm \
288 guix/scripts/hash.scm \
289 guix/scripts/pack.scm \
290 guix/scripts/pull.scm \
291 guix/scripts/processes.scm \
292 guix/scripts/substitute.scm \
293 guix/scripts/authenticate.scm \
294 guix/scripts/refresh.scm \
295 guix/scripts/repl.scm \
296 guix/scripts/describe.scm \
297 guix/scripts/style.scm \
298 guix/scripts/system.scm \
299 guix/scripts/system/search.scm \
300 guix/scripts/system/reconfigure.scm \
301 guix/scripts/home.scm \
302 guix/scripts/home/import.scm \
303 guix/scripts/lint.scm \
304 guix/scripts/challenge.scm \
305 guix/scripts/import/crate.scm \
306 guix/scripts/import/cran.scm \
307 guix/scripts/import/egg.scm \
308 guix/scripts/import/elpa.scm \
309 guix/scripts/import/gem.scm \
310 guix/scripts/import/gnu.scm \
311 guix/scripts/import/go.scm \
312 guix/scripts/import/hackage.scm \
313 guix/scripts/import/json.scm \
314 guix/scripts/import/minetest.scm \
315 guix/scripts/import/opam.scm \
316 guix/scripts/import/pypi.scm \
317 guix/scripts/import/stackage.scm \
318 guix/scripts/import/texlive.scm \
319 guix/scripts/environment.scm \
320 guix/scripts/publish.scm \
321 guix/scripts/edit.scm \
322 guix/scripts/size.scm \
323 guix/scripts/git.scm \
324 guix/scripts/git/authenticate.scm \
325 guix/scripts/graph.scm \
326 guix/scripts/weather.scm \
327 guix/scripts/container.scm \
328 guix/scripts/container/exec.scm \
329 guix/scripts/deploy.scm \
330 guix/scripts/time-machine.scm \
332 $(GNU_SYSTEM_MODULES)
339 guix/scripts/copy.scm \
348 guix/scripts/discover.scm
350 endif HAVE_GUILE_AVAHI
352 if BUILD_DAEMON_OFFLOAD
355 guix/scripts/offload.scm
357 endif BUILD_DAEMON_OFFLOAD
359 # Scheme implementation of the build daemon and related functionality.
361 guix/store/database.scm \
362 guix/store/deduplication.scm \
365 MODULES += $(STORE_MODULES)
367 # Internal modules with test suite support.
370 guix/tests/http.scm \
374 # Auxiliary files for packages.
376 gnu/packages/aux-files/chromium/master-preferences.json \
377 gnu/packages/aux-files/emacs/guix-emacs.el \
378 gnu/packages/aux-files/guix.vim \
379 gnu/packages/aux-files/linux-libre/5.14-arm.conf \
380 gnu/packages/aux-files/linux-libre/5.14-arm64.conf \
381 gnu/packages/aux-files/linux-libre/5.14-i686.conf \
382 gnu/packages/aux-files/linux-libre/5.14-x86_64.conf \
383 gnu/packages/aux-files/linux-libre/5.10-arm.conf \
384 gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
385 gnu/packages/aux-files/linux-libre/5.10-i686.conf \
386 gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
387 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
388 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
389 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
390 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
391 gnu/packages/aux-files/linux-libre/4.19-arm.conf \
392 gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
393 gnu/packages/aux-files/linux-libre/4.19-i686.conf \
394 gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
395 gnu/packages/aux-files/linux-libre/4.14-arm.conf \
396 gnu/packages/aux-files/linux-libre/4.14-i686.conf \
397 gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
398 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
399 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
400 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
401 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
402 gnu/packages/aux-files/pack-audit.c \
403 gnu/packages/aux-files/python/sanity-check.py \
404 gnu/packages/aux-files/python/sitecustomize.py \
405 gnu/packages/aux-files/run-in-namespace.c
407 # Templates, examples.
409 gnu/system/examples/asus-c201.tmpl \
410 gnu/system/examples/bare-bones.tmpl \
411 gnu/system/examples/bare-hurd.tmpl \
412 gnu/system/examples/beaglebone-black.tmpl \
413 gnu/system/examples/desktop.tmpl \
414 gnu/system/examples/lightweight-desktop.tmpl \
415 gnu/system/examples/docker-image.tmpl \
416 gnu/system/examples/vm-image.tmpl
418 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
420 nobase_dist_guilemodule_DATA = \
423 guix/store/schema.sql \
424 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
426 nobase_nodist_guilemodule_DATA = guix/config.scm
427 nobase_nodist_guileobject_DATA = $(GOBJECTS)
429 # Handy way to remove the .go files without removing all the rest.
431 -$(RM) -f $(GOBJECTS)
432 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
434 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
436 xargs -r echo "warning: stray .go files:"; \
440 # Test extensions; has to be unconditional.
441 TEST_EXTENSIONS = .scm .sh
450 tests/boot-parameters.scm \
453 tests/build-utils.scm \
455 tests/challenge.scm \
457 tests/combinators.scm \
458 tests/containers.scm \
464 tests/debug-link.scm \
465 tests/derivations.scm \
466 tests/discovery.scm \
469 tests/file-systems.scm \
473 tests/git-authenticate.scm \
475 tests/gnu-maintenance.scm \
480 tests/import-git.scm \
481 tests/import-utils.scm \
488 tests/networking.scm \
495 tests/processes.scm \
501 tests/search-paths.scm \
503 tests/services/file-sharing.scm \
504 tests/services/configuration.scm \
505 tests/services/linux.scm \
506 tests/services/telephony.scm \
510 tests/store-database.scm \
511 tests/store-deduplication.scm \
512 tests/store-roots.scm \
514 tests/substitute.scm \
520 tests/transformations.scm \
529 SCM_TESTS += tests/go.scm
531 EXTRA_DIST += tests/go.scm
534 if BUILD_DAEMON_OFFLOAD
535 SCM_TESTS += tests/offload.scm
537 EXTRA_DIST += tests/offload.scm
541 tests/guix-build.sh \
542 tests/guix-build-branch.sh \
543 tests/guix-download.sh \
545 tests/guix-git-authenticate.sh \
548 tests/guix-pack-localstatedir.sh \
549 tests/guix-pack-relocatable.sh \
550 tests/guix-package.sh \
551 tests/guix-package-aliases.sh \
552 tests/guix-package-net.sh \
553 tests/guix-system.sh \
555 tests/guix-archive.sh \
556 tests/guix-authenticate.sh \
557 tests/guix-environment.sh \
558 tests/guix-environment-container.sh \
559 tests/guix-graph.sh \
560 tests/guix-describe.sh \
564 TESTS = $(SCM_TESTS) $(SH_TESTS)
566 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
569 $(top_builddir)/test-env --quiet-stderr \
570 $(GUILE) --no-auto-compile -e main \
571 $(top_srcdir)/build-aux/test-driver.scm
573 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
575 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
576 AM_SH_LOG_FLAGS = -x -e
578 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
579 # could end up removing files from the store while they are being used by
580 # other instances of the daemon.
582 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
583 $(SCM_TESTS:%.scm=%.log)
591 # Automake always generates a 'check' target, so better not override it.
594 @echo "Cannot run tests because file name limits would be exceeded." >&2
595 @echo "Look for 'length' in the 'config.log' file for details." >&2
601 check-system: $(GOBJECTS)
602 $(AM_V_at)$(top_builddir)/pre-inst-env \
603 guix build -m $(top_srcdir)/etc/system-tests.scm -K
605 # Public keys used to sign substitutes.
606 dist_pkgdata_DATA = \
607 etc/substitutes/berlin.guix.gnu.org.pub \
608 etc/substitutes/ci.guix.gnu.org.pub \
609 etc/substitutes/ci.guix.info.pub \
610 etc/substitutes/bordeaux.guix.gnu.org.pub
612 # Bash completion file.
613 dist_bashcompletion_DATA = etc/completion/bash/guix \
614 etc/completion/bash/guix-daemon
616 # Zsh completion file.
617 dist_zshcompletion_DATA = etc/completion/zsh/_guix
619 # Fish completion file.
620 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
623 nodist_selinux_policy_DATA = etc/guix-daemon.cil
631 .guix-authorizations \
634 etc/disarchive-manifest.scm \
635 etc/guix-install.sh \
637 etc/release-manifest.scm \
638 etc/source-manifest.scm \
639 etc/system-tests.scm \
640 etc/historical-authorizations \
641 build-aux/build-self.scm \
642 build-aux/compile-all.scm \
643 build-aux/cuirass/hurd-manifest.scm \
644 build-aux/check-final-inputs-self-contained.scm \
645 build-aux/check-channel-news.scm \
646 build-aux/compile-as-derivation.scm \
647 build-aux/generate-authors.scm \
648 build-aux/test-driver.scm \
649 build-aux/update-guix-package.scm \
650 build-aux/update-NEWS.scm \
652 tests/signing-key.pub \
653 tests/signing-key.sec \
654 tests/cve-sample.json \
660 tests/ed25519bis.key \
661 tests/ed25519bis.sec \
662 build-aux/config.rpath \
667 if !BUILD_DAEMON_OFFLOAD
670 guix/scripts/offload.scm
672 endif !BUILD_DAEMON_OFFLOAD
678 $(SCM_TESTS:tests/%.scm=%.log)
680 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
681 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
682 # there that are newer than the local .scm files (for instance because the
683 # user ran 'make install' recently). When that happens, we end up loading
684 # those previously-installed .go files, which may be stale, thereby breaking
685 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
686 # stale files from ~/.cache/guile/ccache.
688 make-go: make-core-go make-packages-go make-system-go make-cli-go
690 # Define a rule to build a subset of the .go files.
691 define guile-compilation-rule
694 $(AM_V_at)echo "Compiling Scheme modules..." ; \
695 unset GUILE_LOAD_COMPILED_PATH ; \
696 XDG_CACHE_HOME=/nowhere \
697 host=$(host) srcdir="$(top_srcdir)" \
698 $(top_builddir)/pre-inst-env \
699 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
701 -s "$(top_srcdir)"/build-aux/compile-all.scm \
702 --total $(words $(MODULES)) \
710 # Split compilation in several steps, each of which building a subset of
711 # $(MODULES). The main goal is to reduce peak memory consumption, as reported
712 # in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
713 # 'make-*-go' phony target that builds the corresponding subset.
715 MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
716 MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
717 MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
718 MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
720 $(eval $(call guile-compilation-rule,make-core-go, \
721 $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
724 $(eval $(call guile-compilation-rule,make-packages-go, \
725 $(MODULES_PACKAGES) make-core-go, \
726 $(words $(MODULES_CORE))))
728 $(eval $(call guile-compilation-rule,make-system-go, \
729 $(MODULES_SYSTEM) make-packages-go make-core-go, \
730 $(words $(MODULES_CORE) $(MODULES_PACKAGES))))
732 $(eval $(call guile-compilation-rule,make-cli-go, \
733 $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
734 $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM))))
738 # Make sure source files are installed first, so that the mtime of
739 # installed compiled files is greater than that of installed source
741 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
743 guix_install_go_files = install-nobase_nodist_guileobjectDATA
744 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
746 # The above trick doesn't work for 'config.go' because both 'config.scm' and
747 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
750 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
752 # Commit corresponding to the 'v1.0.0' tag.
753 commit_v1_0_0 = 6298c3ffd9654d3231a6f25390b056483e8f407c
755 # Introduction of the 'guix' channel. Keep in sync with (guix channels)!
756 channel_intro_commit = 9edb3f66fd807b096b48283debdcddccfea34bad
757 channel_intro_signer = BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA
759 # Authenticate the current Git checkout by checking signatures on every commit.
760 GUIX_GIT_KEYRING = origin/keyring
762 $(AM_V_at)echo "Authenticating Git checkout..." ; \
763 guix git authenticate \
764 --keyring=$(GUIX_GIT_KEYRING) \
765 --cache-key=channels/guix --stats \
766 "$(channel_intro_commit)" "$(channel_intro_signer)"
768 # Assuming Guix is already installed and the daemon is up and running, this
769 # rule builds from $(srcdir), creating and building derivations.
771 $(AM_V_at)echo "Building Guix in Guix..." ; \
772 $(GUILE) --no-auto-compile \
773 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
776 SUBDIRS = po/guix po/packages
787 ACLOCAL_AMFLAGS = -I m4
789 # Pass an explicit '--localstatedir' so that configure does not error out if
790 # it finds an existing installation with a different localstatedir. Inherit
791 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
792 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
793 # enough for shebangs.
794 AM_DISTCHECK_CONFIGURE_FLAGS = \
795 --localstatedir="$$dc_install_base/var" \
796 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
797 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
799 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
801 # The self-contained tarball.
802 guix-binary.%.tar.xz:
803 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
804 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
806 -s "$*" --localstatedir --profile-name=current-guix \
808 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
811 # The dependency on doc-pot-update is to generate the .pot files, which are
815 dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
816 dist-hook: assert-no-store-file-names
818 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
820 EXTRA_DIST += $(top_srcdir)/.version
821 BUILT_SOURCES += $(top_srcdir)/.version
822 $(top_srcdir)/.version: config.status
823 $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
826 echo $(VERSION) > "$(distdir)/.tarball-version"
829 $(AM_V_GEN)if test -d .git; then \
830 $(top_srcdir)/build-aux/gitlog-to-changelog \
831 > $(distdir)/ChangeLog.tmp; \
832 rm -f $(distdir)/ChangeLog; \
833 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
837 $(AM_V_GEN)if test -d .git; then \
838 rm -f "$(distdir)/AUTHORS"; \
839 $(top_builddir)/pre-inst-env "$(GUILE)" \
840 "$(top_srcdir)/build-aux/generate-authors.scm" \
841 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
844 # Like 'dist', but regenerate 'configure' so we get an up-to-date
845 # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
846 # do that whenever a 'dist' target is used.)
847 dist-with-updated-version:
848 @echo "Running './bootstrap' for new version string..."
849 $(top_srcdir)/bootstrap
850 $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
852 .PHONY: dist-with-updated-version
856 # Release management.
859 releasedir = release-$(PACKAGE_VERSION)
861 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
863 # List of source tarballs produced. This must be kept in sync with the
864 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
866 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
868 # Systems supported by Guix.
869 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
872 # Guix binary tarballs.
874 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
876 # Systems supported by Guix System.
877 GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
879 # Systems for which we build Guix VMs.
880 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
882 # Prefix of the Guix installation image file name.
883 GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
885 # Prefix of the Guix VM image file name.
886 GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
888 # Flags for 'guix system vm-image'. By default create a VM image that appears
889 # to have a 20G hard disk.
890 GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
892 # Return the sequence of '-s' flags for the given systems.
893 system_flags = $(foreach system,$(1),-s $(system))
895 # The release process works in several phases:
897 # 0. We assume the developer created a 'vX.Y.Z' tag.
898 # 1. Build the source tarball.
899 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
900 # 3. Build the binary tarballs for that 'guix' package.
901 # 4. Update the 'guix' package again.
902 # 5. Build the installation and VM images. The images will run 'guix'
903 # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
905 # This 'release' target takes care of everything and copies the resulting
906 # files to $(releasedir).
908 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
909 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
910 release: dist-with-updated-version all
911 @if ! git diff-index --quiet HEAD; then \
912 echo "There are uncommitted changes; stopping." >&2 ; \
915 $(MKDIR_P) "$(releasedir)"
916 rm -f "$(releasedir)"/*
917 mv $(SOURCE_TARBALLS) "$(releasedir)"
918 # Bump the Guix package version and build it.
919 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
920 $(top_builddir)/pre-inst-env "$(GUILE)" \
921 $(top_srcdir)/build-aux/update-guix-package.scm \
922 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
923 git add $(top_srcdir)/gnu/packages/package-management.scm
924 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
925 $(top_builddir)/pre-inst-env guix build guix \
926 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
927 -v1 --no-grafts --fallback
928 # Generate the binary release tarballs.
929 rm -f $(BINARY_TARBALLS)
930 $(MAKE) $(BINARY_TARBALLS)
931 for system in $(SUPPORTED_SYSTEMS) ; do \
932 mv "guix-binary.$$system.tar.xz" \
933 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
935 # Bump the Guix package version and build it (again).
936 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
937 $(top_builddir)/pre-inst-env "$(GUILE)" \
938 $(top_srcdir)/build-aux/update-guix-package.scm \
939 "`git rev-parse HEAD`"
940 git add $(top_srcdir)/gnu/packages/package-management.scm
941 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
942 $(top_builddir)/pre-inst-env guix build guix \
943 $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
944 -v1 --no-grafts --fallback
945 # Generate the ISO installation images.
946 for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
947 image=`$(top_builddir)/pre-inst-env \
948 guix system image -t iso9660 \
949 --label="GUIX_$${system}_$(VERSION)" \
950 --system=$$system --fallback \
951 gnu/system/install.scm` ; \
952 if [ ! -f "$$image" ] ; then \
953 echo "failed to produced Guix installation image for $$system" >&2 ; \
956 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
957 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
958 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
960 # Generate the VM images.
961 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
962 image=`$(top_builddir)/pre-inst-env \
963 guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
965 --system=$$system --fallback \
966 gnu/system/examples/vm-image.tmpl` ; \
967 if [ ! -f "$$image" ] ; then \
968 echo "failed to produced Guix VM image for $$system" >&2 ; \
971 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
974 @echo "Congratulations! All the release files are now in $(releasedir)."
979 $(top_builddir)/pre-inst-env "$(GUILE)" \
980 $(top_srcdir)/build-aux/update-guix-package.scm \
981 "`git rev-parse HEAD`"
983 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
984 # Package data from this checkout is used by 'update-NEWS.scm'.
985 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
987 update-NEWS: $(GOBJECTS)
988 $(top_builddir)/pre-inst-env "$(GUILE)" \
989 $(top_srcdir)/build-aux/update-NEWS.scm \
990 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
992 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
993 assert-no-store-file-names:
994 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
995 --exclude=*.info-[0-9] --exclude=*.dot \
996 --exclude=*.eps --exclude-dir=bootstrap \
997 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
998 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
999 --exclude=guix-prettify.el \
1000 --exclude=ChangeLog* \
1001 --exclude=binutils-boot-2.20*.patch \
1002 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
1004 echo "error: store file names embedded in the distribution" >&2 ; \
1008 # Make sure important substitutes are available.
1009 assert-binaries-available: $(GOBJECTS)
1010 $(AM_V_at)$(top_builddir)/pre-inst-env \
1011 guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \
1014 # Make sure the final inputs don't refer to bootstrap tools.
1015 assert-final-inputs-self-contained: $(GOBJECTS)
1016 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1017 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
1019 # Validate channel news.
1020 check-channel-news: $(GOBJECTS)
1021 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1022 "$(top_srcdir)/build-aux/check-channel-news.scm"
1024 # Compute the Cuirass jobs.
1025 cuirass-jobs: $(GOBJECTS)
1027 $(AM_V_at)$(MKDIR_P) "$@"
1028 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
1029 "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
1031 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
1032 .PHONY: assert-no-store-file-names assert-binaries-available
1033 .PHONY: assert-final-inputs-self-contained check-channel-news
1034 .PHONY: clean-go make-go as-derivation authenticate
1035 .PHONY: update-guix-package update-NEWS cuirass-jobs release
1037 # Downloading up-to-date PO files.
1039 WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations
1041 # Shallow clone the Git repository behind Weblate and copy files from it if
1042 # they contain at least one translation, and they are well-formed (Scheme
1043 # format only), warn otherwise. Copied files are converted to a canonical
1046 dir=$$(mktemp -d); \
1047 git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \
1048 for domain in po/doc po/guix po/packages; do \
1049 for po in "$$dir/translations/$$domain"/*.po; do \
1050 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1051 target=$$(basename "$$po"); \
1052 target="$$domain/$$target"; \
1053 if msgfmt -c "$$po" && [ "$$translated" != "0" ]; then \
1054 msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \
1055 mv "$$po".tmp "$$target"; \
1056 echo "copied $$target."; \
1058 echo "WARN: $$target ($$translated translated messages) was not added/updated."; \
1065 ## -------------- ##
1067 ## -------------- ##
1069 AM_V_DL = $(AM_V_DL_$(V))
1070 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
1071 AM_V_DL_0 = @echo " DL " $@;
1073 AM_V_DOT = $(AM_V_DOT_$(V))
1074 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
1075 AM_V_DOT_0 = @echo " DOT " $@;
1077 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
1078 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
1079 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
1081 AM_V_PO4A = $(AM_V_PO4A_$(V))
1082 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
1083 AM_V_PO4A_0 = @echo " PO4A" $@;
1085 AM_V_POXREF = $(AM_V_POXREF_$(V))
1086 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
1087 AM_V_POXREF_0 = @echo " POXREF" $@;