Add (guix build gremlin).
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015 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/gcrypt.scm \
34 guix/hash.scm \
35 guix/pk-crypto.scm \
36 guix/pki.scm \
37 guix/utils.scm \
38 guix/sets.scm \
39 guix/download.scm \
40 guix/git-download.scm \
41 guix/monads.scm \
42 guix/monad-repl.scm \
43 guix/gexp.scm \
44 guix/profiles.scm \
45 guix/serialization.scm \
46 guix/nar.scm \
47 guix/derivations.scm \
48 guix/gnu-maintenance.scm \
49 guix/licenses.scm \
50 guix/build-system.scm \
51 guix/build-system/cmake.scm \
52 guix/build-system/glib-or-gtk.scm \
53 guix/build-system/gnu.scm \
54 guix/build-system/perl.scm \
55 guix/build-system/python.scm \
56 guix/build-system/waf.scm \
57 guix/build-system/ruby.scm \
58 guix/build-system/trivial.scm \
59 guix/ftp-client.scm \
60 guix/http-client.scm \
61 guix/gnupg.scm \
62 guix/elf.scm \
63 guix/store.scm \
64 guix/cvs-download.scm \
65 guix/svn-download.scm \
66 guix/ui.scm \
67 guix/build/download.scm \
68 guix/build/cmake-build-system.scm \
69 guix/build/git.scm \
70 guix/build/glib-or-gtk-build-system.scm \
71 guix/build/gnu-build-system.scm \
72 guix/build/gnu-dist.scm \
73 guix/build/perl-build-system.scm \
74 guix/build/python-build-system.scm \
75 guix/build/ruby-build-system.scm \
76 guix/build/waf-build-system.scm \
77 guix/build/store-copy.scm \
78 guix/build/utils.scm \
79 guix/build/union.scm \
80 guix/build/pull.scm \
81 guix/build/rpath.scm \
82 guix/build/cvs.scm \
83 guix/build/svn.scm \
84 guix/build/syscalls.scm \
85 guix/build/gremlin.scm \
86 guix/build/emacs-utils.scm \
87 guix/build/graft.scm \
88 guix/packages.scm \
89 guix/import/utils.scm \
90 guix/import/gnu.scm \
91 guix/import/snix.scm \
92 guix/scripts/download.scm \
93 guix/scripts/build.scm \
94 guix/scripts/archive.scm \
95 guix/scripts/import.scm \
96 guix/scripts/package.scm \
97 guix/scripts/gc.scm \
98 guix/scripts/hash.scm \
99 guix/scripts/pull.scm \
100 guix/scripts/substitute.scm \
101 guix/scripts/authenticate.scm \
102 guix/scripts/refresh.scm \
103 guix/scripts/system.scm \
104 guix/scripts/lint.scm \
105 guix/scripts/import/gnu.scm \
106 guix/scripts/import/nix.scm \
107 guix/scripts/environment.scm \
108 guix.scm \
109 $(GNU_SYSTEM_MODULES)
110
111 if BUILD_DAEMON_OFFLOAD
112
113 MODULES += \
114 guix/scripts/offload.scm
115
116 endif BUILD_DAEMON_OFFLOAD
117
118 # Internal module with test suite support.
119 dist_noinst_DATA = guix/tests.scm
120
121 # Because of the autoload hack in (guix build download), we must build it
122 # first to avoid errors on systems where (gnutls) is unavailable.
123 guix/scripts/download.go: guix/build/download.go
124 guix/download.go: guix/build/download.go
125
126 # Linux-Libre configurations.
127 KCONFIGS = \
128 gnu/packages/linux-libre-i686.conf \
129 gnu/packages/linux-libre-x86_64.conf
130
131 # Templates, examples.
132 EXAMPLES = \
133 gnu/system/os-config.tmpl
134
135 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
136
137 nobase_dist_guilemodule_DATA = \
138 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
139 $(MISC_DISTRO_FILES)
140 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
141
142 # Do we need to provide our own non-broken (srfi srfi-37) module?
143 if INSTALL_SRFI_37
144
145 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
146 GOBJECTS += srfi/srfi-37.go
147
148 srfi/srfi-37.scm: srfi/srfi-37.scm.in
149 $(MKDIR_P) srfi
150 cp "$<" "$@"
151
152 endif INSTALL_SRFI_37
153
154 # Handy way to remove the .go files without removing all the rest.
155 clean-go:
156 -$(RM) -f $(GOBJECTS)
157
158
159 SCM_TESTS = \
160 tests/base32.scm \
161 tests/base64.scm \
162 tests/hash.scm \
163 tests/pk-crypto.scm \
164 tests/pki.scm \
165 tests/sets.scm \
166 tests/substitute.scm \
167 tests/builders.scm \
168 tests/derivations.scm \
169 tests/ui.scm \
170 tests/records.scm \
171 tests/utils.scm \
172 tests/build-utils.scm \
173 tests/packages.scm \
174 tests/snix.scm \
175 tests/store.scm \
176 tests/monads.scm \
177 tests/gexp.scm \
178 tests/nar.scm \
179 tests/union.scm \
180 tests/profiles.scm \
181 tests/syscalls.scm \
182 tests/gremlin.scm \
183 tests/lint.scm
184
185 if HAVE_GUILE_JSON
186
187 MODULES += \
188 guix/import/json.scm \
189 guix/import/pypi.scm \
190 guix/scripts/import/pypi.scm \
191 guix/import/cpan.scm \
192 guix/scripts/import/cpan.scm
193
194 SCM_TESTS += \
195 tests/pypi.scm \
196 tests/cpan.scm
197
198 endif
199
200 SH_TESTS = \
201 tests/guix-build.sh \
202 tests/guix-download.sh \
203 tests/guix-gc.sh \
204 tests/guix-hash.sh \
205 tests/guix-package.sh \
206 tests/guix-system.sh \
207 tests/guix-archive.sh \
208 tests/guix-authenticate.sh \
209 tests/guix-lint.sh
210
211 if BUILD_DAEMON
212
213 SH_TESTS += tests/guix-register.sh
214
215 endif BUILD_DAEMON
216
217
218 TESTS = $(SCM_TESTS) $(SH_TESTS)
219
220 TEST_EXTENSIONS = .scm .sh
221
222 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
223
224 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
225 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
226
227 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
228 AM_SH_LOG_FLAGS = -x -e
229
230 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
231 # could end up removing files from the store while they are being used by
232 # other instances of the daemon.
233 tests/guix-gc.log: \
234 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
235 $(SCM_TESTS:%.scm=%.log)
236
237 # Public key used to sign substitutes from hydra.gnu.org.
238 dist_pkgdata_DATA = hydra.gnu.org.pub
239
240 EXTRA_DIST = \
241 HACKING \
242 ROADMAP \
243 TODO \
244 .dir-locals.el \
245 build-aux/build-self.scm \
246 build-aux/hydra/gnu-system.scm \
247 build-aux/hydra/demo-os.scm \
248 build-aux/hydra/guix.scm \
249 build-aux/check-available-binaries.scm \
250 build-aux/check-final-inputs-self-contained.scm \
251 build-aux/download.scm \
252 build-aux/list-packages.scm \
253 srfi/srfi-37.scm.in \
254 srfi/srfi-64.scm \
255 srfi/srfi-64.upstream.scm \
256 tests/test.drv \
257 tests/signing-key.pub \
258 tests/signing-key.sec \
259 build-aux/config.rpath \
260 bootstrap \
261 release.nix \
262 $(TESTS)
263
264 if !BUILD_DAEMON_OFFLOAD
265
266 EXTRA_DIST += \
267 guix/scripts/offload.scm
268
269 endif !BUILD_DAEMON_OFFLOAD
270
271
272 CLEANFILES = \
273 $(GOBJECTS) \
274 $(SCM_TESTS:tests/%.scm=%.log)
275
276 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
277 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
278 AM_V_GUILEC_0 = @echo " GUILEC" $@;
279
280 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
281 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
282 # there that are newer than the local .scm files (for instance because the
283 # user ran 'make install' recently). When that happens, we end up loading
284 # those previously-installed .go files, which may be stale, thereby breaking
285 # the whole thing.
286 #
287 # XXX: Use the C locale for when Guile lacks
288 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
289 .scm.go:
290 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
291 unset GUILE_LOAD_COMPILED_PATH ; \
292 LC_ALL=C \
293 $(top_builddir)/pre-inst-env \
294 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
295 -Wformat -Wunbound-variable -Warity-mismatch \
296 --target="$(host)" \
297 -o "$@" "$<"
298
299 SUFFIXES = .go
300
301 # Make sure source files are installed first, so that the mtime of
302 # installed compiled files is greater than that of installed source
303 # files. See
304 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
305 # for details.
306 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
307 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
308
309 # The above trick doesn't work for 'config.go' because both 'config.scm' and
310 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
311 # special treatment.
312 install-data-hook: set-bootstrap-executable-permissions
313 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
314
315
316 SUBDIRS = po/guix po/packages
317 BUILT_SOURCES =
318
319 include doc.am
320
321 if BUILD_DAEMON
322
323 include daemon.am
324
325 endif BUILD_DAEMON
326
327 ACLOCAL_AMFLAGS = -I m4
328 AM_DISTCHECK_CONFIGURE_FLAGS = \
329 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
330 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
331 --with-nix-prefix="$(NIX_PREFIX)" \
332 --enable-daemon
333
334 dist_emacsui_DATA = emacs/guix-main.scm
335 nodist_emacsui_DATA = emacs/guix-helper.scm
336 include emacs.am
337
338 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
339 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
340
341 sync-descriptions:
342 -GUIX_PACKAGE_PATH= \
343 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
344
345 gen-ChangeLog:
346 if test -d .git; then \
347 $(top_srcdir)/build-aux/gitlog-to-changelog \
348 > $(distdir)/cl-t; \
349 rm -f $(distdir)/ChangeLog; \
350 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
351 fi
352
353 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
354 assert-no-store-file-names:
355 if grep -r --exclude=*.texi --exclude=*.info \
356 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
357 then \
358 echo "error: store file names embedded in the distribution" >&2 ; \
359 exit 1 ; \
360 fi
361
362 # Make sure hydra.gnu.org has the important binaries.
363 assert-binaries-available:
364 $(top_builddir)/pre-inst-env "$(GUILE)" \
365 "$(top_srcdir)/build-aux/check-available-binaries.scm"
366
367 # Make sure the final inputs don't refer to bootstrap tools.
368 assert-final-inputs-self-contained:
369 $(top_builddir)/pre-inst-env "$(GUILE)" \
370 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
371
372 .PHONY: sync-descriptions gen-ChangeLog clean-go
373 .PHONY: assert-no-store-file-names assert-binaries-available
374 .PHONY: assert-final-inputs-self-contained