projects/guix·blob v0.3 · refs

257 lines · 7.1 KiB

1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013 Ludovic Courtès <[email protected]>
3# Copyright © 2013 Andreas Enge <[email protected]>
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
20bin_SCRIPTS = \
21 scripts/guix
22
23nodist_noinst_SCRIPTS = \
24 pre-inst-env \
25 test-env
26
27include gnu-system.am
28
29MODULES = \
30 guix/scripts/build.scm \
31 guix/scripts/download.scm \
32 guix/scripts/import.scm \
33 guix/scripts/package.scm \
34 guix/scripts/gc.scm \
35 guix/scripts/hash.scm \
36 guix/scripts/pull.scm \
37 guix/scripts/substitute-binary.scm \
38 guix/scripts/refresh.scm \
39 guix/base32.scm \
40 guix/records.scm \
41 guix/hash.scm \
42 guix/utils.scm \
43 guix/serialization.scm \
44 guix/nar.scm \
45 guix/derivations.scm \
46 guix/download.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/gnu.scm \
52 guix/build-system/perl.scm \
53 guix/build-system/python.scm \
54 guix/build-system/trivial.scm \
55 guix/ftp-client.scm \
56 guix/http-client.scm \
57 guix/gnupg.scm \
58 guix/store.scm \
59 guix/ui.scm \
60 guix/build/download.scm \
61 guix/build/cmake-build-system.scm \
62 guix/build/gnu-build-system.scm \
63 guix/build/perl-build-system.scm \
64 guix/build/python-build-system.scm \
65 guix/build/utils.scm \
66 guix/build/union.scm \
67 guix/build/rpath.scm \
68 guix/packages.scm \
69 guix/snix.scm \
70 guix.scm \
71 $(GNU_SYSTEM_MODULES)
72
73# Because of the autoload hack in (guix build download), we must build it
74# first to avoid errors on systems where (gnutls) is unavailable.
75guix/scripts/download.go: guix/build/download.go
76
77
78GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go
79
80nobase_dist_guilemodule_DATA = $(MODULES)
81nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
82
83# Do we need to provide our own non-broken (srfi srfi-37) module?
84if INSTALL_SRFI_37
85
86nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
87GOBJECTS += srfi/srfi-37.go
88
89srfi/srfi-37.scm: srfi/srfi-37.scm.in
90 $(MKDIR_P) srfi
91 cp "$<" "$@"
92
93endif INSTALL_SRFI_37
94
95
96SCM_TESTS = \
97 tests/base32.scm \
98 tests/hash.scm \
99 tests/builders.scm \
100 tests/derivations.scm \
101 tests/ui.scm \
102 tests/records.scm \
103 tests/utils.scm \
104 tests/build-utils.scm \
105 tests/packages.scm \
106 tests/snix.scm \
107 tests/store.scm \
108 tests/nar.scm \
109 tests/union.scm
110
111SH_TESTS = \
112 tests/guix-build.sh \
113 tests/guix-download.sh \
114 tests/guix-gc.sh \
115 tests/guix-hash.sh \
116 tests/guix-package.sh
117
118TESTS = $(SCM_TESTS) $(SH_TESTS)
119
120TEST_EXTENSIONS = .scm .sh
121
122AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
123
124SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
125AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
126
127SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
128AM_SH_LOG_FLAGS = -x -e
129
130# Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
131# could end up removing files from the store while they are being used by
132# other instances of the daemon.
133tests/guix-gc.log: \
134 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
135 $(SCM_TESTS:%.scm=%.log)
136
137
138EXTRA_DIST = \
139 HACKING \
140 ROADMAP \
141 TODO \
142 .dir-locals.el \
143 build-aux/hydra/gnu-system.scm \
144 build-aux/check-available-binaries.scm \
145 build-aux/download.scm \
146 build-aux/list-packages.scm \
147 build-aux/sync-synopses.scm \
148 srfi/srfi-37.scm.in \
149 srfi/srfi-64.scm \
150 srfi/srfi-64.upstream.scm \
151 tests/test.drv \
152 build-aux/config.rpath \
153 bootstrap \
154 release.nix \
155 $(TESTS)
156
157CLEANFILES = \
158 $(GOBJECTS) \
159 $(SCM_TESTS:tests/%.scm=%.log)
160
161AM_V_GUILEC = $(AM_V_GUILEC_$(V))
162AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
163AM_V_GUILEC_0 = @echo " GUILEC" $@;
164
165# XXX: Use the C locale for when Guile lacks
166# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
167.scm.go:
168 $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
169 LC_ALL=C \
170 $(top_builddir)/pre-inst-env \
171 $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
172 -Wformat -Wunbound-variable -Warity-mismatch \
173 --target="$(host)" \
174 -o "$@" "$<"
175
176SUFFIXES = .go
177
178# Make sure source files are installed first, so that the mtime of
179# installed compiled files is greater than that of installed source
180# files. See
181# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
182# for details.
183guix_install_go_files = install-nobase_nodist_guilemoduleDATA
184$(guix_install_go_files): install-nobase_dist_guilemoduleDATA
185
186SUBDIRS = po
187
188info_TEXINFOS = doc/guix.texi
189EXTRA_DIST += \
190 doc/fdl-1.3.texi \
191 doc/images/bootstrap-graph.dot \
192 doc/images/bootstrap-graph.eps
193
194infoimagedir = $(infodir)/images
195dist_infoimage_DATA = doc/images/bootstrap-graph.png
196
197# Try hard to obtain an image size and aspect that's reasonable for inclusion
198# in an Info or PDF document.
199DOT_OPTIONS = \
200 -Tpng -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
201 -Nfontsize=9 -Nheight=.1 -Nwidth=.1
202
203.dot.png:
204 dot -Tpng $(DOT_OPTIONS) < "$<" > "[email protected]"
205 mv "[email protected]" "$@"
206
207.dot.eps:
208 dot -Teps $(DOT_OPTIONS) < "$<" > "[email protected]"
209 mv "[email protected]" "$@"
210
211doc/guix.pdf: doc/images/bootstrap-graph.png
212doc/guix.info: doc/images/bootstrap-graph.png
213doc/guix.ps: doc/images/bootstrap-graph.eps
214
215if BUILD_DAEMON
216
217include daemon.am
218
219endif BUILD_DAEMON
220
221ACLOCAL_AMFLAGS = -I m4
222AM_DISTCHECK_CONFIGURE_FLAGS = \
223 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
224 --with-nix-prefix="$(NIX_PREFIX)" \
225 --enable-daemon
226
227dist-hook: sync-synopses gen-ChangeLog assert-no-store-file-names
228distcheck-hook: assert-binaries-available
229
230sync-synopses:
231 -$(top_builddir)/pre-inst-env $(GUILE) \
232 $(top_srcdir)/build-aux/sync-synopses.scm
233
234gen-ChangeLog:
235 if test -d .git; then \
236 $(top_srcdir)/build-aux/gitlog-to-changelog \
237 > $(distdir)/cl-t; \
238 rm -f $(distdir)/ChangeLog; \
239 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
240 fi
241
242# Make sure we're not shipping a file that embeds a local /nix/store file name.
243assert-no-store-file-names:
244 if grep -r --exclude=*.texi --exclude=*.info \
245 "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
246 then \
247 echo "error: store file names embedded in the distribution" >&2 ; \
248 exit 1 ; \
249 fi
250
251# Make sure hydra.gnu.org has the important binaries.
252assert-binaries-available:
253 $(top_builddir)/pre-inst-env "$(GUILE)" \
254 "$(top_srcdir)/build-aux/check-available-binaries.scm"
255
256.PHONY: sync-synopses gen-ChangeLog
257.PHONY: assert-no-store-file-names assert-binaries-available