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