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