Add (guix sets).
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 #
5 # This file is part of GNU Guix.
6 #
7 # GNU Guix is free software; you can redistribute it and/or modify it
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 #
12 # GNU Guix is distributed in the hope that it will be useful, but
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
18 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 bin_SCRIPTS = \
21 scripts/guix
22
23 nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27 include gnu-system.am
28
29 MODULES = \
30 guix/base32.scm \
31 guix/base64.scm \
32 guix/records.scm \
33 guix/hash.scm \
34 guix/pk-crypto.scm \
35 guix/pki.scm \
36 guix/utils.scm \
37 guix/sets.scm \
38 guix/download.scm \
39 guix/git-download.scm \
40 guix/monads.scm \
41 guix/monad-repl.scm \
42 guix/gexp.scm \
43 guix/profiles.scm \
44 guix/serialization.scm \
45 guix/nar.scm \
46 guix/derivations.scm \
47 guix/gnu-maintenance.scm \
48 guix/licenses.scm \
49 guix/build-system.scm \
50 guix/build-system/cmake.scm \
51 guix/build-system/glib-or-gtk.scm \
52 guix/build-system/gnu.scm \
53 guix/build-system/perl.scm \
54 guix/build-system/python.scm \
55 guix/build-system/ruby.scm \
56 guix/build-system/trivial.scm \
57 guix/ftp-client.scm \
58 guix/http-client.scm \
59 guix/gnupg.scm \
60 guix/elf.scm \
61 guix/store.scm \
62 guix/svn-download.scm \
63 guix/ui.scm \
64 guix/build/download.scm \
65 guix/build/cmake-build-system.scm \
66 guix/build/git.scm \
67 guix/build/glib-or-gtk-build-system.scm \
68 guix/build/gnu-build-system.scm \
69 guix/build/gnu-dist.scm \
70 guix/build/perl-build-system.scm \
71 guix/build/python-build-system.scm \
72 guix/build/ruby-build-system.scm \
73 guix/build/store-copy.scm \
74 guix/build/utils.scm \
75 guix/build/union.scm \
76 guix/build/pull.scm \
77 guix/build/rpath.scm \
78 guix/build/svn.scm \
79 guix/build/syscalls.scm \
80 guix/build/emacs-utils.scm \
81 guix/build/graft.scm \
82 guix/packages.scm \
83 guix/import/utils.scm \
84 guix/import/gnu.scm \
85 guix/import/snix.scm \
86 guix/scripts/download.scm \
87 guix/scripts/build.scm \
88 guix/scripts/archive.scm \
89 guix/scripts/import.scm \
90 guix/scripts/package.scm \
91 guix/scripts/gc.scm \
92 guix/scripts/hash.scm \
93 guix/scripts/pull.scm \
94 guix/scripts/substitute-binary.scm \
95 guix/scripts/authenticate.scm \
96 guix/scripts/refresh.scm \
97 guix/scripts/system.scm \
98 guix/scripts/lint.scm \
99 guix/scripts/import/gnu.scm \
100 guix/scripts/import/nix.scm \
101 guix/scripts/environment.scm \
102 guix.scm \
103 $(GNU_SYSTEM_MODULES)
104
105 if BUILD_DAEMON_OFFLOAD
106
107 MODULES += \
108 guix/scripts/offload.scm
109
110 endif BUILD_DAEMON_OFFLOAD
111
112 # Internal module with test suite support.
113 dist_noinst_DATA = guix/tests.scm
114
115 # Because of the autoload hack in (guix build download), we must build it
116 # first to avoid errors on systems where (gnutls) is unavailable.
117 guix/scripts/download.go: guix/build/download.go
118 guix/download.go: guix/build/download.go
119
120 # Linux-Libre configurations.
121 KCONFIGS = \
122 gnu/packages/linux-libre-i686.conf \
123 gnu/packages/linux-libre-x86_64.conf
124
125 # Templates, examples.
126 EXAMPLES = \
127 gnu/system/os-config.tmpl
128
129 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
130
131 nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
132 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
133
134 # Do we need to provide our own non-broken (srfi srfi-37) module?
135 if INSTALL_SRFI_37
136
137 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
138 GOBJECTS += srfi/srfi-37.go
139
140 srfi/srfi-37.scm: srfi/srfi-37.scm.in
141 $(MKDIR_P) srfi
142 cp "$<" "$@"
143
144 endif INSTALL_SRFI_37
145
146 # Handy way to remove the .go files without removing all the rest.
147 clean-go:
148 -$(RM) -f $(GOBJECTS)
149
150
151 SCM_TESTS = \
152 tests/base32.scm \
153 tests/base64.scm \
154 tests/hash.scm \
155 tests/pk-crypto.scm \
156 tests/pki.scm \
157 tests/sets.scm \
158 tests/substitute-binary.scm \
159 tests/builders.scm \
160 tests/derivations.scm \
161 tests/ui.scm \
162 tests/records.scm \
163 tests/utils.scm \
164 tests/build-utils.scm \
165 tests/packages.scm \
166 tests/snix.scm \
167 tests/store.scm \
168 tests/monads.scm \
169 tests/gexp.scm \
170 tests/nar.scm \
171 tests/union.scm \
172 tests/profiles.scm \
173 tests/syscalls.scm \
174 tests/lint.scm
175
176 if HAVE_GUILE_JSON
177
178 MODULES += \
179 guix/import/json.scm \
180 guix/import/pypi.scm \
181 guix/scripts/import/pypi.scm \
182 guix/import/cpan.scm \
183 guix/scripts/import/cpan.scm
184
185 SCM_TESTS += \
186 tests/pypi.scm \
187 tests/cpan.scm
188
189 endif
190
191 SH_TESTS = \
192 tests/guix-build.sh \
193 tests/guix-download.sh \
194 tests/guix-gc.sh \
195 tests/guix-hash.sh \
196 tests/guix-package.sh \
197 tests/guix-system.sh \
198 tests/guix-archive.sh \
199 tests/guix-authenticate.sh \
200 tests/guix-lint.sh
201
202 if BUILD_DAEMON
203
204 SH_TESTS += tests/guix-register.sh
205
206 endif BUILD_DAEMON
207
208
209 TESTS = $(SCM_TESTS) $(SH_TESTS)
210
211 TEST_EXTENSIONS = .scm .sh
212
213 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
214
215 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
216 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
217
218 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
219 AM_SH_LOG_FLAGS = -x -e
220
221 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
222 # could end up removing files from the store while they are being used by
223 # other instances of the daemon.
224 tests/guix-gc.log: \
225 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
226 $(SCM_TESTS:%.scm=%.log)
227
228 # Public key used to sign substitutes from hydra.gnu.org.
229 dist_pkgdata_DATA = hydra.gnu.org.pub
230
231 EXTRA_DIST = \
232 HACKING \
233 ROADMAP \
234 TODO \
235 .dir-locals.el \
236 build-aux/build-self.scm \
237 build-aux/hydra/gnu-system.scm \
238 build-aux/hydra/demo-os.scm \
239 build-aux/hydra/guix.scm \
240 build-aux/check-available-binaries.scm \
241 build-aux/check-final-inputs-self-contained.scm \
242 build-aux/download.scm \
243 build-aux/list-packages.scm \
244 srfi/srfi-37.scm.in \
245 srfi/srfi-64.scm \
246 srfi/srfi-64.upstream.scm \
247 tests/test.drv \
248 tests/signing-key.pub \
249 tests/signing-key.sec \
250 build-aux/config.rpath \
251 bootstrap \
252 release.nix \
253 $(TESTS)
254
255 if !BUILD_DAEMON_OFFLOAD
256
257 EXTRA_DIST += \
258 guix/scripts/offload.scm
259
260 endif !BUILD_DAEMON_OFFLOAD
261
262
263 CLEANFILES = \
264 $(GOBJECTS) \
265 $(SCM_TESTS:tests/%.scm=%.log)
266
267 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
268 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
269 AM_V_GUILEC_0 = @echo " GUILEC" $@;
270
271 # XXX: Use the C locale for when Guile lacks
272 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
273 .scm.go:
274 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
275 LC_ALL=C \
276 $(top_builddir)/pre-inst-env \
277 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
278 -Wformat -Wunbound-variable -Warity-mismatch \
279 --target="$(host)" \
280 -o "$@" "$<"
281
282 SUFFIXES = .go
283
284 # Make sure source files are installed first, so that the mtime of
285 # installed compiled files is greater than that of installed source
286 # files. See
287 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
288 # for details.
289 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
290 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
291
292 # The above trick doesn't work for 'config.go' because both 'config.scm' and
293 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
294 # special treatment.
295 install-data-hook: set-bootstrap-executable-permissions
296 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
297
298
299 SUBDIRS = po/guix po/packages
300 BUILT_SOURCES =
301
302 include doc.am
303
304 if BUILD_DAEMON
305
306 include daemon.am
307
308 endif BUILD_DAEMON
309
310 ACLOCAL_AMFLAGS = -I m4
311 AM_DISTCHECK_CONFIGURE_FLAGS = \
312 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
313 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
314 --with-nix-prefix="$(NIX_PREFIX)" \
315 --enable-daemon
316
317 dist_emacsui_DATA = emacs/guix-main.scm
318 nodist_emacsui_DATA = emacs/guix-helper.scm
319 include emacs.am
320
321 dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
322 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
323
324 sync-descriptions:
325 -$(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
326
327 gen-ChangeLog:
328 if test -d .git; then \
329 $(top_srcdir)/build-aux/gitlog-to-changelog \
330 > $(distdir)/cl-t; \
331 rm -f $(distdir)/ChangeLog; \
332 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
333 fi
334
335 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
336 assert-no-store-file-names:
337 if grep -r --exclude=*.texi --exclude=*.info \
338 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
339 then \
340 echo "error: store file names embedded in the distribution" >&2 ; \
341 exit 1 ; \
342 fi
343
344 # Make sure hydra.gnu.org has the important binaries.
345 assert-binaries-available:
346 $(top_builddir)/pre-inst-env "$(GUILE)" \
347 "$(top_srcdir)/build-aux/check-available-binaries.scm"
348
349 # Make sure the final inputs don't refer to bootstrap tools.
350 assert-final-inputs-self-contained:
351 $(top_builddir)/pre-inst-env "$(GUILE)" \
352 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
353
354 .PHONY: sync-descriptions gen-ChangeLog clean-go
355 .PHONY: assert-no-store-file-names assert-binaries-available
356 .PHONY: assert-final-inputs-self-contained