derivations: 'substitution-oracle' now ignores sub-trees that are valid.
[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>
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 \
4862bc4a 33 guix/gcrypt.scm \
72626a71 34 guix/hash.scm \
3476ded9 35 guix/pk-crypto.scm \
8b420f74 36 guix/pki.scm \
73fbb904 37 guix/utils.scm \
d326767e 38 guix/sets.scm \
de1355f1 39 guix/download.scm \
9b5b5c17 40 guix/git-download.scm \
b860f382 41 guix/monads.scm \
b9b86078 42 guix/monad-repl.scm \
21b679f6 43 guix/gexp.scm \
cc4ecc2d 44 guix/profiles.scm \
0f41c26f
LC
45 guix/serialization.scm \
46 guix/nar.scm \
af51c820 47 guix/derivations.scm \
22189ed1 48 guix/gnu-maintenance.scm \
838d78e3 49 guix/licenses.scm \
208f7cd1 50 guix/build-system.scm \
c6bded8a 51 guix/build-system/cmake.scm \
be3425e5 52 guix/build-system/glib-or-gtk.scm \
208f7cd1 53 guix/build-system/gnu.scm \
08fd1ebe 54 guix/build-system/perl.scm \
40506d5d 55 guix/build-system/python.scm \
a677c726 56 guix/build-system/waf.scm \
c08f9818 57 guix/build-system/ruby.scm \
be13fbfa 58 guix/build-system/trivial.scm \
457dd86d 59 guix/ftp-client.scm \
3b8258c5 60 guix/http-client.scm \
0fdd3bea 61 guix/gnupg.scm \
d5d16686 62 guix/elf.scm \
af51c820 63 guix/store.scm \
89328d24 64 guix/cvs-download.scm \
b3acf365 65 guix/svn-download.scm \
073c34d7 66 guix/ui.scm \
62cab99c 67 guix/build/download.scm \
c6bded8a 68 guix/build/cmake-build-system.scm \
9b5b5c17 69 guix/build/git.scm \
be3425e5 70 guix/build/glib-or-gtk-build-system.scm \
af51c820 71 guix/build/gnu-build-system.scm \
fe12c345 72 guix/build/gnu-dist.scm \
08fd1ebe 73 guix/build/perl-build-system.scm \
40506d5d 74 guix/build/python-build-system.scm \
c08f9818 75 guix/build/ruby-build-system.scm \
a677c726 76 guix/build/waf-build-system.scm \
6fd1a796 77 guix/build/store-copy.scm \
1273d44a 78 guix/build/utils.scm \
c8c88afa 79 guix/build/union.scm \
3dbeecd2 80 guix/build/pull.scm \
3309e3a1 81 guix/build/rpath.scm \
89328d24 82 guix/build/cvs.scm \
b3acf365 83 guix/build/svn.scm \
29fa45f4 84 guix/build/syscalls.scm \
75f3b1a1 85 guix/build/emacs-utils.scm \
fb59e275 86 guix/build/graft.scm \
e3ce5d70 87 guix/packages.scm \
1b3e9685 88 guix/import/utils.scm \
7047133f 89 guix/import/gnu.scm \
1b3e9685 90 guix/import/snix.scm \
de1355f1
LC
91 guix/scripts/download.scm \
92 guix/scripts/build.scm \
760c60d6 93 guix/scripts/archive.scm \
de1355f1
LC
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-binary.scm \
526382ff 100 guix/scripts/authenticate.scm \
de1355f1 101 guix/scripts/refresh.scm \
523e4896 102 guix/scripts/system.scm \
b4f5e0e8 103 guix/scripts/lint.scm \
7047133f 104 guix/scripts/import/gnu.scm \
1b3e9685 105 guix/scripts/import/nix.scm \
372c4bbc 106 guix/scripts/environment.scm \
e3ce5d70 107 guix.scm \
d516736c 108 $(GNU_SYSTEM_MODULES)
af51c820 109
49e6291a
LC
110if BUILD_DAEMON_OFFLOAD
111
112MODULES += \
113 guix/scripts/offload.scm
114
115endif BUILD_DAEMON_OFFLOAD
116
c1bc358f 117# Internal module with test suite support.
02754a5e 118dist_noinst_DATA = guix/tests.scm
c1bc358f 119
855a8ad7
LC
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.
122guix/scripts/download.go: guix/build/download.go
de1355f1 123guix/download.go: guix/build/download.go
c44899a2 124
a94546ec
LC
125# Linux-Libre configurations.
126KCONFIGS = \
127 gnu/packages/linux-libre-i686.conf \
128 gnu/packages/linux-libre-x86_64.conf
1959fb04 129
ebc32b31
LC
130# Templates, examples.
131EXAMPLES = \
132 gnu/system/os-config.tmpl
133
c1bc358f 134GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
af51c820 135
74574fd1
RW
136nobase_dist_guilemodule_DATA = \
137 $(MODULES) $(KCONFIGS) $(EXAMPLES) \
138 $(MISC_DISTRO_FILES)
1959fb04 139nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
800cdeef 140
1959fb04
LC
141# Do we need to provide our own non-broken (srfi srfi-37) module?
142if INSTALL_SRFI_37
143
144nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
145GOBJECTS += srfi/srfi-37.go
146
147srfi/srfi-37.scm: srfi/srfi-37.scm.in
148 $(MKDIR_P) srfi
149 cp "$<" "$@"
150
151endif INSTALL_SRFI_37
ac5aa288 152
70a9c720
LC
153# Handy way to remove the .go files without removing all the rest.
154clean-go:
155 -$(RM) -f $(GOBJECTS)
156
af51c820 157
30dd8310 158SCM_TESTS = \
ddc29a78 159 tests/base32.scm \
e9c6c584 160 tests/base64.scm \
69927e78 161 tests/hash.scm \
3476ded9 162 tests/pk-crypto.scm \
8b420f74 163 tests/pki.scm \
d326767e 164 tests/sets.scm \
e9c6c584 165 tests/substitute-binary.scm \
af51c820
LC
166 tests/builders.scm \
167 tests/derivations.scm \
299112d3 168 tests/ui.scm \
c0cd1b3e 169 tests/records.scm \
e3ce5d70 170 tests/utils.scm \
b0e0d0e9 171 tests/build-utils.scm \
c8c88afa 172 tests/packages.scm \
10226c05 173 tests/snix.scm \
3259877d 174 tests/store.scm \
b860f382 175 tests/monads.scm \
21b679f6 176 tests/gexp.scm \
53c63ee9 177 tests/nar.scm \
a2078770 178 tests/union.scm \
29fa45f4 179 tests/profiles.scm \
b4f5e0e8
CR
180 tests/syscalls.scm \
181 tests/lint.scm
30dd8310 182
1b3e9685
DT
183if HAVE_GUILE_JSON
184
85054932 185MODULES += \
1ff2619b 186 guix/import/json.scm \
85054932 187 guix/import/pypi.scm \
d45dc6da
EB
188 guix/scripts/import/pypi.scm \
189 guix/import/cpan.scm \
190 guix/scripts/import/cpan.scm
85054932 191
d45dc6da
EB
192SCM_TESTS += \
193 tests/pypi.scm \
194 tests/cpan.scm
1b3e9685
DT
195
196endif
197
30dd8310 198SH_TESTS = \
0afdc485 199 tests/guix-build.sh \
37d19403 200 tests/guix-download.sh \
fe8ff028 201 tests/guix-gc.sh \
ccbce848 202 tests/guix-hash.sh \
0820098d 203 tests/guix-package.sh \
c1202fb1 204 tests/guix-system.sh \
760c60d6 205 tests/guix-archive.sh \
dd7c013d
CR
206 tests/guix-authenticate.sh \
207 tests/guix-lint.sh
af51c820 208
a7a4e6a4
LC
209if BUILD_DAEMON
210
211SH_TESTS += tests/guix-register.sh
212
213endif BUILD_DAEMON
214
215
30dd8310
LC
216TESTS = $(SCM_TESTS) $(SH_TESTS)
217
97298ffa
LC
218TEST_EXTENSIONS = .scm .sh
219
352ec143
LC
220AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
221
69cfce50 222SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
97298ffa
LC
223AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
224
69cfce50 225SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
97298ffa 226AM_SH_LOG_FLAGS = -x -e
af51c820 227
3a33730a
LC
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.
231tests/guix-gc.log: \
232 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
233 $(SCM_TESTS:%.scm=%.log)
234
bf59c06d 235# Public key used to sign substitutes from hydra.gnu.org.
6c110833 236dist_pkgdata_DATA = hydra.gnu.org.pub
3a33730a 237
81f61c17
LC
238EXTRA_DIST = \
239 HACKING \
240 ROADMAP \
241 TODO \
242 .dir-locals.el \
f81ac34d 243 build-aux/build-self.scm \
81f61c17
LC
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 \
81f61c17
LC
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 \
ed795c06 260 $(TESTS)
d7672884 261
49e6291a
LC
262if !BUILD_DAEMON_OFFLOAD
263
264EXTRA_DIST += \
265 guix/scripts/offload.scm
266
267endif !BUILD_DAEMON_OFFLOAD
268
269
30dd8310
LC
270CLEANFILES = \
271 $(GOBJECTS) \
9bff16b3 272 $(SCM_TESTS:tests/%.scm=%.log)
af51c820 273
dab5d51b
LC
274AM_V_GUILEC = $(AM_V_GUILEC_$(V))
275AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
276AM_V_GUILEC_0 = @echo " GUILEC" $@;
277
28561d85
LC
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#
a69b7ad2
LC
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>.
af51c820 287.scm.go:
dab5d51b 288 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
28561d85 289 unset GUILE_LOAD_COMPILED_PATH ; \
a69b7ad2 290 LC_ALL=C \
671d8f5e
LC
291 $(top_builddir)/pre-inst-env \
292 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
293 -Wformat -Wunbound-variable -Warity-mismatch \
294 --target="$(host)" \
af51c820
LC
295 -o "$@" "$<"
296
297SUFFIXES = .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.
304guix_install_go_files = install-nobase_nodist_guilemoduleDATA
305$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
f68b0893 306
6005bd07
LC
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.
310install-data-hook: set-bootstrap-executable-permissions
311 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
312
313
ee764179 314SUBDIRS = po/guix po/packages
931c132a 315BUILT_SOURCES =
a9424c08
LC
316
317include doc.am
568717fd 318
c2033df4
LC
319if BUILD_DAEMON
320
321include daemon.am
322
323endif BUILD_DAEMON
324
f68b0893 325ACLOCAL_AMFLAGS = -I m4
e76bdf8b 326AM_DISTCHECK_CONFIGURE_FLAGS = \
d388c2c4 327 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
14af289e 328 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
aca54b39
LC
329 --with-nix-prefix="$(NIX_PREFIX)" \
330 --enable-daemon
0e993428 331
457f60fa
AK
332dist_emacsui_DATA = emacs/guix-main.scm
333nodist_emacsui_DATA = emacs/guix-helper.scm
334include emacs.am
335
668d48a6 336dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
81f61c17 337distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
e793178a 338
668d48a6 339sync-descriptions:
36c45230
LC
340 -GUIX_PACKAGE_PATH= \
341 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
e793178a
LC
342
343gen-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
834129e0 351# Make sure we're not shipping a file that embeds a local /gnu/store file name.
a463ffd9
LC
352assert-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
56fbf262
LC
360# Make sure hydra.gnu.org has the important binaries.
361assert-binaries-available:
362 $(top_builddir)/pre-inst-env "$(GUILE)" \
363 "$(top_srcdir)/build-aux/check-available-binaries.scm"
364
81f61c17
LC
365# Make sure the final inputs don't refer to bootstrap tools.
366assert-final-inputs-self-contained:
367 $(top_builddir)/pre-inst-env "$(GUILE)" \
368 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
369
70a9c720 370.PHONY: sync-descriptions gen-ChangeLog clean-go
56fbf262 371.PHONY: assert-no-store-file-names assert-binaries-available
81f61c17 372.PHONY: assert-final-inputs-self-contained