gnu: Add getmail.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
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
20 bin_SCRIPTS = \
21 scripts/guix
22
23 nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27 include gnu-system.am
28
29 MODULES = \
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
103 if BUILD_DAEMON_OFFLOAD
104
105 MODULES += \
106 guix/scripts/offload.scm
107
108 endif BUILD_DAEMON_OFFLOAD
109
110 # Internal module with test suite support.
111 dist_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.
115 guix/scripts/download.go: guix/build/download.go
116 guix/download.go: guix/build/download.go
117
118 # Linux-Libre configurations.
119 KCONFIGS = \
120 gnu/packages/linux-libre-i686.conf \
121 gnu/packages/linux-libre-x86_64.conf
122
123 # Templates, examples.
124 EXAMPLES = \
125 gnu/system/os-config.tmpl
126
127 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
128
129 nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
130 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
131
132 # Do we need to provide our own non-broken (srfi srfi-37) module?
133 if INSTALL_SRFI_37
134
135 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
136 GOBJECTS += srfi/srfi-37.go
137
138 srfi/srfi-37.scm: srfi/srfi-37.scm.in
139 $(MKDIR_P) srfi
140 cp "$<" "$@"
141
142 endif INSTALL_SRFI_37
143
144 # Handy way to remove the .go files without removing all the rest.
145 clean-go:
146 -$(RM) -f $(GOBJECTS)
147
148
149 SCM_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
173 if HAVE_GUILE_JSON
174
175 MODULES += \
176 guix/import/pypi.scm \
177 guix/scripts/import/pypi.scm
178
179 SCM_TESTS += tests/pypi.scm
180
181 endif
182
183 SH_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
194 if BUILD_DAEMON
195
196 SH_TESTS += tests/guix-register.sh
197
198 endif BUILD_DAEMON
199
200
201 TESTS = $(SCM_TESTS) $(SH_TESTS)
202
203 TEST_EXTENSIONS = .scm .sh
204
205 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
206
207 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
208 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
209
210 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
211 AM_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.
216 tests/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.
221 dist_pkgdata_DATA = hydra.gnu.org.pub
222
223 EXTRA_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 srfi/srfi-37.scm.in \
237 srfi/srfi-64.scm \
238 srfi/srfi-64.upstream.scm \
239 tests/test.drv \
240 tests/signing-key.pub \
241 tests/signing-key.sec \
242 build-aux/config.rpath \
243 bootstrap \
244 release.nix \
245 $(TESTS)
246
247 if !BUILD_DAEMON_OFFLOAD
248
249 EXTRA_DIST += \
250 guix/scripts/offload.scm
251
252 endif !BUILD_DAEMON_OFFLOAD
253
254
255 CLEANFILES = \
256 $(GOBJECTS) \
257 $(SCM_TESTS:tests/%.scm=%.log)
258
259 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
260 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
261 AM_V_GUILEC_0 = @echo " GUILEC" $@;
262
263 # XXX: Use the C locale for when Guile lacks
264 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
265 .scm.go:
266 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
267 LC_ALL=C \
268 $(top_builddir)/pre-inst-env \
269 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
270 -Wformat -Wunbound-variable -Warity-mismatch \
271 --target="$(host)" \
272 -o "$@" "$<"
273
274 SUFFIXES = .go
275
276 # Make sure source files are installed first, so that the mtime of
277 # installed compiled files is greater than that of installed source
278 # files. See
279 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
280 # for details.
281 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
282 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
283
284 SUBDIRS = po/guix po/packages
285 BUILT_SOURCES =
286
287 include doc.am
288
289 if BUILD_DAEMON
290
291 include daemon.am
292
293 endif BUILD_DAEMON
294
295 ACLOCAL_AMFLAGS = -I m4
296 AM_DISTCHECK_CONFIGURE_FLAGS = \
297 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
298 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
299 --with-nix-prefix="$(NIX_PREFIX)" \
300 --enable-daemon
301
302 dist_emacsui_DATA = emacs/guix-main.scm
303 nodist_emacsui_DATA = emacs/guix-helper.scm
304 include emacs.am
305
306 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
307 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
308
309 sync-descriptions:
310 -$(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
311
312 gen-ChangeLog:
313 if test -d .git; then \
314 $(top_srcdir)/build-aux/gitlog-to-changelog \
315 > $(distdir)/cl-t; \
316 rm -f $(distdir)/ChangeLog; \
317 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
318 fi
319
320 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
321 assert-no-store-file-names:
322 if grep -r --exclude=*.texi --exclude=*.info \
323 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
324 then \
325 echo "error: store file names embedded in the distribution" >&2 ; \
326 exit 1 ; \
327 fi
328
329 # Make sure hydra.gnu.org has the important binaries.
330 assert-binaries-available:
331 $(top_builddir)/pre-inst-env "$(GUILE)" \
332 "$(top_srcdir)/build-aux/check-available-binaries.scm"
333
334 # Make sure the final inputs don't refer to bootstrap tools.
335 assert-final-inputs-self-contained:
336 $(top_builddir)/pre-inst-env "$(GUILE)" \
337 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
338
339 .PHONY: sync-descriptions gen-ChangeLog clean-go
340 .PHONY: assert-no-store-file-names assert-binaries-available
341 .PHONY: assert-final-inputs-self-contained