gnu: gnome-shell-extension-hide-app-icon: Fix installation.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 Jan Nieuwenhuizen <janneke@gnu.org>
11 # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
12 # Copyright © 2018 ng0 <ng0@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 #
18 # This file is part of GNU Guix.
19 #
20 # GNU Guix is free software; you can redistribute it and/or modify it
21 # under the terms of the GNU General Public License as published by
22 # the Free Software Foundation; either version 3 of the License, or (at
23 # your option) any later version.
24 #
25 # GNU Guix is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 # GNU General Public License for more details.
29 #
30 # You should have received a copy of the GNU General Public License
31 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 MSGMERGE_UPDATE = @MSGMERGE@ --update
34
35 bin_SCRIPTS = scripts/guix
36
37 # Handle substitution of fully-expanded Autoconf variables.
38 do_subst = $(SED) \
39 -e 's,[@]GUILE[@],$(GUILE),g' \
40 -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
41 -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
42 -e 's,[@]localedir[@],$(localedir),g'
43
44 scripts/guix: scripts/guix.in Makefile
45 $(AM_V_at)rm -f $@ $@-t
46 $(AM_V_at)$(MKDIR_P) "$(@D)"
47 $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
48 $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@"
49
50 nodist_noinst_SCRIPTS = \
51 pre-inst-env \
52 test-env
53
54 # Modules that are not compiled but are installed nonetheless, such as
55 # build-side modules with unusual dependencies.
56 MODULES_NOT_COMPILED = \
57 guix/build/po.scm \
58 guix/man-db.scm
59
60 include gnu/local.mk
61 include po/doc/local.mk
62
63 MODULES = \
64 guix/base16.scm \
65 guix/base32.scm \
66 guix/base64.scm \
67 guix/ci.scm \
68 guix/cpio.scm \
69 guix/deprecation.scm \
70 guix/docker.scm \
71 guix/json.scm \
72 guix/records.scm \
73 guix/pki.scm \
74 guix/progress.scm \
75 guix/combinators.scm \
76 guix/memoization.scm \
77 guix/utils.scm \
78 guix/sets.scm \
79 guix/modules.scm \
80 guix/download.scm \
81 guix/discovery.scm \
82 guix/bzr-download.scm \
83 guix/git-download.scm \
84 guix/hg-download.scm \
85 guix/swh.scm \
86 guix/monads.scm \
87 guix/monad-repl.scm \
88 guix/gexp.scm \
89 guix/profiles.scm \
90 guix/serialization.scm \
91 guix/nar.scm \
92 guix/derivations.scm \
93 guix/grafts.scm \
94 guix/repl.scm \
95 guix/inferior.scm \
96 guix/describe.scm \
97 guix/channels.scm \
98 guix/gnu-maintenance.scm \
99 guix/self.scm \
100 guix/upstream.scm \
101 guix/licenses.scm \
102 guix/lint.scm \
103 guix/glob.scm \
104 guix/git.scm \
105 guix/graph.scm \
106 guix/cache.scm \
107 guix/cve.scm \
108 guix/workers.scm \
109 guix/zlib.scm \
110 guix/lzlib.scm \
111 guix/build-system.scm \
112 guix/build-system/android-ndk.scm \
113 guix/build-system/ant.scm \
114 guix/build-system/cargo.scm \
115 guix/build-system/clojure.scm \
116 guix/build-system/cmake.scm \
117 guix/build-system/dub.scm \
118 guix/build-system/dune.scm \
119 guix/build-system/emacs.scm \
120 guix/build-system/font.scm \
121 guix/build-system/go.scm \
122 guix/build-system/meson.scm \
123 guix/build-system/minify.scm \
124 guix/build-system/asdf.scm \
125 guix/build-system/glib-or-gtk.scm \
126 guix/build-system/gnu.scm \
127 guix/build-system/guile.scm \
128 guix/build-system/haskell.scm \
129 guix/build-system/julia.scm \
130 guix/build-system/linux-module.scm \
131 guix/build-system/node.scm \
132 guix/build-system/perl.scm \
133 guix/build-system/python.scm \
134 guix/build-system/ocaml.scm \
135 guix/build-system/qt.scm \
136 guix/build-system/waf.scm \
137 guix/build-system/r.scm \
138 guix/build-system/rakudo.scm \
139 guix/build-system/ruby.scm \
140 guix/build-system/scons.scm \
141 guix/build-system/texlive.scm \
142 guix/build-system/trivial.scm \
143 guix/ftp-client.scm \
144 guix/http-client.scm \
145 guix/gnupg.scm \
146 guix/elf.scm \
147 guix/profiling.scm \
148 guix/store.scm \
149 guix/cvs-download.scm \
150 guix/svn-download.scm \
151 guix/colors.scm \
152 guix/i18n.scm \
153 guix/diagnostics.scm \
154 guix/ui.scm \
155 guix/status.scm \
156 guix/build/android-ndk-build-system.scm \
157 guix/build/ant-build-system.scm \
158 guix/build/download.scm \
159 guix/build/download-nar.scm \
160 guix/build/cargo-build-system.scm \
161 guix/build/cargo-utils.scm \
162 guix/build/cmake-build-system.scm \
163 guix/build/dub-build-system.scm \
164 guix/build/dune-build-system.scm \
165 guix/build/emacs-build-system.scm \
166 guix/build/meson-build-system.scm \
167 guix/build/minify-build-system.scm \
168 guix/build/font-build-system.scm \
169 guix/build/go-build-system.scm \
170 guix/build/asdf-build-system.scm \
171 guix/build/bzr.scm \
172 guix/build/git.scm \
173 guix/build/hg.scm \
174 guix/build/glib-or-gtk-build-system.scm \
175 guix/build/gnu-build-system.scm \
176 guix/build/gnu-dist.scm \
177 guix/build/guile-build-system.scm \
178 guix/build/node-build-system.scm \
179 guix/build/perl-build-system.scm \
180 guix/build/python-build-system.scm \
181 guix/build/ocaml-build-system.scm \
182 guix/build/qt-build-system.scm \
183 guix/build/r-build-system.scm \
184 guix/build/rakudo-build-system.scm \
185 guix/build/ruby-build-system.scm \
186 guix/build/scons-build-system.scm \
187 guix/build/texlive-build-system.scm \
188 guix/build/waf-build-system.scm \
189 guix/build/haskell-build-system.scm \
190 guix/build/julia-build-system.scm \
191 guix/build/linux-module-build-system.scm \
192 guix/build/store-copy.scm \
193 guix/build/json.scm \
194 guix/build/utils.scm \
195 guix/build/union.scm \
196 guix/build/profiles.scm \
197 guix/build/compile.scm \
198 guix/build/rpath.scm \
199 guix/build/cvs.scm \
200 guix/build/svn.scm \
201 guix/build/syscalls.scm \
202 guix/build/gremlin.scm \
203 guix/build/debug-link.scm \
204 guix/build/clojure-build-system.scm \
205 guix/build/clojure-utils.scm \
206 guix/build/emacs-utils.scm \
207 guix/build/java-utils.scm \
208 guix/build/lisp-utils.scm \
209 guix/build/graft.scm \
210 guix/build/bournish.scm \
211 guix/build/qt-utils.scm \
212 guix/build/make-bootstrap.scm \
213 guix/search-paths.scm \
214 guix/packages.scm \
215 guix/import/cabal.scm \
216 guix/import/cpan.scm \
217 guix/import/cran.scm \
218 guix/import/crate.scm \
219 guix/import/elpa.scm \
220 guix/import/gem.scm \
221 guix/import/github.scm \
222 guix/import/gnome.scm \
223 guix/import/gnu.scm \
224 guix/import/hackage.scm \
225 guix/import/json.scm \
226 guix/import/kde.scm \
227 guix/import/launchpad.scm \
228 guix/import/opam.scm \
229 guix/import/print.scm \
230 guix/import/pypi.scm \
231 guix/import/snix.scm \
232 guix/import/stackage.scm \
233 guix/import/texlive.scm \
234 guix/import/utils.scm \
235 guix/scripts.scm \
236 guix/scripts/download.scm \
237 guix/scripts/perform-download.scm \
238 guix/scripts/build.scm \
239 guix/scripts/archive.scm \
240 guix/scripts/import.scm \
241 guix/scripts/package.scm \
242 guix/scripts/install.scm \
243 guix/scripts/remove.scm \
244 guix/scripts/upgrade.scm \
245 guix/scripts/search.scm \
246 guix/scripts/show.scm \
247 guix/scripts/gc.scm \
248 guix/scripts/hash.scm \
249 guix/scripts/pack.scm \
250 guix/scripts/pull.scm \
251 guix/scripts/processes.scm \
252 guix/scripts/substitute.scm \
253 guix/scripts/authenticate.scm \
254 guix/scripts/refresh.scm \
255 guix/scripts/repl.scm \
256 guix/scripts/describe.scm \
257 guix/scripts/system.scm \
258 guix/scripts/system/search.scm \
259 guix/scripts/system/reconfigure.scm \
260 guix/scripts/lint.scm \
261 guix/scripts/challenge.scm \
262 guix/scripts/import/crate.scm \
263 guix/scripts/import/cran.scm \
264 guix/scripts/import/elpa.scm \
265 guix/scripts/import/gem.scm \
266 guix/scripts/import/gnu.scm \
267 guix/scripts/import/hackage.scm \
268 guix/scripts/import/json.scm \
269 guix/scripts/import/nix.scm \
270 guix/scripts/import/opam.scm \
271 guix/scripts/import/pypi.scm \
272 guix/scripts/import/stackage.scm \
273 guix/scripts/import/texlive.scm \
274 guix/scripts/environment.scm \
275 guix/scripts/publish.scm \
276 guix/scripts/edit.scm \
277 guix/scripts/size.scm \
278 guix/scripts/graph.scm \
279 guix/scripts/weather.scm \
280 guix/scripts/container.scm \
281 guix/scripts/container/exec.scm \
282 guix/scripts/deploy.scm \
283 guix/scripts/time-machine.scm \
284 guix.scm \
285 $(GNU_SYSTEM_MODULES)
286
287 if HAVE_GUILE_SSH
288
289 MODULES += \
290 guix/ssh.scm \
291 guix/remote.scm \
292 guix/scripts/copy.scm \
293 guix/store/ssh.scm
294
295 endif HAVE_GUILE_SSH
296
297 if BUILD_DAEMON_OFFLOAD
298
299 MODULES += \
300 guix/scripts/offload.scm
301
302 endif BUILD_DAEMON_OFFLOAD
303
304 # Scheme implementation of the build daemon and related functionality.
305 STORE_MODULES = \
306 guix/store/database.scm \
307 guix/store/deduplication.scm \
308 guix/store/roots.scm
309
310 MODULES += $(STORE_MODULES)
311
312 # Internal modules with test suite support.
313 dist_noinst_DATA = \
314 guix/tests.scm \
315 guix/tests/http.scm \
316 guix/tests/git.scm
317
318 # Auxiliary files for packages.
319 AUX_FILES = \
320 gnu/packages/aux-files/chromium/master-preferences.json \
321 gnu/packages/aux-files/emacs/guix-emacs.el \
322 gnu/packages/aux-files/linux-libre/5.4-arm.conf \
323 gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf \
324 gnu/packages/aux-files/linux-libre/5.4-arm64.conf \
325 gnu/packages/aux-files/linux-libre/5.4-i686.conf \
326 gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \
327 gnu/packages/aux-files/linux-libre/4.19-arm.conf \
328 gnu/packages/aux-files/linux-libre/4.19-arm64.conf \
329 gnu/packages/aux-files/linux-libre/4.19-i686.conf \
330 gnu/packages/aux-files/linux-libre/4.19-x86_64.conf \
331 gnu/packages/aux-files/linux-libre/4.14-arm.conf \
332 gnu/packages/aux-files/linux-libre/4.14-i686.conf \
333 gnu/packages/aux-files/linux-libre/4.14-x86_64.conf \
334 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
335 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
336 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
337 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
338 gnu/packages/aux-files/run-in-namespace.c
339
340 # Templates, examples.
341 EXAMPLES = \
342 gnu/system/examples/asus-c201.tmpl \
343 gnu/system/examples/bare-bones.tmpl \
344 gnu/system/examples/beaglebone-black.tmpl \
345 gnu/system/examples/desktop.tmpl \
346 gnu/system/examples/lightweight-desktop.tmpl \
347 gnu/system/examples/docker-image.tmpl \
348 gnu/system/examples/vm-image.tmpl
349
350 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
351
352 nobase_dist_guilemodule_DATA = \
353 guix/store/schema.sql \
354 $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
355 $(MISC_DISTRO_FILES)
356 nobase_nodist_guilemodule_DATA = guix/config.scm
357 nobase_nodist_guileobject_DATA = $(GOBJECTS)
358
359 # Handy way to remove the .go files without removing all the rest.
360 clean-go:
361 -$(RM) -f $(GOBJECTS)
362 @find . -path ./test-tmp -prune -o -name '*.go' -print | \
363 if test -t 1; then \
364 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
365 else \
366 xargs -r echo "warning: stray .go files:"; \
367 fi
368
369
370 # Test extensions; has to be unconditional.
371 TEST_EXTENSIONS = .scm .sh
372
373 if CAN_RUN_TESTS
374
375 SCM_TESTS = \
376 tests/accounts.scm \
377 tests/base16.scm \
378 tests/base32.scm \
379 tests/base64.scm \
380 tests/bournish.scm \
381 tests/builders.scm \
382 tests/build-utils.scm \
383 tests/cache.scm \
384 tests/challenge.scm \
385 tests/channels.scm \
386 tests/combinators.scm \
387 tests/containers.scm \
388 tests/cpan.scm \
389 tests/cpio.scm \
390 tests/cran.scm \
391 tests/crate.scm \
392 tests/cve.scm \
393 tests/debug-link.scm \
394 tests/derivations.scm \
395 tests/discovery.scm \
396 tests/elpa.scm \
397 tests/file-systems.scm \
398 tests/gem.scm \
399 tests/gexp.scm \
400 tests/git.scm \
401 tests/glob.scm \
402 tests/gnu-maintenance.scm \
403 tests/grafts.scm \
404 tests/graph.scm \
405 tests/gremlin.scm \
406 tests/hackage.scm \
407 tests/import-utils.scm \
408 tests/inferior.scm \
409 tests/lint.scm \
410 tests/lzlib.scm \
411 tests/modules.scm \
412 tests/monads.scm \
413 tests/nar.scm \
414 tests/networking.scm \
415 tests/opam.scm \
416 tests/packages.scm \
417 tests/pack.scm \
418 tests/pki.scm \
419 tests/print.scm \
420 tests/processes.scm \
421 tests/profiles.scm \
422 tests/publish.scm \
423 tests/pypi.scm \
424 tests/records.scm \
425 tests/scripts.scm \
426 tests/scripts-build.scm \
427 tests/search-paths.scm \
428 tests/services.scm \
429 tests/sets.scm \
430 tests/size.scm \
431 tests/snix.scm \
432 tests/status.scm \
433 tests/store-database.scm \
434 tests/store-deduplication.scm \
435 tests/store-roots.scm \
436 tests/store.scm \
437 tests/substitute.scm \
438 tests/swh.scm \
439 tests/syscalls.scm \
440 tests/system.scm \
441 tests/texlive.scm \
442 tests/ui.scm \
443 tests/union.scm \
444 tests/upstream.scm \
445 tests/utils.scm \
446 tests/uuid.scm \
447 tests/workers.scm \
448 tests/zlib.scm
449
450 SH_TESTS = \
451 tests/guix-build.sh \
452 tests/guix-build-branch.sh \
453 tests/guix-download.sh \
454 tests/guix-gc.sh \
455 tests/guix-hash.sh \
456 tests/guix-pack.sh \
457 tests/guix-pack-localstatedir.sh \
458 tests/guix-pack-relocatable.sh \
459 tests/guix-package.sh \
460 tests/guix-package-aliases.sh \
461 tests/guix-package-net.sh \
462 tests/guix-system.sh \
463 tests/guix-archive.sh \
464 tests/guix-authenticate.sh \
465 tests/guix-environment.sh \
466 tests/guix-environment-container.sh \
467 tests/guix-graph.sh \
468 tests/guix-describe.sh \
469 tests/guix-lint.sh
470
471 TESTS = $(SCM_TESTS) $(SH_TESTS)
472
473 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
474
475 SCM_LOG_DRIVER = \
476 $(top_builddir)/test-env --quiet-stderr \
477 $(GUILE) --no-auto-compile -e main \
478 $(top_srcdir)/build-aux/test-driver.scm
479
480 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
481
482 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
483 AM_SH_LOG_FLAGS = -x -e
484
485 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
486 # could end up removing files from the store while they are being used by
487 # other instances of the daemon.
488 tests/guix-gc.log: \
489 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
490 $(SCM_TESTS:%.scm=%.log)
491
492 else !CAN_RUN_TESTS
493
494 TESTS =
495 SH_TESTS =
496 SCM_TESTS =
497
498 # Automake always generates a 'check' target, so better not override it.
499 check-local:
500 @echo
501 @echo "Cannot run tests because file name limits would be exceeded." >&2
502 @echo "Look for 'length' in the 'config.log' file for details." >&2
503 @echo
504 @exit 1
505
506 endif !CAN_RUN_TESTS
507
508 check-system: $(GOBJECTS)
509 $(AM_V_at)$(top_builddir)/pre-inst-env \
510 $(GUILE) --no-auto-compile \
511 -e '(@@ (run-system-tests) run-system-tests)' \
512 $(top_srcdir)/build-aux/run-system-tests.scm
513
514 # Public keys used to sign substitutes.
515 dist_pkgdata_DATA = \
516 etc/substitutes/berlin.guixsd.org.pub \
517 etc/substitutes/ci.guix.gnu.org.pub \
518 etc/substitutes/ci.guix.info.pub
519
520 # Bash completion file.
521 dist_bashcompletion_DATA = etc/completion/bash/guix \
522 etc/completion/bash/guix-daemon
523
524 # Zsh completion file.
525 dist_zshcompletion_DATA = etc/completion/zsh/_guix
526
527 # Fish completion file.
528 dist_fishcompletion_DATA = etc/completion/fish/guix.fish
529
530 # SELinux policy
531 dist_selinux_policy_DATA = etc/guix-daemon.cil
532
533 EXTRA_DIST += \
534 HACKING \
535 ROADMAP \
536 TODO \
537 CODE-OF-CONDUCT \
538 .dir-locals.el \
539 .guix-channel \
540 scripts/guix.in \
541 etc/guix-install.sh \
542 etc/news.scm \
543 build-aux/build-self.scm \
544 build-aux/compile-all.scm \
545 build-aux/hydra/evaluate.scm \
546 build-aux/hydra/gnu-system.scm \
547 build-aux/hydra/guix.scm \
548 build-aux/hydra/guix-modular.scm \
549 build-aux/cuirass/gnu-system.scm \
550 build-aux/cuirass/guix-modular.scm \
551 build-aux/cuirass/hydra-to-cuirass.scm \
552 build-aux/check-available-binaries.scm \
553 build-aux/check-final-inputs-self-contained.scm \
554 build-aux/compile-as-derivation.scm \
555 build-aux/generate-authors.scm \
556 build-aux/test-driver.scm \
557 build-aux/update-guix-package.scm \
558 build-aux/update-NEWS.scm \
559 build-aux/run-system-tests.scm \
560 d3.v3.js \
561 graph.js \
562 tests/test.drv \
563 tests/signing-key.pub \
564 tests/signing-key.sec \
565 tests/cve-sample.json \
566 build-aux/config.rpath \
567 bootstrap \
568 doc/build.scm \
569 $(TESTS)
570
571 if !BUILD_DAEMON_OFFLOAD
572
573 EXTRA_DIST += \
574 guix/scripts/offload.scm
575
576 endif !BUILD_DAEMON_OFFLOAD
577
578
579 CLEANFILES = \
580 $(bin_SCRIPTS) \
581 $(GOBJECTS) \
582 $(SCM_TESTS:tests/%.scm=%.log)
583
584 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
585 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
586 # there that are newer than the local .scm files (for instance because the
587 # user ran 'make install' recently). When that happens, we end up loading
588 # those previously-installed .go files, which may be stale, thereby breaking
589 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
590 # stale files from ~/.cache/guile/ccache.
591 %.go: make-go ; @:
592 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
593 $(AM_V_at)echo "Compiling Scheme modules..." ; \
594 unset GUILE_LOAD_COMPILED_PATH ; \
595 XDG_CACHE_HOME=/nowhere \
596 host=$(host) srcdir="$(top_srcdir)" \
597 $(top_builddir)/pre-inst-env \
598 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
599 --no-auto-compile \
600 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
601
602 SUFFIXES = .go
603
604 # Make sure source files are installed first, so that the mtime of
605 # installed compiled files is greater than that of installed source
606 # files. See
607 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
608 # for details.
609 guix_install_go_files = install-nobase_nodist_guileobjectDATA
610 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
611
612 # The above trick doesn't work for 'config.go' because both 'config.scm' and
613 # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
614 # special treatment.
615 install-data-hook:
616 touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
617
618 # Assuming Guix is already installed and the daemon is up and running, this
619 # rule builds from $(srcdir), creating and building derivations.
620 as-derivation:
621 $(AM_V_at)echo "Building Guix in Guix..." ; \
622 $(GUILE) --no-auto-compile \
623 "$(top_srcdir)/build-aux/compile-as-derivation.scm" \
624 "$(abs_top_srcdir)"
625
626 SUBDIRS = po/guix po/packages
627 BUILT_SOURCES =
628
629 include doc/local.mk
630
631 if BUILD_DAEMON
632
633 include nix/local.mk
634
635 endif BUILD_DAEMON
636
637 ACLOCAL_AMFLAGS = -I m4
638
639 # Pass an explicit '--localstatedir' so that configure does not error out if
640 # it finds an existing installation with a different localstatedir. Inherit
641 # 'ac_cv_guix_test_root' so that "make check" in $(distdir) does not have to
642 # repopulate the whole store, and to make sure $(GUIX_TEST_ROOT) is short
643 # enough for shebangs.
644 AM_DISTCHECK_CONFIGURE_FLAGS = \
645 --localstatedir="$$dc_install_base/var" \
646 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
647 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
648 --with-nix-prefix="$(NIX_PREFIX)" \
649 --enable-daemon \
650 ac_cv_guix_test_root="$(GUIX_TEST_ROOT)"
651
652 # The self-contained tarball.
653 guix-binary.%.tar.xz:
654 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
655 tarball=`$(top_builddir)/pre-inst-env guix pack -K -C xz \
656 -s "$*" --localstatedir --profile-name=current-guix guix` ; \
657 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
658
659
660 dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
661 dist-hook: assert-no-store-file-names
662 dist-hook: doc-po-update
663
664 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
665
666 EXTRA_DIST += $(top_srcdir)/.version
667 BUILT_SOURCES += $(top_srcdir)/.version
668 $(top_srcdir)/.version:
669 echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
670
671 gen-tarball-version:
672 echo $(VERSION) > "$(distdir)/.tarball-version"
673
674 gen-ChangeLog:
675 $(AM_V_GEN)if test -d .git; then \
676 $(top_srcdir)/build-aux/gitlog-to-changelog \
677 > $(distdir)/ChangeLog.tmp; \
678 rm -f $(distdir)/ChangeLog; \
679 mv $(distdir)/ChangeLog.tmp $(distdir)/ChangeLog; \
680 fi
681
682 gen-AUTHORS:
683 $(AM_V_GEN)if test -d .git; then \
684 rm -f "$(distdir)/AUTHORS"; \
685 $(top_builddir)/pre-inst-env "$(GUILE)" \
686 "$(top_srcdir)/build-aux/generate-authors.scm" \
687 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
688 fi
689
690 \f
691 #
692 # Release management.
693 #
694
695 releasedir = release-$(PACKAGE_VERSION)
696
697 PACKAGE_FULL_TARNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
698
699 # List of source tarballs produced. This must be kept in sync with the
700 # 'dist-' options of 'AM_INIT_AUTOMAKE' in 'configure.ac'.
701 SOURCE_TARBALLS = \
702 $(foreach ext,tar.gz,$(PACKAGE_FULL_TARNAME).$(ext))
703
704 # Systems supported by Guix.
705 SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux armhf-linux aarch64-linux
706
707 # Guix binary tarballs.
708 BINARY_TARBALLS = \
709 $(foreach system,$(SUPPORTED_SYSTEMS),guix-binary.$(system).tar.xz)
710
711 # Systems supported by Guix System.
712 GUIX_SYSTEM_SUPPORTED_SYSTEMS ?= x86_64-linux i686-linux
713
714 # Systems for which we build Guix VMs.
715 GUIX_SYSTEM_VM_SYSTEMS ?= x86_64-linux
716
717 # Prefix of the Guix installation image file name.
718 GUIX_SYSTEM_IMAGE_BASE = guix-system-install-$(PACKAGE_VERSION)
719
720 # Prefix of the Guix VM image file name.
721 GUIX_SYSTEM_VM_IMAGE_BASE = guix-system-vm-image-$(PACKAGE_VERSION)
722
723 # Flags for 'guix system vm-image'. By default create a VM image that appears
724 # to have a 20G hard disk.
725 GUIX_SYSTEM_VM_IMAGE_FLAGS ?= --image-size=30G
726
727 # Return the sequence of '-s' flags for the given systems.
728 system_flags = $(foreach system,$(1),-s $(system))
729
730 # The release process works in several phases:
731 #
732 # 0. We assume the developer created a 'vX.Y' tag.
733 # 1. Build the source tarball.
734 # 2. Update the 'guix' package so that it corresponds to the 'vX.Y' tag.
735 # 3. Build the binary tarballs for that 'guix' package.
736 # 4. Update the 'guix' package again.
737 # 5. Build the installation images. The images will run 'guix'
738 # corresponding to 'vX.Y' + 1 commit, and they will install 'vX.Y'.
739 #
740 # This 'release' target takes care of everything and copies the resulting
741 # files to $(releasedir).
742 #
743 # XXX: Depend on 'dist' rather than 'distcheck' to work around the Gettext
744 # issue described at <https://savannah.gnu.org/bugs/index.php?51027>.
745 release: dist
746 cd po; git checkout .
747 @if ! git diff-index --quiet HEAD; then \
748 echo "There are uncommitted changes; stopping." >&2 ; \
749 exit 1 ; \
750 fi
751 $(MKDIR_P) "$(releasedir)"
752 rm -f "$(releasedir)"/*
753 mv $(SOURCE_TARBALLS) "$(releasedir)"
754 $(top_builddir)/pre-inst-env "$(GUILE)" \
755 $(top_srcdir)/build-aux/update-guix-package.scm \
756 "`git rev-parse HEAD`" "$(PACKAGE_VERSION)"
757 git add $(top_srcdir)/gnu/packages/package-management.scm
758 git commit -m "gnu: guix: Update to $(PACKAGE_VERSION)."
759 $(top_builddir)/pre-inst-env guix build guix \
760 $(call system_flags,$(SUPPORTED_SYSTEMS)) \
761 -v1 --no-grafts -K
762 rm -f $(BINARY_TARBALLS)
763 $(MAKE) $(BINARY_TARBALLS)
764 for system in $(SUPPORTED_SYSTEMS) ; do \
765 mv "guix-binary.$$system.tar.xz" \
766 "$(releasedir)/guix-binary-$(PACKAGE_VERSION).$$system.tar.xz" ; \
767 done
768 $(top_builddir)/pre-inst-env "$(GUILE)" \
769 $(top_srcdir)/build-aux/update-guix-package.scm \
770 "`git rev-parse HEAD`"
771 git add $(top_srcdir)/gnu/packages/package-management.scm
772 git commit -m "gnu: guix: Update to `git rev-parse HEAD | cut -c1-7`."
773 $(top_builddir)/pre-inst-env guix build guix \
774 $(call system_flags,$(GUIX_SYSTEM_SUPPORTED_SYSTEMS)) \
775 -v1 --no-grafts -K
776 for system in $(GUIX_SYSTEM_SUPPORTED_SYSTEMS) ; do \
777 image=`$(top_builddir)/pre-inst-env \
778 guix system disk-image \
779 --file-system-type=iso9660 \
780 --system=$$system \
781 gnu/system/install.scm` ; \
782 if [ ! -f "$$image" ] ; then \
783 echo "failed to produced Guix installation image for $$system" >&2 ; \
784 exit 1 ; \
785 fi ; \
786 xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" ; \
787 mv "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz.tmp" \
788 "$(releasedir)/$(GUIX_SYSTEM_IMAGE_BASE).$$system.iso.xz" ; \
789 done
790 for system in $(GUIX_SYSTEM_VM_SYSTEMS) ; do \
791 image=`$(top_builddir)/pre-inst-env \
792 guix system vm-image $(GUIX_SYSTEM_VM_IMAGE_FLAGS) \
793 --system=$$system \
794 gnu/system/examples/vm-image.tmpl` ; \
795 if [ ! -f "$$image" ] ; then \
796 echo "failed to produced Guix VM image for $$system" >&2 ; \
797 exit 1 ; \
798 fi ; \
799 xz < "$$image" > "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" ; \
800 mv "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz.tmp" \
801 "$(releasedir)/$(GUIX_SYSTEM_VM_IMAGE_BASE).$$system.xz" ; \
802 done
803 @echo
804 @echo "Congratulations! All the release files are now in $(releasedir)."
805 @echo
806
807 update-guix-package:
808 git rev-parse HEAD
809 $(top_builddir)/pre-inst-env "$(GUILE)" \
810 $(top_srcdir)/build-aux/update-guix-package.scm \
811 "`git rev-parse HEAD`"
812
813 # Location of a checkout of <git://git.savannah.gnu.org/guix/maintenance.git>.
814 # Package data from this checkout is used by 'update-NEWS.scm'.
815 GUIX_MAINTENANCE_DIRECTORY ?= $(top_srcdir)/../guix-maintenance
816
817 update-NEWS: $(GOBJECTS)
818 $(top_builddir)/pre-inst-env "$(GUILE)" \
819 $(top_srcdir)/build-aux/update-NEWS.scm \
820 $(top_srcdir)/NEWS "$(GUIX_MAINTENANCE_DIRECTORY)/data"
821
822 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
823 assert-no-store-file-names:
824 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
825 --exclude=*.info-[0-9] --exclude=*.dot \
826 --exclude=*.eps --exclude-dir=bootstrap \
827 --exclude=guix-manual.pot --exclude=guix-manual.*.po \
828 --exclude=guix-cookbook.pot --exclude=guix-cookbook.*.po \
829 --exclude=guix-prettify.el \
830 --exclude=ChangeLog* \
831 --exclude=binutils-boot-2.20*.patch \
832 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
833 then \
834 echo "error: store file names embedded in the distribution" >&2 ; \
835 exit 1 ; \
836 fi
837
838 # Make sure important substitutes are available.
839 assert-binaries-available: $(GOBJECTS)
840 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
841 "$(top_srcdir)/build-aux/check-available-binaries.scm"
842
843 # Make sure the final inputs don't refer to bootstrap tools.
844 assert-final-inputs-self-contained: $(GOBJECTS)
845 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
846 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
847
848 # Compute the Hydra jobs and write them in the target file.
849 hydra-jobs.scm: $(GOBJECTS)
850 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
851 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
852 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
853 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
854 $(AM_V_at)mv "$@.tmp" "$@"
855
856 # Compute the Cuirass jobs and write them in the target file.
857 cuirass-jobs.scm: $(GOBJECTS)
858 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
859 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
860 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
861 "$(top_srcdir)/build-aux/cuirass/gnu-system.scm" \
862 cuirass > "$@.tmp"
863 $(AM_V_at)mv "$@.tmp" "$@"
864
865 .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
866 .PHONY: assert-no-store-file-names assert-binaries-available
867 .PHONY: assert-final-inputs-self-contained
868 .PHONY: clean-go make-go as-derivation
869 .PHONY: update-guix-package update-NEWS release
870
871 # Downloading up-to-date PO files.
872
873 # make-download-po-rule DOMAIN DIRECTORY [FILE-NAME-PREFIX]
874 define make-download-po-rule
875
876 download-po.$(1):
877 if [ -f "$(top_srcdir)/$(2)/LINGUAS" ]; then \
878 LINGUAS="`grep -v '^[[:blank:]]*#' < $(top_srcdir)/$(2)/LINGUAS`" ; \
879 else \
880 LINGUAS="`(cd $(top_srcdir)/$(2); \
881 for i in *.po; do echo $$$$i; done) | cut -d . -f 2`" ; \
882 fi ; \
883 for lang in $$$$LINGUAS; do \
884 if wget -nv -O "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" \
885 "https://translationproject.org/latest/$(1)/$$$$lang.po" ; \
886 then \
887 mv "$(top_srcdir)/$(2)/$(3)$$$$lang.po"{.tmp,} ; \
888 else \
889 rm "$(top_srcdir)/$(2)/$(3)$$$$lang.po.tmp" ; \
890 fi ; \
891 done
892
893 .PHONY: download-po.$(1)
894
895 endef
896
897 $(eval $(call make-download-po-rule,guix,po/guix))
898 $(eval $(call make-download-po-rule,guix-packages,po/packages))
899 $(eval $(call make-download-po-rule,guix-manual,po/doc,guix-manual.))
900
901 download-po: $(foreach domain,guix guix-packages guix-manual,download-po.$(domain))
902 .PHONY: download-po
903
904 ## -------------- ##
905 ## Silent rules. ##
906 ## -------------- ##
907
908 AM_V_DL = $(AM_V_DL_$(V))
909 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
910 AM_V_DL_0 = @echo " DL " $@;
911
912 AM_V_DOT = $(AM_V_DOT_$(V))
913 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
914 AM_V_DOT_0 = @echo " DOT " $@;
915
916 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
917 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
918 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;
919
920 AM_V_PO4A = $(AM_V_PO4A_$(V))
921 AM_V_PO4A_ = $(AM_V_PO4A_$(AM_DEFAULT_VERBOSITY))
922 AM_V_PO4A_0 = @echo " PO4A" $@;
923
924 AM_V_POXREF = $(AM_V_POXREF_$(V))
925 AM_V_POXREF_ = $(AM_V_POXREF_$(AM_DEFAULT_VERBOSITY))
926 AM_V_POXREF_0 = @echo " POXREF" $@;