import: hackage: Add recognition of 'true' and 'false' symbols.
[guix.git] / Makefile.am
blob43be2ec89ef15f83a31acd0828099b182fd072bb
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 # Copyright © 2015 Alex Kost <alezost@gmail.com>
6 # This file is part of GNU Guix.
8 # GNU Guix is free software; you can redistribute it and/or modify it
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.
13 # GNU Guix is distributed in the hope that it will be useful, but
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.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
21 bin_SCRIPTS =                                   \
22   scripts/guix
24 nodist_noinst_SCRIPTS =                         \
25   pre-inst-env                                  \
26   test-env
28 include gnu-system.am
30 MODULES =                                       \
31   guix/base32.scm                               \
32   guix/base64.scm                               \
33   guix/cpio.scm                                 \
34   guix/records.scm                              \
35   guix/gcrypt.scm                               \
36   guix/hash.scm                                 \
37   guix/pk-crypto.scm                            \
38   guix/pki.scm                                  \
39   guix/utils.scm                                \
40   guix/sets.scm                                 \
41   guix/download.scm                             \
42   guix/git-download.scm                         \
43   guix/monads.scm                               \
44   guix/monad-repl.scm                           \
45   guix/gexp.scm                                 \
46   guix/profiles.scm                             \
47   guix/serialization.scm                        \
48   guix/nar.scm                                  \
49   guix/derivations.scm                          \
50   guix/gnu-maintenance.scm                      \
51   guix/upstream.scm                             \
52   guix/licenses.scm                             \
53   guix/graph.scm                                \
54   guix/build-system.scm                         \
55   guix/build-system/cmake.scm                   \
56   guix/build-system/emacs.scm                   \
57   guix/build-system/glib-or-gtk.scm             \
58   guix/build-system/gnu.scm                     \
59   guix/build-system/haskell.scm                 \
60   guix/build-system/perl.scm                    \
61   guix/build-system/python.scm                  \
62   guix/build-system/waf.scm                     \
63   guix/build-system/r.scm                       \
64   guix/build-system/ruby.scm                    \
65   guix/build-system/trivial.scm                 \
66   guix/ftp-client.scm                           \
67   guix/http-client.scm                          \
68   guix/gnupg.scm                                \
69   guix/elf.scm                                  \
70   guix/store.scm                                \
71   guix/cvs-download.scm                         \
72   guix/svn-download.scm                         \
73   guix/ui.scm                                   \
74   guix/build/download.scm                       \
75   guix/build/cmake-build-system.scm             \
76   guix/build/emacs-build-system.scm             \
77   guix/build/git.scm                            \
78   guix/build/glib-or-gtk-build-system.scm       \
79   guix/build/gnu-build-system.scm               \
80   guix/build/gnu-dist.scm                       \
81   guix/build/perl-build-system.scm              \
82   guix/build/python-build-system.scm            \
83   guix/build/r-build-system.scm                 \
84   guix/build/ruby-build-system.scm              \
85   guix/build/waf-build-system.scm               \
86   guix/build/haskell-build-system.scm           \
87   guix/build/store-copy.scm                     \
88   guix/build/utils.scm                          \
89   guix/build/union.scm                          \
90   guix/build/profiles.scm                       \
91   guix/build/pull.scm                           \
92   guix/build/rpath.scm                          \
93   guix/build/cvs.scm                            \
94   guix/build/svn.scm                            \
95   guix/build/gremlin.scm                        \
96   guix/build/emacs-utils.scm                    \
97   guix/build/graft.scm                          \
98   guix/search-paths.scm                         \
99   guix/packages.scm                             \
100   guix/import/utils.scm                         \
101   guix/import/gnu.scm                           \
102   guix/import/snix.scm                          \
103   guix/import/cabal.scm                         \
104   guix/import/cran.scm                          \
105   guix/import/hackage.scm                       \
106   guix/import/elpa.scm                          \
107   guix/scripts.scm                              \
108   guix/scripts/download.scm                     \
109   guix/scripts/build.scm                        \
110   guix/scripts/archive.scm                      \
111   guix/scripts/import.scm                       \
112   guix/scripts/package.scm                      \
113   guix/scripts/gc.scm                           \
114   guix/scripts/hash.scm                         \
115   guix/scripts/pull.scm                         \
116   guix/scripts/substitute.scm                   \
117   guix/scripts/authenticate.scm                 \
118   guix/scripts/refresh.scm                      \
119   guix/scripts/system.scm                       \
120   guix/scripts/lint.scm                         \
121   guix/scripts/challenge.scm                    \
122   guix/scripts/import/cran.scm                  \
123   guix/scripts/import/gnu.scm                   \
124   guix/scripts/import/nix.scm                   \
125   guix/scripts/import/hackage.scm               \
126   guix/scripts/import/elpa.scm                  \
127   guix/scripts/environment.scm                  \
128   guix/scripts/publish.scm                      \
129   guix/scripts/edit.scm                         \
130   guix/scripts/size.scm                         \
131   guix/scripts/graph.scm                        \
132   guix/scripts/container.scm                    \
133   guix/scripts/container/exec.scm               \
134   guix.scm                                      \
135   $(GNU_SYSTEM_MODULES)
137 if BUILD_SYSCALLS_MODULE
139 MODULES +=                                      \
140   guix/build/syscalls.scm
142 endif
144 if BUILD_DAEMON_OFFLOAD
146 MODULES +=                                      \
147   guix/scripts/offload.scm
149 endif BUILD_DAEMON_OFFLOAD
151 # Internal module with test suite support.
152 dist_noinst_DATA = guix/tests.scm
154 # Because of the autoload hack in (guix build download), we must build it
155 # first to avoid errors on systems where (gnutls) is unavailable.
156 guix/scripts/download.go: guix/build/download.go
157 guix/download.go: guix/build/download.go
159 # Linux-Libre configurations.
160 KCONFIGS =                                      \
161   gnu/packages/linux-libre-i686.conf            \
162   gnu/packages/linux-libre-x86_64.conf
164 # Templates, examples.
165 EXAMPLES =                                      \
166   gnu/system/examples/bare-bones.tmpl           \
167   gnu/system/examples/desktop.tmpl
169 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
171 nobase_dist_guilemodule_DATA =                  \
172   $(MODULES) $(KCONFIGS) $(EXAMPLES)            \
173   $(MISC_DISTRO_FILES)
174 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
176 # Do we need to provide our own non-broken (srfi srfi-37) module?
177 if INSTALL_SRFI_37
179 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
180 GOBJECTS += srfi/srfi-37.go
182 srfi/srfi-37.scm: srfi/srfi-37.scm.in
183         $(MKDIR_P) srfi
184         cp "$<" "$@"
186 endif INSTALL_SRFI_37
188 # Handy way to remove the .go files without removing all the rest.
189 clean-go:
190         -$(RM) -f $(GOBJECTS)
193 SCM_TESTS =                                     \
194   tests/base32.scm                              \
195   tests/base64.scm                              \
196   tests/cpio.scm                                \
197   tests/hash.scm                                \
198   tests/pk-crypto.scm                           \
199   tests/pki.scm                                 \
200   tests/sets.scm                                \
201   tests/substitute.scm                          \
202   tests/builders.scm                            \
203   tests/derivations.scm                         \
204   tests/ui.scm                                  \
205   tests/records.scm                             \
206   tests/utils.scm                               \
207   tests/build-utils.scm                         \
208   tests/packages.scm                            \
209   tests/snix.scm                                \
210   tests/hackage.scm                             \
211   tests/cran.scm                                \
212   tests/elpa.scm                                \
213   tests/store.scm                               \
214   tests/monads.scm                              \
215   tests/gexp.scm                                \
216   tests/nar.scm                                 \
217   tests/union.scm                               \
218   tests/profiles.scm                            \
219   tests/syscalls.scm                            \
220   tests/gremlin.scm                             \
221   tests/lint.scm                                \
222   tests/publish.scm                             \
223   tests/scripts.scm                             \
224   tests/size.scm                                \
225   tests/graph.scm                               \
226   tests/challenge.scm                           \
227   tests/file-systems.scm                        \
228   tests/services.scm                            \
229   tests/containers.scm
231 if HAVE_GUILE_JSON
233 MODULES +=                                      \
234   guix/import/json.scm                          \
235   guix/import/pypi.scm                          \
236   guix/scripts/import/pypi.scm                  \
237   guix/import/cpan.scm                          \
238   guix/scripts/import/gem.scm                   \
239   guix/import/gem.scm
241 SCM_TESTS +=                                    \
242   tests/pypi.scm                                \
243   tests/cpan.scm                                \
244   tests/gem.scm
246 endif
248 SH_TESTS =                                      \
249   tests/guix-build.sh                           \
250   tests/guix-download.sh                        \
251   tests/guix-gc.sh                              \
252   tests/guix-hash.sh                            \
253   tests/guix-package.sh                         \
254   tests/guix-package-net.sh                     \
255   tests/guix-system.sh                          \
256   tests/guix-archive.sh                         \
257   tests/guix-authenticate.sh                    \
258   tests/guix-environment.sh                     \
259   tests/guix-environment-container.sh           \
260   tests/guix-graph.sh                           \
261   tests/guix-lint.sh
263 if BUILD_DAEMON
265 SH_TESTS += tests/guix-register.sh
267 endif BUILD_DAEMON
270 TESTS = $(SCM_TESTS) $(SH_TESTS)
272 TEST_EXTENSIONS = .scm .sh
274 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
276 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
277 AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
279 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
280 AM_SH_LOG_FLAGS = -x -e
282 # Make sure `tests/guix-gc.sh' runs last, after all the others.  Otherwise it
283 # could end up removing files from the store while they are being used by
284 # other instances of the daemon.
285 tests/guix-gc.log:                                                      \
286   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))     \
287   $(SCM_TESTS:%.scm=%.log)
289 # Public key used to sign substitutes from hydra.gnu.org.
290 dist_pkgdata_DATA = hydra.gnu.org.pub
292 # Bash completion file.
293 dist_bashcompletion_DATA = etc/completion/bash/guix
295 EXTRA_DIST =                                            \
296   HACKING                                               \
297   ROADMAP                                               \
298   TODO                                                  \
299   .dir-locals.el                                        \
300   build-aux/build-self.scm                              \
301   build-aux/hydra/gnu-system.scm                        \
302   build-aux/hydra/demo-os.scm                           \
303   build-aux/hydra/guix.scm                              \
304   build-aux/check-available-binaries.scm                \
305   build-aux/check-final-inputs-self-contained.scm       \
306   build-aux/download.scm                                \
307   build-aux/make-binary-tarball.scm                     \
308   build-aux/generate-authors.scm                        \
309   srfi/srfi-37.scm.in                                   \
310   srfi/srfi-64.scm                                      \
311   srfi/srfi-64.upstream.scm                             \
312   tests/test.drv                                        \
313   tests/signing-key.pub                                 \
314   tests/signing-key.sec                                 \
315   build-aux/config.rpath                                \
316   bootstrap                                             \
317   release.nix                                           \
318   $(TESTS)
320 if !BUILD_DAEMON_OFFLOAD
322 EXTRA_DIST +=                                   \
323   guix/scripts/offload.scm
325 endif !BUILD_DAEMON_OFFLOAD
327 if !BUILD_SYSCALLS_MODULE
329 EXTRA_DIST +=                                   \
330   guix/build/syscalls.scm
332 endif !BUILD_SYSCALLS_MODULE
335 CLEANFILES =                                    \
336   $(GOBJECTS)                                   \
337   $(SCM_TESTS:tests/%.scm=%.log)
339 AM_V_GUILEC = $(AM_V_GUILEC_$(V))
340 AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
341 AM_V_GUILEC_0 = @echo "  GUILEC" $@;
343 # Flags passed to 'guild compile'.
344 GUILD_COMPILE_FLAGS =                           \
345   -Wformat -Wunbound-variable -Warity-mismatch
347 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling.  Otherwise, if
348 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
349 # there that are newer than the local .scm files (for instance because the
350 # user ran 'make install' recently).  When that happens, we end up loading
351 # those previously-installed .go files, which may be stale, thereby breaking
352 # the whole thing.
354 # XXX: Use the C locale for when Guile lacks
355 # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
356 .scm.go:
357         $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ;                       \
358         unset GUILE_LOAD_COMPILED_PATH ;                                \
359         LC_ALL=C                                                        \
360         $(top_builddir)/pre-inst-env                                    \
361         $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)"        \
362           $(GUILD_COMPILE_FLAGS) --target="$(host)"                     \
363           -o "$@" "$<"
365 SUFFIXES = .go
367 # Make sure source files are installed first, so that the mtime of
368 # installed compiled files is greater than that of installed source
369 # files.  See
370 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
371 # for details.
372 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
373 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
375 # The above trick doesn't work for 'config.go' because both 'config.scm' and
376 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA).  Thus, give it
377 # special treatment.
378 install-data-hook: set-bootstrap-executable-permissions
379         touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
382 SUBDIRS = po/guix po/packages
383 BUILT_SOURCES =
385 include doc.am
387 if BUILD_DAEMON
389 include daemon.am
391 endif BUILD_DAEMON
393 ACLOCAL_AMFLAGS = -I m4
394 AM_DISTCHECK_CONFIGURE_FLAGS =                  \
395   --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
396   --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
397   --with-nix-prefix="$(NIX_PREFIX)"             \
398   --enable-daemon
400 dist_emacsui_DATA = emacs/guix-main.scm
401 nodist_emacsui_DATA = emacs/guix-helper.scm
402 include emacs.am
404 # The self-contained tarball.
405 guix-binary.%.tar.xz:
406         -GUIX_PACKAGE_PATH= \
407         $(top_builddir)/pre-inst-env "$(GUILE)"                 \
408           "$(top_srcdir)/build-aux/make-binary-tarball.scm" "$*" "$@"
411 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
412 dist-hook: assert-no-store-file-names
414 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
416 sync-descriptions:
417         -GUIX_PACKAGE_PATH= \
418          $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
420 gen-ChangeLog:
421         if test -d .git; then                           \
422           $(top_srcdir)/build-aux/gitlog-to-changelog   \
423             > $(distdir)/cl-t;                          \
424           rm -f $(distdir)/ChangeLog;                   \
425           mv $(distdir)/cl-t $(distdir)/ChangeLog;      \
426         fi
428 gen-AUTHORS:
429         if test -d .git; then                                   \
430           rm -f "$(distdir)/AUTHORS";                           \
431           $(top_builddir)/pre-inst-env "$(GUILE)"               \
432             "$(top_srcdir)/build-aux/generate-authors.scm"      \
433             "$(top_srcdir)" "$(distdir)/AUTHORS";               \
434         fi
436 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
437 assert-no-store-file-names:
438         if grep -r --exclude=*.texi --exclude=*.info                            \
439              "$(storedir)/[a-z0-9]{32}-" $(distdir) ;                           \
440         then                                                                    \
441           echo "error: store file names embedded in the distribution" >&2 ;     \
442           exit 1 ;                                                              \
443         fi
445 # Make sure hydra.gnu.org has the important binaries.
446 assert-binaries-available:
447         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
448           "$(top_srcdir)/build-aux/check-available-binaries.scm"
450 # Make sure the final inputs don't refer to bootstrap tools.
451 assert-final-inputs-self-contained:
452         $(top_builddir)/pre-inst-env "$(GUILE)"                         \
453           "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
455 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go
456 .PHONY: assert-no-store-file-names assert-binaries-available
457 .PHONY: assert-final-inputs-self-contained