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