gnu: Add libsodium.
[jackhill/guix/guix.git] / Makefile.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
49e6291a 2# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
f2499672 3# Copyright © 2013 Andreas Enge <andreas@enge.fr>
af51c820 4#
233e7676 5# This file is part of GNU Guix.
af51c820 6#
233e7676 7# GNU Guix is free software; you can redistribute it and/or modify it
af51c820
LC
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#
233e7676 12# GNU Guix is distributed in the hope that it will be useful, but
af51c820
LC
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
233e7676 18# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
af51c820 19
c52a5bf0 20bin_SCRIPTS = \
e49951eb 21 scripts/guix
14a1c319 22
58867ae7
MW
23nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
d516736c
LC
27include gnu-system.am
28
af51c820 29MODULES = \
ddc29a78 30 guix/base32.scm \
e9c6c584 31 guix/base64.scm \
c0cd1b3e 32 guix/records.scm \
72626a71 33 guix/hash.scm \
3476ded9 34 guix/pk-crypto.scm \
8b420f74 35 guix/pki.scm \
73fbb904 36 guix/utils.scm \
de1355f1 37 guix/download.scm \
9b5b5c17 38 guix/git-download.scm \
b860f382 39 guix/monads.scm \
21b679f6 40 guix/gexp.scm \
cc4ecc2d 41 guix/profiles.scm \
0f41c26f
LC
42 guix/serialization.scm \
43 guix/nar.scm \
af51c820 44 guix/derivations.scm \
22189ed1 45 guix/gnu-maintenance.scm \
838d78e3 46 guix/licenses.scm \
208f7cd1 47 guix/build-system.scm \
c6bded8a 48 guix/build-system/cmake.scm \
208f7cd1 49 guix/build-system/gnu.scm \
08fd1ebe 50 guix/build-system/perl.scm \
40506d5d 51 guix/build-system/python.scm \
be13fbfa 52 guix/build-system/trivial.scm \
457dd86d 53 guix/ftp-client.scm \
3b8258c5 54 guix/http-client.scm \
0fdd3bea 55 guix/gnupg.scm \
af51c820 56 guix/store.scm \
b3acf365 57 guix/svn-download.scm \
073c34d7 58 guix/ui.scm \
62cab99c 59 guix/build/download.scm \
c6bded8a 60 guix/build/cmake-build-system.scm \
9b5b5c17 61 guix/build/git.scm \
af51c820 62 guix/build/gnu-build-system.scm \
fe12c345 63 guix/build/gnu-dist.scm \
88840f02 64 guix/build/linux-initrd.scm \
08fd1ebe 65 guix/build/perl-build-system.scm \
40506d5d 66 guix/build/python-build-system.scm \
1273d44a 67 guix/build/utils.scm \
c8c88afa 68 guix/build/union.scm \
3dbeecd2 69 guix/build/pull.scm \
3309e3a1 70 guix/build/rpath.scm \
b3acf365 71 guix/build/svn.scm \
e1a87b90 72 guix/build/vm.scm \
5ce3defe 73 guix/build/install.scm \
4dfe6c58 74 guix/build/activation.scm \
29fa45f4 75 guix/build/syscalls.scm \
e3ce5d70 76 guix/packages.scm \
10226c05 77 guix/snix.scm \
de1355f1
LC
78 guix/scripts/download.scm \
79 guix/scripts/build.scm \
760c60d6 80 guix/scripts/archive.scm \
de1355f1
LC
81 guix/scripts/import.scm \
82 guix/scripts/package.scm \
83 guix/scripts/gc.scm \
84 guix/scripts/hash.scm \
85 guix/scripts/pull.scm \
86 guix/scripts/substitute-binary.scm \
526382ff 87 guix/scripts/authenticate.scm \
de1355f1 88 guix/scripts/refresh.scm \
523e4896 89 guix/scripts/system.scm \
e3ce5d70 90 guix.scm \
d516736c 91 $(GNU_SYSTEM_MODULES)
af51c820 92
49e6291a
LC
93if BUILD_DAEMON_OFFLOAD
94
95MODULES += \
96 guix/scripts/offload.scm
97
98endif BUILD_DAEMON_OFFLOAD
99
855a8ad7
LC
100# Because of the autoload hack in (guix build download), we must build it
101# first to avoid errors on systems where (gnutls) is unavailable.
102guix/scripts/download.go: guix/build/download.go
de1355f1 103guix/download.go: guix/build/download.go
c44899a2 104
1959fb04 105
00e219d1 106GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
af51c820 107
800cdeef 108nobase_dist_guilemodule_DATA = $(MODULES)
1959fb04 109nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 110
1959fb04
LC
111# Do we need to provide our own non-broken (srfi srfi-37) module?
112if INSTALL_SRFI_37
113
114nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
115GOBJECTS += srfi/srfi-37.go
116
117srfi/srfi-37.scm: srfi/srfi-37.scm.in
118 $(MKDIR_P) srfi
119 cp "$<" "$@"
120
121endif INSTALL_SRFI_37
ac5aa288 122
70a9c720
LC
123# Handy way to remove the .go files without removing all the rest.
124clean-go:
125 -$(RM) -f $(GOBJECTS)
126
af51c820 127
30dd8310 128SCM_TESTS = \
ddc29a78 129 tests/base32.scm \
e9c6c584 130 tests/base64.scm \
69927e78 131 tests/hash.scm \
3476ded9 132 tests/pk-crypto.scm \
8b420f74 133 tests/pki.scm \
e9c6c584 134 tests/substitute-binary.scm \
af51c820
LC
135 tests/builders.scm \
136 tests/derivations.scm \
299112d3 137 tests/ui.scm \
c0cd1b3e 138 tests/records.scm \
e3ce5d70 139 tests/utils.scm \
b0e0d0e9 140 tests/build-utils.scm \
c8c88afa 141 tests/packages.scm \
10226c05 142 tests/snix.scm \
3259877d 143 tests/store.scm \
b860f382 144 tests/monads.scm \
21b679f6 145 tests/gexp.scm \
53c63ee9 146 tests/nar.scm \
a2078770 147 tests/union.scm \
29fa45f4
LC
148 tests/profiles.scm \
149 tests/syscalls.scm
30dd8310
LC
150
151SH_TESTS = \
0afdc485 152 tests/guix-build.sh \
37d19403 153 tests/guix-download.sh \
fe8ff028 154 tests/guix-gc.sh \
ccbce848 155 tests/guix-hash.sh \
0820098d 156 tests/guix-package.sh \
760c60d6 157 tests/guix-archive.sh \
0820098d 158 tests/guix-authenticate.sh
af51c820 159
a7a4e6a4
LC
160if BUILD_DAEMON
161
162SH_TESTS += tests/guix-register.sh
163
164endif BUILD_DAEMON
165
166
30dd8310
LC
167TESTS = $(SCM_TESTS) $(SH_TESTS)
168
97298ffa
LC
169TEST_EXTENSIONS = .scm .sh
170
352ec143
LC
171AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
172
69cfce50 173SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
174AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
175
69cfce50 176SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 177AM_SH_LOG_FLAGS = -x -e
af51c820 178
3a33730a
LC
179# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
180# could end up removing files from the store while they are being used by
181# other instances of the daemon.
182tests/guix-gc.log: \
183 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
184 $(SCM_TESTS:%.scm=%.log)
185
bf59c06d 186# Public key used to sign substitutes from hydra.gnu.org.
6c110833 187dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 188
81f61c17
LC
189EXTRA_DIST = \
190 HACKING \
191 ROADMAP \
192 TODO \
193 .dir-locals.el \
194 build-aux/hydra/gnu-system.scm \
195 build-aux/hydra/demo-os.scm \
196 build-aux/hydra/guix.scm \
197 build-aux/check-available-binaries.scm \
198 build-aux/check-final-inputs-self-contained.scm \
199 build-aux/download.scm \
200 build-aux/list-packages.scm \
201 build-aux/sync-descriptions.scm \
202 srfi/srfi-37.scm.in \
203 srfi/srfi-64.scm \
204 srfi/srfi-64.upstream.scm \
205 tests/test.drv \
206 tests/signing-key.pub \
207 tests/signing-key.sec \
208 build-aux/config.rpath \
209 bootstrap \
210 release.nix \
ed795c06 211 $(TESTS)
d7672884 212
49e6291a
LC
213if !BUILD_DAEMON_OFFLOAD
214
215EXTRA_DIST += \
216 guix/scripts/offload.scm
217
218endif !BUILD_DAEMON_OFFLOAD
219
220
30dd8310
LC
221CLEANFILES = \
222 $(GOBJECTS) \
9bff16b3 223 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 224
dab5d51b
LC
225AM_V_GUILEC = $(AM_V_GUILEC_$(V))
226AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
227AM_V_GUILEC_0 = @echo " GUILEC" $@;
228
a69b7ad2
LC
229# XXX: Use the C locale for when Guile lacks
230# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
af51c820 231.scm.go:
dab5d51b 232 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
a69b7ad2 233 LC_ALL=C \
671d8f5e
LC
234 $(top_builddir)/pre-inst-env \
235 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
236 -Wformat -Wunbound-variable -Warity-mismatch \
237 --target="$(host)" \
af51c820
LC
238 -o "$@" "$<"
239
240SUFFIXES = .go
241
242# Make sure source files are installed first, so that the mtime of
243# installed compiled files is greater than that of installed source
244# files. See
245# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
246# for details.
247guix_install_go_files = install-nobase_nodist_guilemoduleDATA
248$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 249
ee764179 250SUBDIRS = po/guix po/packages
a9424c08
LC
251
252include doc.am
568717fd 253
c2033df4
LC
254if BUILD_DAEMON
255
256include daemon.am
257
258endif BUILD_DAEMON
259
f68b0893 260ACLOCAL_AMFLAGS = -I m4
e76bdf8b 261AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 262 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 263 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
264 --with-nix-prefix="$(NIX_PREFIX)" \
265 --enable-daemon
0e993428 266
668d48a6 267dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
81f61c17 268distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 269
668d48a6 270sync-descriptions:
0e993428 271 -$(top_builddir)/pre-inst-env $(GUILE) \
668d48a6 272 $(top_srcdir)/build-aux/sync-descriptions.scm
e793178a
LC
273
274gen-ChangeLog:
275 if test -d .git; then \
276 $(top_srcdir)/build-aux/gitlog-to-changelog \
277 > $(distdir)/cl-t; \
278 rm -f $(distdir)/ChangeLog; \
279 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
280 fi
281
834129e0 282# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9
LC
283assert-no-store-file-names:
284 if grep -r --exclude=*.texi --exclude=*.info \
285 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
286 then \
287 echo "error: store file names embedded in the distribution" >&2 ; \
288 exit 1 ; \
289 fi
290
56fbf262
LC
291# Make sure hydra.gnu.org has the important binaries.
292assert-binaries-available:
293 $(top_builddir)/pre-inst-env "$(GUILE)" \
294 "$(top_srcdir)/build-aux/check-available-binaries.scm"
295
81f61c17
LC
296# Make sure the final inputs don't refer to bootstrap tools.
297assert-final-inputs-self-contained:
298 $(top_builddir)/pre-inst-env "$(GUILE)" \
299 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
300
70a9c720 301.PHONY: sync-descriptions gen-ChangeLog clean-go
56fbf262 302.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 303.PHONY: assert-final-inputs-self-contained