hydra: Add 'qemu-image' job.
[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/profiles.scm \
41 guix/serialization.scm \
42 guix/nar.scm \
43 guix/derivations.scm \
44 guix/gnu-maintenance.scm \
45 guix/licenses.scm \
46 guix/build-system.scm \
47 guix/build-system/cmake.scm \
48 guix/build-system/gnu.scm \
49 guix/build-system/perl.scm \
50 guix/build-system/python.scm \
51 guix/build-system/trivial.scm \
52 guix/ftp-client.scm \
53 guix/http-client.scm \
54 guix/gnupg.scm \
55 guix/store.scm \
56 guix/svn-download.scm \
57 guix/ui.scm \
58 guix/build/download.scm \
59 guix/build/cmake-build-system.scm \
60 guix/build/git.scm \
61 guix/build/gnome.scm \
62 guix/build/gnu-build-system.scm \
63 guix/build/gnu-dist.scm \
64 guix/build/linux-initrd.scm \
65 guix/build/perl-build-system.scm \
66 guix/build/python-build-system.scm \
67 guix/build/utils.scm \
68 guix/build/union.scm \
69 guix/build/pull.scm \
70 guix/build/rpath.scm \
71 guix/build/svn.scm \
72 guix/packages.scm \
73 guix/snix.scm \
74 guix/scripts/download.scm \
75 guix/scripts/build.scm \
76 guix/scripts/archive.scm \
77 guix/scripts/import.scm \
78 guix/scripts/package.scm \
79 guix/scripts/gc.scm \
80 guix/scripts/hash.scm \
81 guix/scripts/pull.scm \
82 guix/scripts/substitute-binary.scm \
83 guix/scripts/authenticate.scm \
84 guix/scripts/refresh.scm \
85 guix/scripts/system.scm \
86 guix.scm \
87 $(GNU_SYSTEM_MODULES)
88
89 if BUILD_DAEMON_OFFLOAD
90
91 MODULES += \
92 guix/scripts/offload.scm
93
94 endif BUILD_DAEMON_OFFLOAD
95
96 # Because of the autoload hack in (guix build download), we must build it
97 # first to avoid errors on systems where (gnutls) is unavailable.
98 guix/scripts/download.go: guix/build/download.go
99 guix/download.go: guix/build/download.go
100
101
102 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
103
104 nobase_dist_guilemodule_DATA = $(MODULES)
105 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
106
107 # Do we need to provide our own non-broken (srfi srfi-37) module?
108 if INSTALL_SRFI_37
109
110 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
111 GOBJECTS += srfi/srfi-37.go
112
113 srfi/srfi-37.scm: srfi/srfi-37.scm.in
114 $(MKDIR_P) srfi
115 cp "$<" "$@"
116
117 endif INSTALL_SRFI_37
118
119 # Handy way to remove the .go files without removing all the rest.
120 clean-go:
121 -$(RM) -f $(GOBJECTS)
122
123
124 SCM_TESTS = \
125 tests/base32.scm \
126 tests/base64.scm \
127 tests/hash.scm \
128 tests/pk-crypto.scm \
129 tests/pki.scm \
130 tests/substitute-binary.scm \
131 tests/builders.scm \
132 tests/derivations.scm \
133 tests/ui.scm \
134 tests/records.scm \
135 tests/utils.scm \
136 tests/build-utils.scm \
137 tests/packages.scm \
138 tests/snix.scm \
139 tests/store.scm \
140 tests/monads.scm \
141 tests/nar.scm \
142 tests/union.scm \
143 tests/profiles.scm
144
145 SH_TESTS = \
146 tests/guix-build.sh \
147 tests/guix-download.sh \
148 tests/guix-gc.sh \
149 tests/guix-hash.sh \
150 tests/guix-package.sh \
151 tests/guix-archive.sh \
152 tests/guix-authenticate.sh
153
154 if BUILD_DAEMON
155
156 SH_TESTS += tests/guix-register.sh
157
158 endif BUILD_DAEMON
159
160
161 TESTS = $(SCM_TESTS) $(SH_TESTS)
162
163 TEST_EXTENSIONS = .scm .sh
164
165 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
166
167 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
168 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
169
170 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
171 AM_SH_LOG_FLAGS = -x -e
172
173 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
174 # could end up removing files from the store while they are being used by
175 # other instances of the daemon.
176 tests/guix-gc.log: \
177 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
178 $(SCM_TESTS:%.scm=%.log)
179
180 # Public key used to sign substitutes from hydra.gnu.org.
181 pkgdata_DATA = hydra.gnu.org.pub
182
183 EXTRA_DIST = \
184 HACKING \
185 ROADMAP \
186 TODO \
187 .dir-locals.el \
188 build-aux/hydra/gnu-system.scm \
189 build-aux/hydra/demo-os.scm \
190 build-aux/hydra/guix.scm \
191 build-aux/check-available-binaries.scm \
192 build-aux/download.scm \
193 build-aux/list-packages.scm \
194 build-aux/sync-descriptions.scm \
195 srfi/srfi-37.scm.in \
196 srfi/srfi-64.scm \
197 srfi/srfi-64.upstream.scm \
198 tests/test.drv \
199 tests/signing-key.pub \
200 tests/signing-key.sec \
201 build-aux/config.rpath \
202 bootstrap \
203 release.nix \
204 $(TESTS)
205
206 if !BUILD_DAEMON_OFFLOAD
207
208 EXTRA_DIST += \
209 guix/scripts/offload.scm
210
211 endif !BUILD_DAEMON_OFFLOAD
212
213
214 CLEANFILES = \
215 $(GOBJECTS) \
216 $(SCM_TESTS:tests/%.scm=%.log)
217
218 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
219 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
220 AM_V_GUILEC_0 = @echo " GUILEC" $@;
221
222 # XXX: Use the C locale for when Guile lacks
223 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
224 .scm.go:
225 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
226 LC_ALL=C \
227 $(top_builddir)/pre-inst-env \
228 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
229 -Wformat -Wunbound-variable -Warity-mismatch \
230 --target="$(host)" \
231 -o "$@" "$<"
232
233 SUFFIXES = .go
234
235 # Make sure source files are installed first, so that the mtime of
236 # installed compiled files is greater than that of installed source
237 # files. See
238 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
239 # for details.
240 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
241 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
242
243 SUBDIRS = po
244
245 include doc.am
246
247 if BUILD_DAEMON
248
249 include daemon.am
250
251 endif BUILD_DAEMON
252
253 ACLOCAL_AMFLAGS = -I m4
254 AM_DISTCHECK_CONFIGURE_FLAGS = \
255 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
256 --with-nix-prefix="$(NIX_PREFIX)" \
257 --enable-daemon
258
259 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
260 distcheck-hook: assert-binaries-available
261
262 sync-descriptions:
263 -$(top_builddir)/pre-inst-env $(GUILE) \
264 $(top_srcdir)/build-aux/sync-descriptions.scm
265
266 gen-ChangeLog:
267 if test -d .git; then \
268 $(top_srcdir)/build-aux/gitlog-to-changelog \
269 > $(distdir)/cl-t; \
270 rm -f $(distdir)/ChangeLog; \
271 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
272 fi
273
274 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
275 assert-no-store-file-names:
276 if grep -r --exclude=*.texi --exclude=*.info \
277 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
278 then \
279 echo "error: store file names embedded in the distribution" >&2 ; \
280 exit 1 ; \
281 fi
282
283 # Make sure hydra.gnu.org has the important binaries.
284 assert-binaries-available:
285 $(top_builddir)/pre-inst-env "$(GUILE)" \
286 "$(top_srcdir)/build-aux/check-available-binaries.scm"
287
288 .PHONY: sync-descriptions gen-ChangeLog clean-go
289 .PHONY: assert-no-store-file-names assert-binaries-available