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