projects/guix·blob v0.8 · refs

343 lines · 9.3 KiB

1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013, 2014 Ludovic Courtès <[email protected]>
3# Copyright © 2013 Andreas Enge <[email protected]>
4#
5# This file is part of GNU Guix.
6#
7# GNU Guix is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or (at
10# your option) any later version.
11#
12# GNU Guix is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20bin_SCRIPTS = \
21 scripts/guix
22
23nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27include gnu-system.am
28
29MODULES = \
30 guix/base32.scm \
31 guix/base64.scm \
32 guix/records.scm \
33 guix/hash.scm \
34 guix/pk-crypto.scm \
35 guix/pki.scm \
36 guix/utils.scm \
37 guix/download.scm \
38 guix/git-download.scm \
39 guix/monads.scm \
40 guix/monad-repl.scm \
41 guix/gexp.scm \
42 guix/profiles.scm \
43 guix/serialization.scm \
44 guix/nar.scm \
45 guix/derivations.scm \
46 guix/gnu-maintenance.scm \
47 guix/licenses.scm \
48 guix/build-system.scm \
49 guix/build-system/cmake.scm \
50 guix/build-system/glib-or-gtk.scm \
51 guix/build-system/gnu.scm \
52 guix/build-system/perl.scm \
53 guix/build-system/python.scm \
54 guix/build-system/ruby.scm \
55 guix/build-system/trivial.scm \
56 guix/ftp-client.scm \
57 guix/http-client.scm \
58 guix/gnupg.scm \
59 guix/store.scm \
60 guix/svn-download.scm \
61 guix/ui.scm \
62 guix/build/download.scm \
63 guix/build/cmake-build-system.scm \
64 guix/build/git.scm \
65 guix/build/glib-or-gtk-build-system.scm \
66 guix/build/gnu-build-system.scm \
67 guix/build/gnu-dist.scm \
68 guix/build/perl-build-system.scm \
69 guix/build/python-build-system.scm \
70 guix/build/ruby-build-system.scm \
71 guix/build/store-copy.scm \
72 guix/build/utils.scm \
73 guix/build/union.scm \
74 guix/build/pull.scm \
75 guix/build/rpath.scm \
76 guix/build/svn.scm \
77 guix/build/syscalls.scm \
78 guix/build/emacs-utils.scm \
79 guix/build/graft.scm \
80 guix/packages.scm \
81 guix/import/utils.scm \
82 guix/import/gnu.scm \
83 guix/import/snix.scm \
84 guix/scripts/download.scm \
85 guix/scripts/build.scm \
86 guix/scripts/archive.scm \
87 guix/scripts/import.scm \
88 guix/scripts/package.scm \
89 guix/scripts/gc.scm \
90 guix/scripts/hash.scm \
91 guix/scripts/pull.scm \
92 guix/scripts/substitute-binary.scm \
93 guix/scripts/authenticate.scm \
94 guix/scripts/refresh.scm \
95 guix/scripts/system.scm \
96 guix/scripts/lint.scm \
97 guix/scripts/import/gnu.scm \
98 guix/scripts/import/nix.scm \
99 guix/scripts/environment.scm \
100 guix.scm \
101 $(GNU_SYSTEM_MODULES)
102
103if BUILD_DAEMON_OFFLOAD
104
105MODULES += \
106 guix/scripts/offload.scm
107
108endif BUILD_DAEMON_OFFLOAD
109
110# Internal module with test suite support.
111dist_noinst_DATA = guix/tests.scm
112
113# Because of the autoload hack in (guix build download), we must build it
114# first to avoid errors on systems where (gnutls) is unavailable.
115guix/scripts/download.go: guix/build/download.go
116guix/download.go: guix/build/download.go
117
118# Linux-Libre configurations.
119KCONFIGS = \
120 gnu/packages/linux-libre-i686.conf \
121 gnu/packages/linux-libre-x86_64.conf
122
123# Templates, examples.
124EXAMPLES = \
125 gnu/system/os-config.tmpl
126
127GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
128
129nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
130nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
131
132# Do we need to provide our own non-broken (srfi srfi-37) module?
133if INSTALL_SRFI_37
134
135nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
136GOBJECTS += srfi/srfi-37.go
137
138srfi/srfi-37.scm: srfi/srfi-37.scm.in
139 $(MKDIR_P) srfi
140 cp "$<" "$@"
141
142endif INSTALL_SRFI_37
143
144# Handy way to remove the .go files without removing all the rest.
145clean-go:
146 -$(RM) -f $(GOBJECTS)
147
148
149SCM_TESTS = \
150 tests/base32.scm \
151 tests/base64.scm \
152 tests/hash.scm \
153 tests/pk-crypto.scm \
154 tests/pki.scm \
155 tests/substitute-binary.scm \
156 tests/builders.scm \
157 tests/derivations.scm \
158 tests/ui.scm \
159 tests/records.scm \
160 tests/utils.scm \
161 tests/build-utils.scm \
162 tests/packages.scm \
163 tests/snix.scm \
164 tests/store.scm \
165 tests/monads.scm \
166 tests/gexp.scm \
167 tests/nar.scm \
168 tests/union.scm \
169 tests/profiles.scm \
170 tests/syscalls.scm \
171 tests/lint.scm
172
173if HAVE_GUILE_JSON
174
175MODULES += \
176 guix/import/pypi.scm \
177 guix/scripts/import/pypi.scm
178
179SCM_TESTS += tests/pypi.scm
180
181endif
182
183SH_TESTS = \
184 tests/guix-build.sh \
185 tests/guix-download.sh \
186 tests/guix-gc.sh \
187 tests/guix-hash.sh \
188 tests/guix-package.sh \
189 tests/guix-system.sh \
190 tests/guix-archive.sh \
191 tests/guix-authenticate.sh \
192 tests/guix-lint.sh
193
194if BUILD_DAEMON
195
196SH_TESTS += tests/guix-register.sh
197
198endif BUILD_DAEMON
199
200
201TESTS = $(SCM_TESTS) $(SH_TESTS)
202
203TEST_EXTENSIONS = .scm .sh
204
205AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
206
207SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
208AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
209
210SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
211AM_SH_LOG_FLAGS = -x -e
212
213# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
214# could end up removing files from the store while they are being used by
215# other instances of the daemon.
216tests/guix-gc.log: \
217 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
218 $(SCM_TESTS:%.scm=%.log)
219
220# Public key used to sign substitutes from hydra.gnu.org.
221dist_pkgdata_DATA = hydra.gnu.org.pub
222
223EXTRA_DIST = \
224 HACKING \
225 ROADMAP \
226 TODO \
227 .dir-locals.el \
228 build-aux/build-self.scm \
229 build-aux/hydra/gnu-system.scm \
230 build-aux/hydra/demo-os.scm \
231 build-aux/hydra/guix.scm \
232 build-aux/check-available-binaries.scm \
233 build-aux/check-final-inputs-self-contained.scm \
234 build-aux/download.scm \
235 build-aux/list-packages.scm \
236 build-aux/sync-descriptions.scm \
237 srfi/srfi-37.scm.in \
238 srfi/srfi-64.scm \
239 srfi/srfi-64.upstream.scm \
240 tests/test.drv \
241 tests/signing-key.pub \
242 tests/signing-key.sec \
243 build-aux/config.rpath \
244 bootstrap \
245 release.nix \
246 $(TESTS)
247
248if !BUILD_DAEMON_OFFLOAD
249
250EXTRA_DIST += \
251 guix/scripts/offload.scm
252
253endif !BUILD_DAEMON_OFFLOAD
254
255
256CLEANFILES = \
257 $(GOBJECTS) \
258 $(SCM_TESTS:tests/%.scm=%.log)
259
260AM_V_GUILEC = $(AM_V_GUILEC_$(V))
261AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
262AM_V_GUILEC_0 = @echo " GUILEC" $@;
263
264# XXX: Use the C locale for when Guile lacks
265# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
266.scm.go:
267 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
268 LC_ALL=C \
269 $(top_builddir)/pre-inst-env \
270 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
271 -Wformat -Wunbound-variable -Warity-mismatch \
272 --target="$(host)" \
273 -o "$@" "$<"
274
275SUFFIXES = .go
276
277# Make sure source files are installed first, so that the mtime of
278# installed compiled files is greater than that of installed source
279# files. See
280# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
281# for details.
282guix_install_go_files = install-nobase_nodist_guilemoduleDATA
283$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
284
285SUBDIRS = po/guix po/packages
286BUILT_SOURCES =
287
288include doc.am
289
290if BUILD_DAEMON
291
292include daemon.am
293
294endif BUILD_DAEMON
295
296ACLOCAL_AMFLAGS = -I m4
297AM_DISTCHECK_CONFIGURE_FLAGS = \
298 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
299 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
300 --with-nix-prefix="$(NIX_PREFIX)" \
301 --enable-daemon
302
303dist_emacsui_DATA = emacs/guix-main.scm
304nodist_emacsui_DATA = emacs/guix-helper.scm
305include emacs.am
306
307dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
308distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
309
310sync-descriptions:
311 -$(top_builddir)/pre-inst-env $(GUILE) \
312 $(top_srcdir)/build-aux/sync-descriptions.scm
313
314gen-ChangeLog:
315 if test -d .git; then \
316 $(top_srcdir)/build-aux/gitlog-to-changelog \
317 > $(distdir)/cl-t; \
318 rm -f $(distdir)/ChangeLog; \
319 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
320 fi
321
322# Make sure we're not shipping a file that embeds a local /gnu/store file name.
323assert-no-store-file-names:
324 if grep -r --exclude=*.texi --exclude=*.info \
325 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
326 then \
327 echo "error: store file names embedded in the distribution" >&2 ; \
328 exit 1 ; \
329 fi
330
331# Make sure hydra.gnu.org has the important binaries.
332assert-binaries-available:
333 $(top_builddir)/pre-inst-env "$(GUILE)" \
334 "$(top_srcdir)/build-aux/check-available-binaries.scm"
335
336# Make sure the final inputs don't refer to bootstrap tools.
337assert-final-inputs-self-contained:
338 $(top_builddir)/pre-inst-env "$(GUILE)" \
339 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
340
341.PHONY: sync-descriptions gen-ChangeLog clean-go
342.PHONY: assert-no-store-file-names assert-binaries-available
343.PHONY: assert-final-inputs-self-contained