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