Add 'guix-daemon.conf' job for Upstart.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
d326767e 2# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
a8ac45b1 4# Copyright © 2015 Alex Kost <alezost@gmail.com>
af51c820 5#
233e7676 6# This file is part of GNU Guix.
af51c820 7#
233e7676 8# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
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#
233e7676 13# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
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
233e7676 19# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 20
c52a5bf0 21bin_SCRIPTS = \
e49951eb 22 scripts/guix
14a1c319 23
58867ae7
MW
24nodist_noinst_SCRIPTS = \
25 pre-inst-env \
26 test-env
27
d516736c
LC
28include gnu-system.am
29
af51c820 30MODULES = \
ddc29a78 31 guix/base32.scm \
e9c6c584 32 guix/base64.scm \
7a18c3cc 33 guix/cpio.scm \
c0cd1b3e 34 guix/records.scm \
4862bc4a 35 guix/gcrypt.scm \
72626a71 36 guix/hash.scm \
3476ded9 37 guix/pk-crypto.scm \
8b420f74 38 guix/pki.scm \
73fbb904 39 guix/utils.scm \
d326767e 40 guix/sets.scm \
de1355f1 41 guix/download.scm \
9b5b5c17 42 guix/git-download.scm \
b860f382 43 guix/monads.scm \
b9b86078 44 guix/monad-repl.scm \
21b679f6 45 guix/gexp.scm \
cc4ecc2d 46 guix/profiles.scm \
0f41c26f
LC
47 guix/serialization.scm \
48 guix/nar.scm \
af51c820 49 guix/derivations.scm \
22189ed1 50 guix/gnu-maintenance.scm \
0a7c5a09 51 guix/upstream.scm \
838d78e3 52 guix/licenses.scm \
8fb58371 53 guix/graph.scm \
0eef7551 54 guix/cve.scm \
208f7cd1 55 guix/build-system.scm \
c6bded8a 56 guix/build-system/cmake.scm \
e9137a53 57 guix/build-system/emacs.scm \
be3425e5 58 guix/build-system/glib-or-gtk.scm \
208f7cd1 59 guix/build-system/gnu.scm \
ce6fc7d6 60 guix/build-system/haskell.scm \
08fd1ebe 61 guix/build-system/perl.scm \
40506d5d 62 guix/build-system/python.scm \
a677c726 63 guix/build-system/waf.scm \
f8f3bef6 64 guix/build-system/r.scm \
c08f9818 65 guix/build-system/ruby.scm \
be13fbfa 66 guix/build-system/trivial.scm \
457dd86d 67 guix/ftp-client.scm \
3b8258c5 68 guix/http-client.scm \
0fdd3bea 69 guix/gnupg.scm \
d5d16686 70 guix/elf.scm \
af51c820 71 guix/store.scm \
89328d24 72 guix/cvs-download.scm \
b3acf365 73 guix/svn-download.scm \
073c34d7 74 guix/ui.scm \
62cab99c 75 guix/build/download.scm \
c6bded8a 76 guix/build/cmake-build-system.scm \
e9137a53 77 guix/build/emacs-build-system.scm \
9b5b5c17 78 guix/build/git.scm \
be3425e5 79 guix/build/glib-or-gtk-build-system.scm \
af51c820 80 guix/build/gnu-build-system.scm \
fe12c345 81 guix/build/gnu-dist.scm \
08fd1ebe 82 guix/build/perl-build-system.scm \
40506d5d 83 guix/build/python-build-system.scm \
f8f3bef6 84 guix/build/r-build-system.scm \
c08f9818 85 guix/build/ruby-build-system.scm \
a677c726 86 guix/build/waf-build-system.scm \
9fd6c2ba 87 guix/build/haskell-build-system.scm \
6fd1a796 88 guix/build/store-copy.scm \
1273d44a 89 guix/build/utils.scm \
c8c88afa 90 guix/build/union.scm \
611adb1e 91 guix/build/profiles.scm \
3dbeecd2 92 guix/build/pull.scm \
3309e3a1 93 guix/build/rpath.scm \
89328d24 94 guix/build/cvs.scm \
b3acf365 95 guix/build/svn.scm \
15aa2c38 96 guix/build/gremlin.scm \
75f3b1a1 97 guix/build/emacs-utils.scm \
fb59e275 98 guix/build/graft.scm \
e89431bf 99 guix/search-paths.scm \
e3ce5d70 100 guix/packages.scm \
1b3e9685 101 guix/import/utils.scm \
7047133f 102 guix/import/gnu.scm \
1b3e9685 103 guix/import/snix.scm \
a4154748 104 guix/import/cabal.scm \
e1248602 105 guix/import/cran.scm \
a4154748 106 guix/import/hackage.scm \
7f74a931 107 guix/import/elpa.scm \
88981dd3 108 guix/scripts.scm \
de1355f1
LC
109 guix/scripts/download.scm \
110 guix/scripts/build.scm \
760c60d6 111 guix/scripts/archive.scm \
de1355f1
LC
112 guix/scripts/import.scm \
113 guix/scripts/package.scm \
114 guix/scripts/gc.scm \
115 guix/scripts/hash.scm \
116 guix/scripts/pull.scm \
2c74fde0 117 guix/scripts/substitute.scm \
526382ff 118 guix/scripts/authenticate.scm \
de1355f1 119 guix/scripts/refresh.scm \
523e4896 120 guix/scripts/system.scm \
b4f5e0e8 121 guix/scripts/lint.scm \
d23c20f1 122 guix/scripts/challenge.scm \
e1248602 123 guix/scripts/import/cran.scm \
7047133f 124 guix/scripts/import/gnu.scm \
1b3e9685 125 guix/scripts/import/nix.scm \
a4154748 126 guix/scripts/import/hackage.scm \
7f74a931 127 guix/scripts/import/elpa.scm \
372c4bbc 128 guix/scripts/environment.scm \
aff8ce7c 129 guix/scripts/publish.scm \
39bee8a2 130 guix/scripts/edit.scm \
fcc58db6 131 guix/scripts/size.scm \
88856916 132 guix/scripts/graph.scm \
32efa254
DT
133 guix/scripts/container.scm \
134 guix/scripts/container/exec.scm \
e3ce5d70 135 guix.scm \
d516736c 136 $(GNU_SYSTEM_MODULES)
af51c820 137
12e5b266
LC
138if BUILD_SYSCALLS_MODULE
139
140MODULES += \
141 guix/build/syscalls.scm
142
143endif
144
49e6291a
LC
145if BUILD_DAEMON_OFFLOAD
146
147MODULES += \
148 guix/scripts/offload.scm
149
150endif BUILD_DAEMON_OFFLOAD
151
c1bc358f 152# Internal module with test suite support.
02754a5e 153dist_noinst_DATA = guix/tests.scm
c1bc358f 154
855a8ad7
LC
155# Because of the autoload hack in (guix build download), we must build it
156# first to avoid errors on systems where (gnutls) is unavailable.
157guix/scripts/download.go: guix/build/download.go
de1355f1 158guix/download.go: guix/build/download.go
c44899a2 159
a94546ec
LC
160# Linux-Libre configurations.
161KCONFIGS = \
162 gnu/packages/linux-libre-i686.conf \
163 gnu/packages/linux-libre-x86_64.conf
1959fb04 164
ebc32b31
LC
165# Templates, examples.
166EXAMPLES = \
36ffaca2
LC
167 gnu/system/examples/bare-bones.tmpl \
168 gnu/system/examples/desktop.tmpl
ebc32b31 169
c1bc358f 170GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
af51c820 171
74574fd1
RW
172nobase_dist_guilemodule_DATA = \
173 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
174 $(MISC_DISTRO_FILES)
1959fb04 175nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 176
1959fb04
LC
177# Do we need to provide our own non-broken (srfi srfi-37) module?
178if INSTALL_SRFI_37
179
180nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
181GOBJECTS += srfi/srfi-37.go
182
183srfi/srfi-37.scm: srfi/srfi-37.scm.in
184 $(MKDIR_P) srfi
185 cp "$<" "$@"
186
187endif INSTALL_SRFI_37
ac5aa288 188
70a9c720
LC
189# Handy way to remove the .go files without removing all the rest.
190clean-go:
191 -$(RM) -f $(GOBJECTS)
192
af51c820 193
30dd8310 194SCM_TESTS = \
ddc29a78 195 tests/base32.scm \
e9c6c584 196 tests/base64.scm \
7a18c3cc 197 tests/cpio.scm \
69927e78 198 tests/hash.scm \
3476ded9 199 tests/pk-crypto.scm \
8b420f74 200 tests/pki.scm \
d326767e 201 tests/sets.scm \
2c74fde0 202 tests/substitute.scm \
af51c820
LC
203 tests/builders.scm \
204 tests/derivations.scm \
299112d3 205 tests/ui.scm \
c0cd1b3e 206 tests/records.scm \
e3ce5d70 207 tests/utils.scm \
b0e0d0e9 208 tests/build-utils.scm \
c8c88afa 209 tests/packages.scm \
10226c05 210 tests/snix.scm \
a4154748 211 tests/hackage.scm \
e1248602 212 tests/cran.scm \
7f74a931 213 tests/elpa.scm \
3259877d 214 tests/store.scm \
b860f382 215 tests/monads.scm \
21b679f6 216 tests/gexp.scm \
53c63ee9 217 tests/nar.scm \
a2078770 218 tests/union.scm \
29fa45f4 219 tests/profiles.scm \
b4f5e0e8 220 tests/syscalls.scm \
15aa2c38 221 tests/gremlin.scm \
aff8ce7c 222 tests/lint.scm \
fcc58db6 223 tests/publish.scm \
88981dd3 224 tests/scripts.scm \
c1f6a0c2 225 tests/size.scm \
88856916 226 tests/graph.scm \
d23c20f1 227 tests/challenge.scm \
0eef7551 228 tests/cve.scm \
661a1d79 229 tests/file-systems.scm \
0adfe95a 230 tests/services.scm \
c1f6a0c2 231 tests/containers.scm
30dd8310 232
1b3e9685
DT
233if HAVE_GUILE_JSON
234
85054932 235MODULES += \
1ff2619b 236 guix/import/json.scm \
85054932 237 guix/import/pypi.scm \
d45dc6da
EB
238 guix/scripts/import/pypi.scm \
239 guix/import/cpan.scm \
3aae8145
DT
240 guix/scripts/import/gem.scm \
241 guix/import/gem.scm
85054932 242
d45dc6da
EB
243SCM_TESTS += \
244 tests/pypi.scm \
a96524cc
DT
245 tests/cpan.scm \
246 tests/gem.scm
1b3e9685
DT
247
248endif
249
30dd8310 250SH_TESTS = \
0afdc485 251 tests/guix-build.sh \
37d19403 252 tests/guix-download.sh \
fe8ff028 253 tests/guix-gc.sh \
ccbce848 254 tests/guix-hash.sh \
0820098d 255 tests/guix-package.sh \
57b86237 256 tests/guix-package-net.sh \
c1202fb1 257 tests/guix-system.sh \
760c60d6 258 tests/guix-archive.sh \
dd7c013d 259 tests/guix-authenticate.sh \
cad25264 260 tests/guix-environment.sh \
f535dcbe 261 tests/guix-environment-container.sh \
88856916 262 tests/guix-graph.sh \
dd7c013d 263 tests/guix-lint.sh
af51c820 264
a7a4e6a4
LC
265if BUILD_DAEMON
266
267SH_TESTS += tests/guix-register.sh
268
269endif BUILD_DAEMON
270
271
30dd8310
LC
272TESTS = $(SCM_TESTS) $(SH_TESTS)
273
97298ffa
LC
274TEST_EXTENSIONS = .scm .sh
275
352ec143
LC
276AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
277
69cfce50 278SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
279AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
280
69cfce50 281SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 282AM_SH_LOG_FLAGS = -x -e
af51c820 283
3a33730a
LC
284# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
285# could end up removing files from the store while they are being used by
286# other instances of the daemon.
287tests/guix-gc.log: \
288 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
289 $(SCM_TESTS:%.scm=%.log)
290
bf59c06d 291# Public key used to sign substitutes from hydra.gnu.org.
6c110833 292dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 293
ee3e157d
LC
294# Bash completion file.
295dist_bashcompletion_DATA = etc/completion/bash/guix
296
81f61c17
LC
297EXTRA_DIST = \
298 HACKING \
299 ROADMAP \
300 TODO \
301 .dir-locals.el \
f81ac34d 302 build-aux/build-self.scm \
81f61c17
LC
303 build-aux/hydra/gnu-system.scm \
304 build-aux/hydra/demo-os.scm \
305 build-aux/hydra/guix.scm \
306 build-aux/check-available-binaries.scm \
307 build-aux/check-final-inputs-self-contained.scm \
308 build-aux/download.scm \
8bc35f85 309 build-aux/make-binary-tarball.scm \
1c2ae810 310 build-aux/generate-authors.scm \
81f61c17
LC
311 srfi/srfi-37.scm.in \
312 srfi/srfi-64.scm \
313 srfi/srfi-64.upstream.scm \
314 tests/test.drv \
315 tests/signing-key.pub \
316 tests/signing-key.sec \
0eef7551 317 tests/cve-sample.xml \
81f61c17
LC
318 build-aux/config.rpath \
319 bootstrap \
320 release.nix \
ed795c06 321 $(TESTS)
d7672884 322
49e6291a
LC
323if !BUILD_DAEMON_OFFLOAD
324
325EXTRA_DIST += \
326 guix/scripts/offload.scm
327
328endif !BUILD_DAEMON_OFFLOAD
329
12e5b266
LC
330if !BUILD_SYSCALLS_MODULE
331
332EXTRA_DIST += \
333 guix/build/syscalls.scm
334
335endif !BUILD_SYSCALLS_MODULE
336
49e6291a 337
30dd8310
LC
338CLEANFILES = \
339 $(GOBJECTS) \
9bff16b3 340 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 341
dab5d51b
LC
342AM_V_GUILEC = $(AM_V_GUILEC_$(V))
343AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
344AM_V_GUILEC_0 = @echo " GUILEC" $@;
345
4fca58a6
LC
346# Flags passed to 'guild compile'.
347GUILD_COMPILE_FLAGS = \
348 -Wformat -Wunbound-variable -Warity-mismatch
349
28561d85
LC
350# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
351# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
352# there that are newer than the local .scm files (for instance because the
353# user ran 'make install' recently). When that happens, we end up loading
354# those previously-installed .go files, which may be stale, thereby breaking
355# the whole thing.
356#
a69b7ad2
LC
357# XXX: Use the C locale for when Guile lacks
358# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
af51c820 359.scm.go:
dab5d51b 360 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
28561d85 361 unset GUILE_LOAD_COMPILED_PATH ; \
a69b7ad2 362 LC_ALL=C \
671d8f5e
LC
363 $(top_builddir)/pre-inst-env \
364 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
4fca58a6 365 $(GUILD_COMPILE_FLAGS) --target="$(host)" \
af51c820
LC
366 -o "$@" "$<"
367
368SUFFIXES = .go
369
370# Make sure source files are installed first, so that the mtime of
371# installed compiled files is greater than that of installed source
372# files. See
373# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
374# for details.
375guix_install_go_files = install-nobase_nodist_guilemoduleDATA
376$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 377
6005bd07
LC
378# The above trick doesn't work for 'config.go' because both 'config.scm' and
379# 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
380# special treatment.
381install-data-hook: set-bootstrap-executable-permissions
382 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
383
384
ee764179 385SUBDIRS = po/guix po/packages
931c132a 386BUILT_SOURCES =
a9424c08
LC
387
388include doc.am
568717fd 389
c2033df4
LC
390if BUILD_DAEMON
391
392include daemon.am
393
394endif BUILD_DAEMON
395
f68b0893 396ACLOCAL_AMFLAGS = -I m4
e76bdf8b 397AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 398 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 399 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
400 --with-nix-prefix="$(NIX_PREFIX)" \
401 --enable-daemon
0e993428 402
457f60fa
AK
403dist_emacsui_DATA = emacs/guix-main.scm
404nodist_emacsui_DATA = emacs/guix-helper.scm
405include emacs.am
406
9d3fb6c7
LC
407# The self-contained tarball.
408guix-binary.%.tar.xz:
409 -GUIX_PACKAGE_PATH= \
410 $(top_builddir)/pre-inst-env "$(GUILE)" \
411 "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
412
413
a8ac45b1
AK
414dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
415dist-hook: assert-no-store-file-names
416
81f61c17 417distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 418
668d48a6 419sync-descriptions:
36c45230
LC
420 -GUIX_PACKAGE_PATH= \
421 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
e793178a
LC
422
423gen-ChangeLog:
424 if test -d .git; then \
425 $(top_srcdir)/build-aux/gitlog-to-changelog \
426 > $(distdir)/cl-t; \
427 rm -f $(distdir)/ChangeLog; \
428 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
429 fi
430
a8ac45b1 431gen-AUTHORS:
ac140f79
LC
432 if test -d .git; then \
433 rm -f "$(distdir)/AUTHORS"; \
434 $(top_builddir)/pre-inst-env "$(GUILE)" \
435 "$(top_srcdir)/build-aux/generate-authors.scm" \
436 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
437 fi
a8ac45b1 438
834129e0 439# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9
LC
440assert-no-store-file-names:
441 if grep -r --exclude=*.texi --exclude=*.info \
442 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
443 then \
444 echo "error: store file names embedded in the distribution" >&2 ; \
445 exit 1 ; \
446 fi
447
56fbf262
LC
448# Make sure hydra.gnu.org has the important binaries.
449assert-binaries-available:
450 $(top_builddir)/pre-inst-env "$(GUILE)" \
451 "$(top_srcdir)/build-aux/check-available-binaries.scm"
452
81f61c17
LC
453# Make sure the final inputs don't refer to bootstrap tools.
454assert-final-inputs-self-contained:
455 $(top_builddir)/pre-inst-env "$(GUILE)" \
456 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
457
a8ac45b1 458.PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go
56fbf262 459.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 460.PHONY: assert-final-inputs-self-contained