projects/guix·blob version-0.10.0 · refs

512 lines · 14.0 KiB

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