system: grub: Search root device by label or UUID if possible.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015 Alex Kost <alezost@gmail.com>
5 #
6 # This file is part of GNU Guix.
7 #
8 # GNU Guix is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
12 #
13 # GNU Guix is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 bin_SCRIPTS = \
22 scripts/guix
23
24 nodist_noinst_SCRIPTS = \
25 pre-inst-env \
26 test-env
27
28 include gnu-system.am
29
30 MODULES = \
31 guix/base32.scm \
32 guix/base64.scm \
33 guix/cpio.scm \
34 guix/records.scm \
35 guix/gcrypt.scm \
36 guix/hash.scm \
37 guix/pk-crypto.scm \
38 guix/pki.scm \
39 guix/utils.scm \
40 guix/sets.scm \
41 guix/download.scm \
42 guix/git-download.scm \
43 guix/monads.scm \
44 guix/monad-repl.scm \
45 guix/gexp.scm \
46 guix/profiles.scm \
47 guix/serialization.scm \
48 guix/nar.scm \
49 guix/derivations.scm \
50 guix/gnu-maintenance.scm \
51 guix/upstream.scm \
52 guix/licenses.scm \
53 guix/graph.scm \
54 guix/cve.scm \
55 guix/build-system.scm \
56 guix/build-system/cmake.scm \
57 guix/build-system/emacs.scm \
58 guix/build-system/glib-or-gtk.scm \
59 guix/build-system/gnu.scm \
60 guix/build-system/haskell.scm \
61 guix/build-system/perl.scm \
62 guix/build-system/python.scm \
63 guix/build-system/waf.scm \
64 guix/build-system/r.scm \
65 guix/build-system/ruby.scm \
66 guix/build-system/trivial.scm \
67 guix/ftp-client.scm \
68 guix/http-client.scm \
69 guix/gnupg.scm \
70 guix/elf.scm \
71 guix/store.scm \
72 guix/cvs-download.scm \
73 guix/svn-download.scm \
74 guix/ui.scm \
75 guix/build/download.scm \
76 guix/build/cmake-build-system.scm \
77 guix/build/emacs-build-system.scm \
78 guix/build/git.scm \
79 guix/build/glib-or-gtk-build-system.scm \
80 guix/build/gnu-build-system.scm \
81 guix/build/gnu-dist.scm \
82 guix/build/perl-build-system.scm \
83 guix/build/python-build-system.scm \
84 guix/build/r-build-system.scm \
85 guix/build/ruby-build-system.scm \
86 guix/build/waf-build-system.scm \
87 guix/build/haskell-build-system.scm \
88 guix/build/store-copy.scm \
89 guix/build/utils.scm \
90 guix/build/union.scm \
91 guix/build/profiles.scm \
92 guix/build/pull.scm \
93 guix/build/rpath.scm \
94 guix/build/cvs.scm \
95 guix/build/svn.scm \
96 guix/build/gremlin.scm \
97 guix/build/emacs-utils.scm \
98 guix/build/graft.scm \
99 guix/search-paths.scm \
100 guix/packages.scm \
101 guix/import/utils.scm \
102 guix/import/gnu.scm \
103 guix/import/snix.scm \
104 guix/import/cabal.scm \
105 guix/import/cran.scm \
106 guix/import/hackage.scm \
107 guix/import/elpa.scm \
108 guix/scripts.scm \
109 guix/scripts/download.scm \
110 guix/scripts/build.scm \
111 guix/scripts/archive.scm \
112 guix/scripts/import.scm \
113 guix/scripts/package.scm \
114 guix/scripts/gc.scm \
115 guix/scripts/hash.scm \
116 guix/scripts/pull.scm \
117 guix/scripts/substitute.scm \
118 guix/scripts/authenticate.scm \
119 guix/scripts/refresh.scm \
120 guix/scripts/system.scm \
121 guix/scripts/lint.scm \
122 guix/scripts/challenge.scm \
123 guix/scripts/import/cran.scm \
124 guix/scripts/import/gnu.scm \
125 guix/scripts/import/nix.scm \
126 guix/scripts/import/hackage.scm \
127 guix/scripts/import/elpa.scm \
128 guix/scripts/environment.scm \
129 guix/scripts/publish.scm \
130 guix/scripts/edit.scm \
131 guix/scripts/size.scm \
132 guix/scripts/graph.scm \
133 guix/scripts/container.scm \
134 guix/scripts/container/exec.scm \
135 guix.scm \
136 $(GNU_SYSTEM_MODULES)
137
138 if HAVE_GUILE_JSON
139
140 MODULES += \
141 guix/import/json.scm \
142 guix/import/pypi.scm \
143 guix/scripts/import/pypi.scm \
144 guix/import/cpan.scm \
145 guix/scripts/import/gem.scm \
146 guix/import/gem.scm
147
148 endif
149
150 if BUILD_SYSCALLS_MODULE
151
152 MODULES += \
153 guix/build/syscalls.scm
154
155 endif
156
157 if BUILD_DAEMON_OFFLOAD
158
159 MODULES += \
160 guix/scripts/offload.scm
161
162 endif BUILD_DAEMON_OFFLOAD
163
164 # Internal module with test suite support.
165 dist_noinst_DATA = guix/tests.scm
166
167 # Linux-Libre configurations.
168 KCONFIGS = \
169 gnu/packages/linux-libre-i686.conf \
170 gnu/packages/linux-libre-x86_64.conf
171
172 # Templates, examples.
173 EXAMPLES = \
174 gnu/system/examples/bare-bones.tmpl \
175 gnu/system/examples/desktop.tmpl
176
177 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
178
179 nobase_dist_guilemodule_DATA = \
180 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
181 $(MISC_DISTRO_FILES)
182 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
183
184 # Do we need to provide our own non-broken (srfi srfi-37) module?
185 if INSTALL_SRFI_37
186
187 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
188 GOBJECTS += srfi/srfi-37.go
189
190 srfi/srfi-37.scm: srfi/srfi-37.scm.in
191 $(MKDIR_P) srfi
192 cp "$<" "$@"
193
194 endif INSTALL_SRFI_37
195
196 # Handy way to remove the .go files without removing all the rest.
197 clean-go:
198 -$(RM) -f $(GOBJECTS)
199
200
201 # Test extensions; has to be unconditional.
202 TEST_EXTENSIONS = .scm .sh
203
204 if CAN_RUN_TESTS
205
206 SCM_TESTS = \
207 tests/base32.scm \
208 tests/base64.scm \
209 tests/cpio.scm \
210 tests/hash.scm \
211 tests/pk-crypto.scm \
212 tests/pki.scm \
213 tests/sets.scm \
214 tests/gnu-maintenance.scm \
215 tests/substitute.scm \
216 tests/builders.scm \
217 tests/derivations.scm \
218 tests/ui.scm \
219 tests/records.scm \
220 tests/utils.scm \
221 tests/build-utils.scm \
222 tests/packages.scm \
223 tests/snix.scm \
224 tests/hackage.scm \
225 tests/cran.scm \
226 tests/elpa.scm \
227 tests/store.scm \
228 tests/monads.scm \
229 tests/gexp.scm \
230 tests/nar.scm \
231 tests/union.scm \
232 tests/profiles.scm \
233 tests/syscalls.scm \
234 tests/gremlin.scm \
235 tests/lint.scm \
236 tests/publish.scm \
237 tests/scripts.scm \
238 tests/size.scm \
239 tests/graph.scm \
240 tests/challenge.scm \
241 tests/cve.scm \
242 tests/file-systems.scm \
243 tests/system.scm \
244 tests/services.scm \
245 tests/containers.scm \
246 tests/import-utils.scm
247
248 if HAVE_GUILE_JSON
249
250 SCM_TESTS += \
251 tests/pypi.scm \
252 tests/cpan.scm \
253 tests/gem.scm
254
255 endif
256
257 SH_TESTS = \
258 tests/guix-build.sh \
259 tests/guix-download.sh \
260 tests/guix-gc.sh \
261 tests/guix-hash.sh \
262 tests/guix-package.sh \
263 tests/guix-package-net.sh \
264 tests/guix-system.sh \
265 tests/guix-archive.sh \
266 tests/guix-authenticate.sh \
267 tests/guix-environment.sh \
268 tests/guix-environment-container.sh \
269 tests/guix-graph.sh \
270 tests/guix-lint.sh
271
272 if BUILD_DAEMON
273
274 SH_TESTS += tests/guix-register.sh
275
276 endif BUILD_DAEMON
277
278
279 TESTS = $(SCM_TESTS) $(SH_TESTS)
280
281 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
282
283 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
284 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
285
286 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
287 AM_SH_LOG_FLAGS = -x -e
288
289 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
290 # could end up removing files from the store while they are being used by
291 # other instances of the daemon.
292 tests/guix-gc.log: \
293 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
294 $(SCM_TESTS:%.scm=%.log)
295
296 else !CAN_RUN_TESTS
297
298 TESTS =
299 SH_TESTS =
300 SCM_TESTS =
301
302 # Automake always generates a 'check' target, so better not override it.
303 check-local:
304 @echo
305 @echo "Cannot run tests because file name limits would be exceeded." >&2
306 @echo "Look for 'length' in the 'config.log' file for details." >&2
307 @echo
308 @exit 1
309
310 endif !CAN_RUN_TESTS
311
312 # Public key used to sign substitutes from hydra.gnu.org.
313 dist_pkgdata_DATA = hydra.gnu.org.pub
314
315 # Bash completion file.
316 dist_bashcompletion_DATA = etc/completion/bash/guix
317
318 EXTRA_DIST = \
319 HACKING \
320 ROADMAP \
321 TODO \
322 CODE-OF-CONDUCT \
323 .dir-locals.el \
324 build-aux/build-self.scm \
325 build-aux/compile-all.scm \
326 build-aux/hydra/gnu-system.scm \
327 build-aux/hydra/demo-os.scm \
328 build-aux/hydra/guix.scm \
329 build-aux/check-available-binaries.scm \
330 build-aux/check-final-inputs-self-contained.scm \
331 build-aux/download.scm \
332 build-aux/make-binary-tarball.scm \
333 build-aux/generate-authors.scm \
334 srfi/srfi-37.scm.in \
335 srfi/srfi-64.scm \
336 srfi/srfi-64.upstream.scm \
337 tests/test.drv \
338 tests/signing-key.pub \
339 tests/signing-key.sec \
340 tests/cve-sample.xml \
341 build-aux/config.rpath \
342 bootstrap \
343 release.nix \
344 $(TESTS)
345
346 if !BUILD_DAEMON_OFFLOAD
347
348 EXTRA_DIST += \
349 guix/scripts/offload.scm
350
351 endif !BUILD_DAEMON_OFFLOAD
352
353 if !BUILD_SYSCALLS_MODULE
354
355 EXTRA_DIST += \
356 guix/build/syscalls.scm
357
358 endif !BUILD_SYSCALLS_MODULE
359
360
361 CLEANFILES = \
362 $(GOBJECTS) \
363 $(SCM_TESTS:tests/%.scm=%.log)
364
365 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
366 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
367 # there that are newer than the local .scm files (for instance because the
368 # user ran 'make install' recently). When that happens, we end up loading
369 # those previously-installed .go files, which may be stale, thereby breaking
370 # the whole thing.
371 %.go: make-go ; @:
372 make-go: $(MODULES) guix/config.scm guix/tests.scm
373 $(AM_V_at)echo "Compiling Scheme modules..." ; \
374 unset GUILE_LOAD_COMPILED_PATH ; \
375 host=$(host) srcdir="$(top_srcdir)" \
376 $(top_builddir)/pre-inst-env \
377 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
378 --no-auto-compile \
379 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
380
381 SUFFIXES = .go
382
383 # Make sure source files are installed first, so that the mtime of
384 # installed compiled files is greater than that of installed source
385 # files. See
386 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
387 # for details.
388 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
389 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
390
391 # The above trick doesn't work for 'config.go' because both 'config.scm' and
392 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
393 # special treatment.
394 install-data-hook: set-bootstrap-executable-permissions
395 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
396
397
398 SUBDIRS = po/guix po/packages
399 BUILT_SOURCES =
400
401 include doc.am
402
403 if BUILD_DAEMON
404
405 include daemon.am
406
407 endif BUILD_DAEMON
408
409 ACLOCAL_AMFLAGS = -I m4
410 AM_DISTCHECK_CONFIGURE_FLAGS = \
411 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
412 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
413 --with-nix-prefix="$(NIX_PREFIX)" \
414 --enable-daemon
415
416 dist_emacsui_DATA = emacs/guix-main.scm
417 nodist_emacsui_DATA = emacs/guix-helper.scm
418 include emacs.am
419
420 # The self-contained tarball.
421 guix-binary.%.tar.xz:
422 -GUIX_PACKAGE_PATH= \
423 $(top_builddir)/pre-inst-env "$(GUILE)" \
424 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
425
426
427 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
428 dist-hook: assert-no-store-file-names
429
430 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
431
432 sync-descriptions:
433 -GUIX_PACKAGE_PATH= \
434 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
435
436 gen-ChangeLog:
437 if test -d .git; then \
438 $(top_srcdir)/build-aux/gitlog-to-changelog \
439 > $(distdir)/cl-t; \
440 rm -f $(distdir)/ChangeLog; \
441 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
442 fi
443
444 gen-AUTHORS:
445 if test -d .git; then \
446 rm -f "$(distdir)/AUTHORS"; \
447 $(top_builddir)/pre-inst-env "$(GUILE)" \
448 "$(top_srcdir)/build-aux/generate-authors.scm" \
449 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
450 fi
451
452 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
453 assert-no-store-file-names:
454 if grep -r --exclude=*.texi --exclude=*.info \
455 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
456 then \
457 echo "error: store file names embedded in the distribution" >&2 ; \
458 exit 1 ; \
459 fi
460
461 # Make sure hydra.gnu.org has the important binaries.
462 assert-binaries-available:
463 $(top_builddir)/pre-inst-env "$(GUILE)" \
464 "$(top_srcdir)/build-aux/check-available-binaries.scm"
465
466 # Make sure the final inputs don't refer to bootstrap tools.
467 assert-final-inputs-self-contained:
468 $(top_builddir)/pre-inst-env "$(GUILE)" \
469 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
470
471 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
472 .PHONY: assert-no-store-file-names assert-binaries-available
473 .PHONY: assert-final-inputs-self-contained