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