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