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