Revert the #51061 patch series for now.
[jackhill/guix/guix.git] / Makefile.am
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>
19 #
20 # This file is part of GNU Guix.
21 #
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.
26 #
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.
31 #
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/>.
34
35 MSGMERGE_UPDATE = @MSGMERGE@ --update
36
37 bin_SCRIPTS = scripts/guix
38
39 # Handle substitution of fully-expanded Autoconf variables.
40 do_subst = $(SED) \
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'
46
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" "$@"
52
53 # This is our variant of the 'guile' executable, one that doesn't complain
54 # about locales.
55 pkglibexec_PROGRAMS = guile
56 guile_SOURCES = gnu/packages/aux-files/guile-launcher.c
57 guile_LDADD = $(GUILE_LIBS)
58 guile_CFLAGS = $(GUILE_CFLAGS)
59
60 # Have the 'guix' command refer to our 'guile'.
61 install-exec-hook:
62 $(SED) -i "$(DESTDIR)$(bindir)/guix" \
63 -e 's,^#![[:graph:]]\+,#!$(pkglibexecdir)/guile,g'
64
65 nodist_noinst_SCRIPTS = \
66 pre-inst-env \
67 test-env
68
69 # Modules that are not compiled but are installed nonetheless, such as
70 # build-side modules with unusual dependencies.
71 MODULES_NOT_COMPILED = \
72 guix/build/po.scm \
73 guix/man-db.scm
74
75 include gnu/local.mk
76 include po/doc/local.mk
77
78 MODULES = \
79 guix/base16.scm \
80 guix/base32.scm \
81 guix/base64.scm \
82 guix/ci.scm \
83 guix/cpio.scm \
84 guix/deprecation.scm \
85 guix/docker.scm \
86 guix/records.scm \
87 guix/openpgp.scm \
88 guix/pki.scm \
89 guix/progress.scm \
90 guix/combinators.scm \
91 guix/memoization.scm \
92 guix/utils.scm \
93 guix/sets.scm \
94 guix/modules.scm \
95 guix/download.scm \
96 guix/discovery.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 \
102 guix/swh.scm \
103 guix/monads.scm \
104 guix/monad-repl.scm \
105 guix/gexp.scm \
106 guix/profiles.scm \
107 guix/serialization.scm \
108 guix/nar.scm \
109 guix/narinfo.scm \
110 guix/derivations.scm \
111 guix/grafts.scm \
112 guix/repl.scm \
113 guix/transformations.scm \
114 guix/inferior.scm \
115 guix/describe.scm \
116 guix/quirks.scm \
117 guix/channels.scm \
118 guix/gnu-maintenance.scm \
119 guix/self.scm \
120 guix/substitutes.scm \
121 guix/upstream.scm \
122 guix/licenses.scm \
123 guix/lint.scm \
124 guix/glob.scm \
125 guix/git.scm \
126 guix/git-authenticate.scm \
127 guix/graph.scm \
128 guix/cache.scm \
129 guix/cve.scm \
130 guix/workers.scm \
131 guix/ipfs.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 \
171 guix/gnupg.scm \
172 guix/elf.scm \
173 guix/profiling.scm \
174 guix/store.scm \
175 guix/cvs-download.scm \
176 guix/svn-download.scm \
177 guix/colors.scm \
178 guix/i18n.scm \
179 guix/diagnostics.scm \
180 guix/ui.scm \
181 guix/status.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 \
199 guix/build/bzr.scm \
200 guix/build/copy-build-system.scm \
201 guix/build/git.scm \
202 guix/build/hg.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 \
232 guix/build/rpath.scm \
233 guix/build/cvs.scm \
234 guix/build/svn.scm \
235 guix/build/syscalls.scm \
236 guix/build/gremlin.scm \
237 guix/build/debug-link.scm \
238 guix/build/clojure-build-system.scm \
239 guix/build/clojure-utils.scm \
240 guix/build/emacs-utils.scm \
241 guix/build/java-utils.scm \
242 guix/build/lisp-utils.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 \
251 guix/packages.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 \
263 guix/import/go.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 \
275 guix/scripts.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/system.scm \
298 guix/scripts/system/search.scm \
299 guix/scripts/system/reconfigure.scm \
300 guix/scripts/home.scm \
301 guix/scripts/home/import.scm \
302 guix/scripts/lint.scm \
303 guix/scripts/challenge.scm \
304 guix/scripts/import/crate.scm \
305 guix/scripts/import/cran.scm \
306 guix/scripts/import/egg.scm \
307 guix/scripts/import/elpa.scm \
308 guix/scripts/import/gem.scm \
309 guix/scripts/import/gnu.scm \
310 guix/scripts/import/go.scm \
311 guix/scripts/import/hackage.scm \
312 guix/scripts/import/json.scm \
313 guix/scripts/import/minetest.scm \
314 guix/scripts/import/opam.scm \
315 guix/scripts/import/pypi.scm \
316 guix/scripts/import/stackage.scm \
317 guix/scripts/import/texlive.scm \
318 guix/scripts/environment.scm \
319 guix/scripts/publish.scm \
320 guix/scripts/edit.scm \
321 guix/scripts/size.scm \
322 guix/scripts/git.scm \
323 guix/scripts/git/authenticate.scm \
324 guix/scripts/graph.scm \
325 guix/scripts/weather.scm \
326 guix/scripts/container.scm \
327 guix/scripts/container/exec.scm \
328 guix/scripts/deploy.scm \
329 guix/scripts/time-machine.scm \
330 guix.scm \
331 $(GNU_SYSTEM_MODULES)
332
333 if HAVE_GUILE_SSH
334
335 MODULES += \
336 guix/ssh.scm \
337 guix/remote.scm \
338 guix/scripts/copy.scm \
339 guix/store/ssh.scm
340
341 endif HAVE_GUILE_SSH
342
343 if HAVE_GUILE_AVAHI
344
345 MODULES += \
346 guix/avahi.scm \
347 guix/scripts/discover.scm
348
349 endif HAVE_GUILE_AVAHI
350
351 if BUILD_DAEMON_OFFLOAD
352
353 MODULES += \
354 guix/scripts/offload.scm
355
356 endif BUILD_DAEMON_OFFLOAD
357
358 # Scheme implementation of the build daemon and related functionality.
359 STORE_MODULES = \
360 guix/store/database.scm \
361 guix/store/deduplication.scm \
362 guix/store/roots.scm
363
364 MODULES += $(STORE_MODULES)
365
366 # Internal modules with test suite support.
367 dist_noinst_DATA = \
368 guix/tests.scm \
369 guix/tests/http.scm \
370 guix/tests/git.scm \
371 guix/tests/gnupg.scm
372
373 # Auxiliary files for packages.
374 AUX_FILES = \
375 gnu/packages/aux-files/chromium/master-preferences.json \
376 gnu/packages/aux-files/emacs/guix-emacs.el \
377 gnu/packages/aux-files/guix.vim \
378 gnu/packages/aux-files/linux-libre/5.14-arm.conf \
379 gnu/packages/aux-files/linux-libre/5.14-arm64.conf \
380 gnu/packages/aux-files/linux-libre/5.14-i686.conf \
381 gnu/packages/aux-files/linux-libre/5.14-x86_64.conf \
382 gnu/packages/aux-files/linux-libre/5.10-arm.conf \
383 gnu/packages/aux-files/linux-libre/5.10-arm64.conf \
384 gnu/packages/aux-files/linux-libre/5.10-i686.conf \
385 gnu/packages/aux-files/linux-libre/5.10-x86_64.conf \
386 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
387 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
388 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
389 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
390 gnu/packages/aux-files/linux-libre/4.19-arm.conf \
391 gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
392 gnu/packages/aux-files/linux-libre/4.19-i686.conf \
393 gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
394 gnu/packages/aux-files/linux-libre/4.14-arm.conf \
395 gnu/packages/aux-files/linux-libre/4.14-i686.conf \
396 gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
397 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
398 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
399 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
400 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
401 gnu/packages/aux-files/pack-audit.c \
402 gnu/packages/aux-files/run-in-namespace.c
403
404 # Templates, examples.
405 EXAMPLES = \
406 gnu/system/examples/asus-c201.tmpl \
407 gnu/system/examples/bare-bones.tmpl \
408 gnu/system/examples/bare-hurd.tmpl \
409 gnu/system/examples/beaglebone-black.tmpl \
410 gnu/system/examples/desktop.tmpl \
411 gnu/system/examples/lightweight-desktop.tmpl \
412 gnu/system/examples/docker-image.tmpl \
413 gnu/system/examples/vm-image.tmpl
414
415 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
416
417 nobase_dist_guilemodule_DATA = \
418 guix/d3.v3.js \
419 guix/graph.js \
420 guix/store/schema.sql \
421 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
422 $(MISC_DISTRO_FILES)
423 nobase_nodist_guilemodule_DATA = guix/config.scm
424 nobase_nodist_guileobject_DATA = $(GOBJECTS)
425
426 # Handy way to remove the .go files without removing all the rest.
427 clean-go:
428 -$(RM) -f $(GOBJECTS)
429 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
430 if test -t 1; then \
431 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
432 else \
433 xargs -r echo "warning: stray .go files:"; \
434 fi
435
436
437 # Test extensions; has to be unconditional.
438 TEST_EXTENSIONS = .scm .sh
439
440 if CAN_RUN_TESTS
441
442 SCM_TESTS = \
443 tests/accounts.scm \
444 tests/base16.scm \
445 tests/base32.scm \
446 tests/base64.scm \
447 tests/boot-parameters.scm \
448 tests/bournish.scm \
449 tests/builders.scm \
450 tests/build-utils.scm \
451 tests/cache.scm \
452 tests/challenge.scm \
453 tests/channels.scm \
454 tests/combinators.scm \
455 tests/containers.scm \
456 tests/cpan.scm \
457 tests/cpio.scm \
458 tests/cran.scm \
459 tests/crate.scm \
460 tests/cve.scm \
461 tests/debug-link.scm \
462 tests/derivations.scm \
463 tests/discovery.scm \
464 tests/egg.scm \
465 tests/elpa.scm \
466 tests/file-systems.scm \
467 tests/gem.scm \
468 tests/gexp.scm \
469 tests/git.scm \
470 tests/git-authenticate.scm \
471 tests/glob.scm \
472 tests/gnu-maintenance.scm \
473 tests/grafts.scm \
474 tests/graph.scm \
475 tests/gremlin.scm \
476 tests/hackage.scm \
477 tests/import-git.scm \
478 tests/import-utils.scm \
479 tests/inferior.scm \
480 tests/lint.scm \
481 tests/minetest.scm \
482 tests/modules.scm \
483 tests/monads.scm \
484 tests/nar.scm \
485 tests/networking.scm \
486 tests/opam.scm \
487 tests/openpgp.scm \
488 tests/packages.scm \
489 tests/pack.scm \
490 tests/pki.scm \
491 tests/print.scm \
492 tests/processes.scm \
493 tests/profiles.scm \
494 tests/publish.scm \
495 tests/pypi.scm \
496 tests/records.scm \
497 tests/scripts.scm \
498 tests/search-paths.scm \
499 tests/services.scm \
500 tests/services/file-sharing.scm \
501 tests/services/configuration.scm \
502 tests/services/linux.scm \
503 tests/services/telephony.scm \
504 tests/sets.scm \
505 tests/size.scm \
506 tests/status.scm \
507 tests/store-database.scm \
508 tests/store-deduplication.scm \
509 tests/store-roots.scm \
510 tests/store.scm \
511 tests/substitute.scm \
512 tests/swh.scm \
513 tests/syscalls.scm \
514 tests/system.scm \
515 tests/texlive.scm \
516 tests/transformations.scm \
517 tests/ui.scm \
518 tests/union.scm \
519 tests/upstream.scm \
520 tests/utils.scm \
521 tests/uuid.scm \
522 tests/workers.scm
523
524 if HAVE_GUILE_LIB
525 SCM_TESTS += tests/go.scm
526 else
527 EXTRA_DIST += tests/go.scm
528 endif
529
530 if BUILD_DAEMON_OFFLOAD
531 SCM_TESTS += tests/offload.scm
532 else
533 EXTRA_DIST += tests/offload.scm
534 endif
535
536 SH_TESTS = \
537 tests/guix-build.sh \
538 tests/guix-build-branch.sh \
539 tests/guix-download.sh \
540 tests/guix-gc.sh \
541 tests/guix-git-authenticate.sh \
542 tests/guix-hash.sh \
543 tests/guix-pack.sh \
544 tests/guix-pack-localstatedir.sh \
545 tests/guix-pack-relocatable.sh \
546 tests/guix-package.sh \
547 tests/guix-package-aliases.sh \
548 tests/guix-package-net.sh \
549 tests/guix-system.sh \
550 tests/guix-archive.sh \
551 tests/guix-authenticate.sh \
552 tests/guix-environment.sh \
553 tests/guix-environment-container.sh \
554 tests/guix-graph.sh \
555 tests/guix-describe.sh \
556 tests/guix-repl.sh \
557 tests/guix-lint.sh
558
559 TESTS = $(SCM_TESTS) $(SH_TESTS)
560
561 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
562
563 SCM_LOG_DRIVER = \
564 $(top_builddir)/test-env --quiet-stderr \
565 $(GUILE) --no-auto-compile -e main \
566 $(top_srcdir)/build-aux/test-driver.scm
567
568 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
569
570 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
571 AM_SH_LOG_FLAGS = -x -e
572
573 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
574 # could end up removing files from the store while they are being used by
575 # other instances of the daemon.
576 tests/guix-gc.log: \
577 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
578 $(SCM_TESTS:%.scm=%.log)
579
580 else !CAN_RUN_TESTS
581
582 TESTS =
583 SH_TESTS =
584 SCM_TESTS =
585
586 # Automake always generates a 'check' target, so better not override it.
587 check-local:
588 @echo
589 @echo "Cannot run tests because file name limits would be exceeded." >&2
590 @echo "Look for 'length' in the 'config.log' file for details." >&2
591 @echo
592 @exit 1
593
594 endif !CAN_RUN_TESTS
595
596 check-system: $(GOBJECTS)
597 $(AM_V_at)$(top_builddir)/pre-inst-env \
598 guix build -m $(top_srcdir)/etc/system-tests.scm -K
599
600 # Public keys used to sign substitutes.
601 dist_pkgdata_DATA = \
602 etc/substitutes/berlin.guix.gnu.org.pub \
603 etc/substitutes/ci.guix.gnu.org.pub \
604 etc/substitutes/ci.guix.info.pub \
605 etc/substitutes/bordeaux.guix.gnu.org.pub
606
607 # Bash completion file.
608 dist_bashcompletion_DATA = etc/completion/bash/guix \
609 etc/completion/bash/guix-daemon
610
611 # Zsh completion file.
612 dist_zshcompletion_DATA = etc/completion/zsh/_guix
613
614 # Fish completion file.
615 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
616
617 # SELinux policy
618 nodist_selinux_policy_DATA = etc/guix-daemon.cil
619
620 EXTRA_DIST += \
621 HACKING \
622 ROADMAP \
623 TODO \
624 CODE-OF-CONDUCT \
625 .dir-locals.el \
626 .guix-authorizations \
627 .guix-channel \
628 scripts/guix.in \
629 etc/disarchive-manifest.scm \
630 etc/guix-install.sh \
631 etc/news.scm \
632 etc/release-manifest.scm \
633 etc/source-manifest.scm \
634 etc/system-tests.scm \
635 etc/historical-authorizations \
636 build-aux/build-self.scm \
637 build-aux/compile-all.scm \
638 build-aux/cuirass/hurd-manifest.scm \
639 build-aux/check-final-inputs-self-contained.scm \
640 build-aux/check-channel-news.scm \
641 build-aux/compile-as-derivation.scm \
642 build-aux/generate-authors.scm \
643 build-aux/test-driver.scm \
644 build-aux/update-guix-package.scm \
645 build-aux/update-NEWS.scm \
646 tests/test.drv \
647 tests/signing-key.pub \
648 tests/signing-key.sec \
649 tests/cve-sample.json \
650 tests/civodul.key \
651 tests/rsa.key \
652 tests/dsa.key \
653 tests/ed25519.key \
654 tests/ed25519.sec \
655 tests/ed25519bis.key \
656 tests/ed25519bis.sec \
657 build-aux/config.rpath \
658 bootstrap \
659 doc/build.scm \
660 $(TESTS)
661
662 if !BUILD_DAEMON_OFFLOAD
663
664 EXTRA_DIST += \
665 guix/scripts/offload.scm
666
667 endif !BUILD_DAEMON_OFFLOAD
668
669
670 CLEANFILES = \
671 $(bin_SCRIPTS) \
672 $(GOBJECTS) \
673 $(SCM_TESTS:tests/%.scm=%.log)
674
675 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
676 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
677 # there that are newer than the local .scm files (for instance because the
678 # user ran 'make install' recently). When that happens, we end up loading
679 # those previously-installed .go files, which may be stale, thereby breaking
680 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
681 # stale files from ~/.cache/guile/ccache.
682 %.go: make-go ; @:
683 make-go: make-core-go make-packages-go make-system-go make-cli-go
684
685 # Define a rule to build a subset of the .go files.
686 define guile-compilation-rule
687
688 $(1): $(2)
689 $(AM_V_at)echo "Compiling Scheme modules..." ; \
690 unset GUILE_LOAD_COMPILED_PATH ; \
691 XDG_CACHE_HOME=/nowhere \
692 host=$(host) srcdir="$(top_srcdir)" \
693 $(top_builddir)/pre-inst-env \
694 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
695 --no-auto-compile \
696 -s "$(top_srcdir)"/build-aux/compile-all.scm \
697 --total $(words $(MODULES)) \
698 --completed $(3) \
699 $$(filter %.scm,$$^)
700
701 .PHONY: $(1)
702
703 endef
704
705 # Split compilation in several steps, each of which building a subset of
706 # $(MODULES). The main goal is to reduce peak memory consumption, as reported
707 # in <https://issues.guix.gnu.org/48963>. Each 'eval' call below creates a
708 # 'make-*-go' phony target that builds the corresponding subset.
709
710 MODULES_CORE = guix.scm $(filter-out guix/scripts/%,$(filter guix/%,$(MODULES)))
711 MODULES_PACKAGES = $(filter gnu/packages/%,$(MODULES))
712 MODULES_SYSTEM = gnu.scm $(filter-out gnu/packages/%,$(filter gnu/%,$(MODULES)))
713 MODULES_CLI = $(filter guix/scripts/%,$(MODULES))
714
715 $(eval $(call guile-compilation-rule,make-core-go, \
716 $(MODULES_CORE) guix/config.scm $(dist_noinst_DATA), \
717 0))
718
719 $(eval $(call guile-compilation-rule,make-packages-go, \
720 $(MODULES_PACKAGES) make-core-go, \
721 $(words $(MODULES_CORE))))
722
723 $(eval $(call guile-compilation-rule,make-system-go, \
724 $(MODULES_SYSTEM) make-packages-go make-core-go, \
725 $(words $(MODULES_CORE) $(MODULES_PACKAGES))))
726
727 $(eval $(call guile-compilation-rule,make-cli-go, \
728 $(MODULES_CLI) make-system-go make-packages-go make-core-go, \
729 $(words $(MODULES_CORE) $(MODULES_PACKAGES) $(MODULES_SYSTEM))))
730
731 SUFFIXES = .go
732
733 # Make sure source files are installed first, so that the mtime of
734 # installed compiled files is greater than that of installed source
735 # files. See
736 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
737 # for details.
738 guix_install_go_files = install-nobase_nodist_guileobjectDATA
739 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
740
741 # The above trick doesn't work for 'config.go' because both 'config.scm' and
742 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
743 # special treatment.
744 install-data-hook:
745 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
746
747 # Commit corresponding to the 'v1.0.0' tag.
748 commit_v1_0_0 = 6298c3ffd9654d3231a6f25390b056483e8f407c
749
750 # Introduction of the 'guix' channel. Keep in sync with (guix channels)!
751 channel_intro_commit = 9edb3f66fd807b096b48283debdcddccfea34bad
752 channel_intro_signer = BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA
753
754 # Authenticate the current Git checkout by checking signatures on every commit.
755 GUIX_GIT_KEYRING = origin/keyring
756 authenticate:
757 $(AM_V_at)echo "Authenticating Git checkout..." ; \
758 guix git authenticate \
759 --keyring=$(GUIX_GIT_KEYRING) \
760 --cache-key=channels/guix --stats \
761 "$(channel_intro_commit)" "$(channel_intro_signer)"
762
763 # Assuming Guix is already installed and the daemon is up and running, this
764 # rule builds from $(srcdir), creating and building derivations.
765 as-derivation:
766 $(AM_V_at)echo "Building Guix in Guix..." ; \
767 $(GUILE) --no-auto-compile \
768 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
769 "$(abs_top_srcdir)"
770
771 SUBDIRS = po/guix po/packages
772 BUILT_SOURCES =
773
774 include doc/local.mk
775
776 if BUILD_DAEMON
777
778 include nix/local.mk
779
780 endif BUILD_DAEMON
781
782 ACLOCAL_AMFLAGS = -I m4
783
784 # Pass an explicit '--localstatedir' so that configure does not error out if
785 # it finds an existing installation with a different localstatedir. Inherit
786 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
787 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
788 # enough for shebangs.
789 AM_DISTCHECK_CONFIGURE_FLAGS = \
790 --localstatedir="$$dc_install_base/var" \
791 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
792 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
793 --enable-daemon \
794 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
795
796 # The self-contained tarball.
797 guix-binary.%.tar.xz:
798 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
799 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
800 --fallback \
801 -s "$*" --localstatedir --profile-name=current-guix \
802 guix` ; \
803 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
804
805
806 # The dependency on doc-pot-update is to generate the .pot files, which are
807 # not checked in.
808 dist: doc-pot-update
809
810 dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
811 dist-hook: assert-no-store-file-names
812
813 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
814
815 EXTRA_DIST += $(top_srcdir)/.version
816 BUILT_SOURCES += $(top_srcdir)/.version
817 $(top_srcdir)/.version: config.status
818 $(AM_V_GEN)echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
819
820 gen-tarball-version:
821 echo $(VERSION) > "$(distdir)/.tarball-version"
822
823 gen-ChangeLog:
824 $(AM_V_GEN)if test -d .git; then \
825 $(top_srcdir)/build-aux/gitlog-to-changelog \
826 > $(distdir)/ChangeLog.tmp; \
827 rm -f $(distdir)/ChangeLog; \
828 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
829 fi
830
831 gen-AUTHORS:
832 $(AM_V_GEN)if test -d .git; then \
833 rm -f "$(distdir)/AUTHORS"; \
834 $(top_builddir)/pre-inst-env "$(GUILE)" \
835 "$(top_srcdir)/build-aux/generate-authors.scm" \
836 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
837 fi
838
839 # Like 'dist', but regenerate 'configure' so we get an up-to-date
840 # 'PACKAGE_VERSION' string. (In Gnulib, 'GNUmakefile' has a special trick to
841 # do that whenever a 'dist' target is used.)
842 dist-with-updated-version:
843 @echo "Running './bootstrap' for new version string..."
844 $(top_srcdir)/bootstrap
845 $(MAKE) $(AM_MAKEFLAGS) $(top_srcdir)/.version dist
846
847 .PHONY: dist-with-updated-version
848
849 \f
850 #
851 # Release management.
852 #
853
854 releasedir = release-$(PACKAGE_VERSION)
855
856 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
857
858 # List of source tarballs produced. This must be kept in sync with the
859 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
860 SOURCE_TARBALLS = \
861 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
862
863 # Systems supported by Guix.
864 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux \
865 powerpc64le-linux
866
867 # Guix binary tarballs.
868 BINARY_TARBALLS = \
869 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
870
871 # Systems supported by Guix System.
872 GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
873
874 # Systems for which we build Guix VMs.
875 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
876
877 # Prefix of the Guix installation image file name.
878 GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
879
880 # Prefix of the Guix VM image file name.
881 GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
882
883 # Flags for 'guix system vm-image'. By default create a VM image that appears
884 # to have a 20G hard disk.
885 GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
886
887 # Return the sequence of '-s' flags for the given systems.
888 system_flags = $(foreach system,$(1),-s $(system))
889
890 # The release process works in several phases:
891 #
892 # 0. We assume the developer created a 'vX.Y.Z' tag.
893 # 1. Build the source tarball.
894 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y.Z' tag.
895 # 3. Build the binary tarballs for that 'guix' package.
896 # 4. Update the 'guix' package again.
897 # 5. Build the installation and VM images. The images will run 'guix'
898 # corresponding to 'vX.Y.Z' + 1 commit, and they will install 'vX.Y.Z'.
899 #
900 # This 'release' target takes care of everything and copies the resulting
901 # files to $(releasedir).
902 #
903 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
904 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
905 release: dist-with-updated-version all
906 @if ! git diff-index --quiet HEAD; then \
907 echo "There are uncommitted changes; stopping." >&2 ; \
908 exit 1 ; \
909 fi
910 $(MKDIR_P) "$(releasedir)"
911 rm -f "$(releasedir)"/*
912 mv $(SOURCE_TARBALLS) "$(releasedir)"
913 # Bump the Guix package version and build it.
914 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
915 $(top_builddir)/pre-inst-env "$(GUILE)" \
916 $(top_srcdir)/build-aux/update-guix-package.scm \
917 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
918 git add $(top_srcdir)/gnu/packages/package-management.scm
919 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
920 $(top_builddir)/pre-inst-env guix build guix \
921 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
922 -v1 --no-grafts --fallback
923 # Generate the binary release tarballs.
924 rm -f $(BINARY_TARBALLS)
925 $(MAKE) $(BINARY_TARBALLS)
926 for system in $(SUPPORTED_SYSTEMS) ; do \
927 mv "guix-binary.$$system.tar.xz" \
928 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
929 done
930 # Bump the Guix package version and build it (again).
931 GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=yes \
932 $(top_builddir)/pre-inst-env "$(GUILE)" \
933 $(top_srcdir)/build-aux/update-guix-package.scm \
934 "`git rev-parse HEAD`"
935 git add $(top_srcdir)/gnu/packages/package-management.scm
936 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
937 $(top_builddir)/pre-inst-env guix build guix \
938 $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
939 -v1 --no-grafts --fallback
940 # Generate the ISO installation images.
941 for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
942 image=`$(top_builddir)/pre-inst-env \
943 guix system image -t iso9660 \
944 --label="GUIX_$${system}_$(VERSION)" \
945 --system=$$system --fallback \
946 gnu/system/install.scm` ; \
947 if [ ! -f "$$image" ] ; then \
948 echo "failed to produced Guix installation image for $$system" >&2 ; \
949 exit 1 ; \
950 fi ; \
951 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" ; \
952 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.tmp" \
953 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso" ; \
954 done
955 # Generate the VM images.
956 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
957 image=`$(top_builddir)/pre-inst-env \
958 guix system image -t qcow2 $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
959 --save-provenance \
960 --system=$$system --fallback \
961 gnu/system/examples/vm-image.tmpl` ; \
962 if [ ! -f "$$image" ] ; then \
963 echo "failed to produced Guix VM image for $$system" >&2 ; \
964 exit 1 ; \
965 fi ; \
966 cp "$$image" "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.qcow2"; \
967 done
968 @echo
969 @echo "Congratulations! All the release files are now in $(releasedir)."
970 @echo
971
972 update-guix-package:
973 git rev-parse HEAD
974 $(top_builddir)/pre-inst-env "$(GUILE)" \
975 $(top_srcdir)/build-aux/update-guix-package.scm \
976 "`git rev-parse HEAD`"
977
978 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
979 # Package data from this checkout is used by 'update-NEWS.scm'.
980 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
981
982 update-NEWS: $(GOBJECTS)
983 $(top_builddir)/pre-inst-env "$(GUILE)" \
984 $(top_srcdir)/build-aux/update-NEWS.scm \
985 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
986
987 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
988 assert-no-store-file-names:
989 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
990 --exclude=*.info-[0-9] --exclude=*.dot \
991 --exclude=*.eps --exclude-dir=bootstrap \
992 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
993 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
994 --exclude=guix-prettify.el \
995 --exclude=ChangeLog* \
996 --exclude=binutils-boot-2.20*.patch \
997 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
998 then \
999 echo "error: store file names embedded in the distribution" >&2 ; \
1000 exit 1 ; \
1001 fi
1002
1003 # Make sure important substitutes are available.
1004 assert-binaries-available: $(GOBJECTS)
1005 $(AM_V_at)$(top_builddir)/pre-inst-env \
1006 guix weather -m "$(top_srcdir)/etc/release-manifest.scm" \
1007 --display-missing
1008
1009 # Make sure the final inputs don't refer to bootstrap tools.
1010 assert-final-inputs-self-contained: $(GOBJECTS)
1011 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1012 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
1013
1014 # Validate channel news.
1015 check-channel-news: $(GOBJECTS)
1016 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
1017 "$(top_srcdir)/build-aux/check-channel-news.scm"
1018
1019 # Compute the Cuirass jobs.
1020 cuirass-jobs: $(GOBJECTS)
1021 rm -rf "$@"
1022 $(AM_V_at)$(MKDIR_P) "$@"
1023 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
1024 "$(top_srcdir)/build-aux/cuirass/evaluate.scm" "$@"
1025
1026 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
1027 .PHONY: assert-no-store-file-names assert-binaries-available
1028 .PHONY: assert-final-inputs-self-contained check-channel-news
1029 .PHONY: clean-go make-go as-derivation authenticate
1030 .PHONY: update-guix-package update-NEWS cuirass-jobs release
1031
1032 # Downloading up-to-date PO files.
1033
1034 WEBLATE_REPO = https://framagit.org/tyreunom/guix-translations
1035
1036 # Shallow clone the Git repository behind Weblate and copy files from it if
1037 # they contain at least one translation, and they are well-formed (Scheme
1038 # format only), warn otherwise. Copied files are converted to a canonical
1039 # form.
1040 download-po:
1041 dir=$$(mktemp -d); \
1042 git clone --depth 1 "$(WEBLATE_REPO)" "$$dir/translations"; \
1043 for domain in po/doc po/guix po/packages; do \
1044 for po in "$$dir/translations/$$domain"/*.po; do \
1045 translated=$$(LANG=en_US.UTF-8 msgfmt --statistics "$$po" 2>&1 | cut -f1 -d' '); \
1046 target=$$(basename "$$po"); \
1047 target="$$domain/$$target"; \
1048 if msgfmt -c "$$po" && [ "$$translated" != "0" ]; then \
1049 msgfilter --no-wrap -i "$$po" cat > "$$po".tmp; \
1050 mv "$$po".tmp "$$target"; \
1051 echo "copied $$target."; \
1052 else \
1053 echo "WARN: $$target ($$translated translated messages) was not added/updated."; \
1054 fi; \
1055 done; \
1056 done; \
1057 rm -rf "$$dir"
1058 .PHONY: download-po
1059
1060 ## -------------- ##
1061 ## Silent rules. ##
1062 ## -------------- ##
1063
1064 AM_V_DL = $(AM_V_DL_$(V))
1065 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
1066 AM_V_DL_0 = @echo " DL " $@;
1067
1068 AM_V_DOT = $(AM_V_DOT_$(V))
1069 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
1070 AM_V_DOT_0 = @echo " DOT " $@;
1071
1072 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
1073 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
1074 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
1075
1076 AM_V_PO4A = $(AM_V_PO4A_$(V))
1077 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
1078 AM_V_PO4A_0 = @echo " PO4A" $@;
1079
1080 AM_V_POXREF = $(AM_V_POXREF_$(V))
1081 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
1082 AM_V_POXREF_0 = @echo " POXREF" $@;