gnu: nss: Build for aarch64-linux with 64-bit support.
[jackhill/guix/guix.git] / Makefile.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 # Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 # Copyright © 2015, 2017 Alex Kost <alezost@gmail.com>
5 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6 # Copyright © 2016, 2017 Mark H Weaver <mhw@netris.org>
7 #
8 # This file is part of GNU Guix.
9 #
10 # GNU Guix is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GNU Guix is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 bin_SCRIPTS = \
24 scripts/guix
25
26 nodist_noinst_SCRIPTS = \
27 pre-inst-env \
28 test-env
29
30 include gnu/local.mk
31
32 MODULES = \
33 guix/base32.scm \
34 guix/base64.scm \
35 guix/cpio.scm \
36 guix/records.scm \
37 guix/gcrypt.scm \
38 guix/hash.scm \
39 guix/pk-crypto.scm \
40 guix/pki.scm \
41 guix/combinators.scm \
42 guix/memoization.scm \
43 guix/utils.scm \
44 guix/sets.scm \
45 guix/modules.scm \
46 guix/download.scm \
47 guix/git-download.scm \
48 guix/hg-download.scm \
49 guix/monads.scm \
50 guix/monad-repl.scm \
51 guix/gexp.scm \
52 guix/profiles.scm \
53 guix/serialization.scm \
54 guix/nar.scm \
55 guix/derivations.scm \
56 guix/grafts.scm \
57 guix/gnu-maintenance.scm \
58 guix/upstream.scm \
59 guix/licenses.scm \
60 guix/graph.scm \
61 guix/cve.scm \
62 guix/zlib.scm \
63 guix/build-system.scm \
64 guix/build-system/ant.scm \
65 guix/build-system/cargo.scm \
66 guix/build-system/cmake.scm \
67 guix/build-system/dub.scm \
68 guix/build-system/emacs.scm \
69 guix/build-system/asdf.scm \
70 guix/build-system/glib-or-gtk.scm \
71 guix/build-system/gnu.scm \
72 guix/build-system/haskell.scm \
73 guix/build-system/perl.scm \
74 guix/build-system/python.scm \
75 guix/build-system/ocaml.scm \
76 guix/build-system/waf.scm \
77 guix/build-system/r.scm \
78 guix/build-system/ruby.scm \
79 guix/build-system/trivial.scm \
80 guix/ftp-client.scm \
81 guix/http-client.scm \
82 guix/gnupg.scm \
83 guix/elf.scm \
84 guix/store.scm \
85 guix/cvs-download.scm \
86 guix/svn-download.scm \
87 guix/ui.scm \
88 guix/build/ant-build-system.scm \
89 guix/build/download.scm \
90 guix/build/cargo-build-system.scm \
91 guix/build/cmake-build-system.scm \
92 guix/build/dub-build-system.scm \
93 guix/build/emacs-build-system.scm \
94 guix/build/asdf-build-system.scm \
95 guix/build/git.scm \
96 guix/build/hg.scm \
97 guix/build/glib-or-gtk-build-system.scm \
98 guix/build/gnu-build-system.scm \
99 guix/build/gnu-dist.scm \
100 guix/build/perl-build-system.scm \
101 guix/build/python-build-system.scm \
102 guix/build/ocaml-build-system.scm \
103 guix/build/r-build-system.scm \
104 guix/build/ruby-build-system.scm \
105 guix/build/waf-build-system.scm \
106 guix/build/haskell-build-system.scm \
107 guix/build/store-copy.scm \
108 guix/build/utils.scm \
109 guix/build/union.scm \
110 guix/build/profiles.scm \
111 guix/build/pull.scm \
112 guix/build/rpath.scm \
113 guix/build/cvs.scm \
114 guix/build/svn.scm \
115 guix/build/syscalls.scm \
116 guix/build/gremlin.scm \
117 guix/build/emacs-utils.scm \
118 guix/build/lisp-utils.scm \
119 guix/build/graft.scm \
120 guix/build/bournish.scm \
121 guix/build/qt-utils.scm \
122 guix/build/make-bootstrap.scm \
123 guix/search-paths.scm \
124 guix/packages.scm \
125 guix/import/utils.scm \
126 guix/import/gnu.scm \
127 guix/import/snix.scm \
128 guix/import/cabal.scm \
129 guix/import/cran.scm \
130 guix/import/hackage.scm \
131 guix/import/stackage.scm \
132 guix/import/elpa.scm \
133 guix/scripts.scm \
134 guix/scripts/download.scm \
135 guix/scripts/perform-download.scm \
136 guix/scripts/build.scm \
137 guix/scripts/archive.scm \
138 guix/scripts/import.scm \
139 guix/scripts/package.scm \
140 guix/scripts/gc.scm \
141 guix/scripts/hash.scm \
142 guix/scripts/pack.scm \
143 guix/scripts/pull.scm \
144 guix/scripts/substitute.scm \
145 guix/scripts/authenticate.scm \
146 guix/scripts/refresh.scm \
147 guix/scripts/system.scm \
148 guix/scripts/lint.scm \
149 guix/scripts/challenge.scm \
150 guix/scripts/import/cran.scm \
151 guix/scripts/import/gnu.scm \
152 guix/scripts/import/nix.scm \
153 guix/scripts/import/hackage.scm \
154 guix/scripts/import/stackage.scm \
155 guix/scripts/import/elpa.scm \
156 guix/scripts/environment.scm \
157 guix/scripts/publish.scm \
158 guix/scripts/edit.scm \
159 guix/scripts/size.scm \
160 guix/scripts/graph.scm \
161 guix/scripts/container.scm \
162 guix/scripts/container/exec.scm \
163 guix.scm \
164 $(GNU_SYSTEM_MODULES)
165
166 if HAVE_GUILE_JSON
167
168 MODULES += \
169 guix/docker.scm \
170 guix/import/github.scm \
171 guix/import/json.scm \
172 guix/import/crate.scm \
173 guix/scripts/import/crate.scm \
174 guix/import/pypi.scm \
175 guix/scripts/import/pypi.scm \
176 guix/import/cpan.scm \
177 guix/scripts/import/gem.scm \
178 guix/import/gem.scm
179
180 endif
181
182 if HAVE_GUILE_SSH
183
184 MODULES += \
185 guix/ssh.scm \
186 guix/scripts/copy.scm
187
188 endif HAVE_GUILE_SSH
189
190 if BUILD_DAEMON_OFFLOAD
191
192 MODULES += \
193 guix/scripts/offload.scm
194
195 endif BUILD_DAEMON_OFFLOAD
196
197 # Internal modules with test suite support.
198 dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
199
200 # Auxiliary files for packages.
201 AUX_FILES = \
202 gnu/packages/aux-files/emacs/guix-emacs.el \
203 gnu/packages/aux-files/linux-libre/4.10-i686.conf \
204 gnu/packages/aux-files/linux-libre/4.10-x86_64.conf \
205 gnu/packages/aux-files/linux-libre/4.9-i686.conf \
206 gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
207 gnu/packages/aux-files/linux-libre/4.4-i686.conf \
208 gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
209 gnu/packages/aux-files/linux-libre/4.1-i686.conf \
210 gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
211
212 # Templates, examples.
213 EXAMPLES = \
214 gnu/system/examples/bare-bones.tmpl \
215 gnu/system/examples/desktop.tmpl \
216 gnu/system/examples/lightweight-desktop.tmpl
217
218 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
219
220 nobase_dist_guilemodule_DATA = \
221 $(MODULES) $(AUX_FILES) $(EXAMPLES) \
222 $(MISC_DISTRO_FILES)
223 nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
224
225 # Do we need to provide our own non-broken (srfi srfi-37) module?
226 if INSTALL_SRFI_37
227
228 nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
229 GOBJECTS += srfi/srfi-37.go
230
231 srfi/srfi-37.scm: srfi/srfi-37.scm.in
232 $(MKDIR_P) srfi
233 cp "$<" "$@"
234
235 endif INSTALL_SRFI_37
236
237 # Handy way to remove the .go files without removing all the rest.
238 clean-go:
239 -$(RM) -f $(GOBJECTS)
240 @find . -name '*.go' -print | \
241 if test -t 1; then \
242 xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
243 else \
244 xargs -r echo "warning: stray .go files:"; \
245 fi
246
247
248 # Test extensions; has to be unconditional.
249 TEST_EXTENSIONS = .scm .sh
250
251 if CAN_RUN_TESTS
252
253 SCM_TESTS = \
254 tests/base32.scm \
255 tests/base64.scm \
256 tests/cpio.scm \
257 tests/hash.scm \
258 tests/pk-crypto.scm \
259 tests/pki.scm \
260 tests/sets.scm \
261 tests/modules.scm \
262 tests/gnu-maintenance.scm \
263 tests/substitute.scm \
264 tests/builders.scm \
265 tests/derivations.scm \
266 tests/grafts.scm \
267 tests/ui.scm \
268 tests/records.scm \
269 tests/upstream.scm \
270 tests/combinators.scm \
271 tests/utils.scm \
272 tests/build-utils.scm \
273 tests/packages.scm \
274 tests/snix.scm \
275 tests/hackage.scm \
276 tests/cran.scm \
277 tests/elpa.scm \
278 tests/store.scm \
279 tests/monads.scm \
280 tests/gexp.scm \
281 tests/nar.scm \
282 tests/union.scm \
283 tests/profiles.scm \
284 tests/search-paths.scm \
285 tests/syscalls.scm \
286 tests/gremlin.scm \
287 tests/bournish.scm \
288 tests/lint.scm \
289 tests/publish.scm \
290 tests/scripts.scm \
291 tests/size.scm \
292 tests/graph.scm \
293 tests/challenge.scm \
294 tests/cve.scm \
295 tests/zlib.scm \
296 tests/file-systems.scm \
297 tests/system.scm \
298 tests/services.scm \
299 tests/scripts-build.scm \
300 tests/containers.scm \
301 tests/import-utils.scm
302
303 if HAVE_GUILE_JSON
304
305 SCM_TESTS += \
306 tests/pypi.scm \
307 tests/cpan.scm \
308 tests/gem.scm \
309 tests/crate.scm
310
311 endif
312
313 SH_TESTS = \
314 tests/guix-build.sh \
315 tests/guix-download.sh \
316 tests/guix-gc.sh \
317 tests/guix-hash.sh \
318 tests/guix-package.sh \
319 tests/guix-package-net.sh \
320 tests/guix-system.sh \
321 tests/guix-archive.sh \
322 tests/guix-authenticate.sh \
323 tests/guix-environment.sh \
324 tests/guix-environment-container.sh \
325 tests/guix-graph.sh \
326 tests/guix-lint.sh
327
328 if BUILD_DAEMON
329
330 SH_TESTS += tests/guix-register.sh
331
332 endif BUILD_DAEMON
333
334
335 TESTS = $(SCM_TESTS) $(SH_TESTS)
336
337 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
338
339 SCM_LOG_DRIVER = \
340 $(top_builddir)/test-env --quiet-stderr \
341 $(GUILE) --no-auto-compile -e main \
342 $(top_srcdir)/build-aux/test-driver.scm
343
344 AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
345
346 SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
347 AM_SH_LOG_FLAGS = -x -e
348
349 # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
350 # could end up removing files from the store while they are being used by
351 # other instances of the daemon.
352 tests/guix-gc.log: \
353 $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
354 $(SCM_TESTS:%.scm=%.log)
355
356 else !CAN_RUN_TESTS
357
358 TESTS =
359 SH_TESTS =
360 SCM_TESTS =
361
362 # Automake always generates a 'check' target, so better not override it.
363 check-local:
364 @echo
365 @echo "Cannot run tests because file name limits would be exceeded." >&2
366 @echo "Look for 'length' in the 'config.log' file for details." >&2
367 @echo
368 @exit 1
369
370 endif !CAN_RUN_TESTS
371
372 check-system: $(GOBJECTS)
373 $(AM_V_at)$(top_builddir)/pre-inst-env \
374 $(GUILE) --no-auto-compile \
375 -e '(@@ (run-system-tests) run-system-tests)' \
376 $(top_srcdir)/build-aux/run-system-tests.scm
377
378 # Public key used to sign substitutes from hydra.gnu.org.
379 dist_pkgdata_DATA = hydra.gnu.org.pub
380
381 # Bash completion file.
382 dist_bashcompletion_DATA = etc/completion/bash/guix
383
384 # Zsh completion file.
385 dist_zshcompletion_DATA = etc/completion/zsh/_guix
386
387 EXTRA_DIST = \
388 HACKING \
389 ROADMAP \
390 TODO \
391 CODE-OF-CONDUCT \
392 .dir-locals.el \
393 build-aux/build-self.scm \
394 build-aux/compile-all.scm \
395 build-aux/hydra/evaluate.scm \
396 build-aux/hydra/gnu-system.scm \
397 build-aux/hydra/demo-os.scm \
398 build-aux/hydra/guix.scm \
399 build-aux/check-available-binaries.scm \
400 build-aux/check-final-inputs-self-contained.scm \
401 build-aux/download.scm \
402 build-aux/generate-authors.scm \
403 build-aux/test-driver.scm \
404 build-aux/run-system-tests.scm \
405 d3.v3.js \
406 graph.js \
407 srfi/srfi-37.scm.in \
408 srfi/srfi-64.scm \
409 srfi/srfi-64.upstream.scm \
410 tests/test.drv \
411 tests/signing-key.pub \
412 tests/signing-key.sec \
413 tests/cve-sample.xml \
414 build-aux/config.rpath \
415 bootstrap \
416 release.nix \
417 $(TESTS)
418
419 if !BUILD_DAEMON_OFFLOAD
420
421 EXTRA_DIST += \
422 guix/scripts/offload.scm
423
424 endif !BUILD_DAEMON_OFFLOAD
425
426
427 CLEANFILES = \
428 $(GOBJECTS) \
429 $(SCM_TESTS:tests/%.scm=%.log)
430
431 # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
432 # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
433 # there that are newer than the local .scm files (for instance because the
434 # user ran 'make install' recently). When that happens, we end up loading
435 # those previously-installed .go files, which may be stale, thereby breaking
436 # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
437 # stale files from ~/.cache/guile/ccache.
438 %.go: make-go ; @:
439 make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
440 $(AM_V_at)echo "Compiling Scheme modules..." ; \
441 unset GUILE_LOAD_COMPILED_PATH ; \
442 XDG_CACHE_HOME=/nowhere \
443 host=$(host) srcdir="$(top_srcdir)" \
444 $(top_builddir)/pre-inst-env \
445 $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
446 --no-auto-compile \
447 -s "$(top_srcdir)"/build-aux/compile-all.scm $^
448
449 SUFFIXES = .go
450
451 # Make sure source files are installed first, so that the mtime of
452 # installed compiled files is greater than that of installed source
453 # files. See
454 # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
455 # for details.
456 guix_install_go_files = install-nobase_nodist_guilemoduleDATA
457 $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
458
459 # The above trick doesn't work for 'config.go' because both 'config.scm' and
460 # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
461 # special treatment.
462 install-data-hook: set-bootstrap-executable-permissions
463 touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
464
465
466 SUBDIRS = po/guix po/packages
467 BUILT_SOURCES =
468
469 include doc/local.mk
470
471 if BUILD_DAEMON
472
473 include nix/local.mk
474
475 endif BUILD_DAEMON
476
477 ACLOCAL_AMFLAGS = -I m4
478
479 # Pass an explicit '--localstatedir' so that configure does not error out if
480 # it finds an existing installation with a different localstatedir.
481 AM_DISTCHECK_CONFIGURE_FLAGS = \
482 --localstatedir="$$dc_install_base/var" \
483 --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
484 --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
485 --with-nix-prefix="$(NIX_PREFIX)" \
486 --enable-daemon
487
488 # The self-contained tarball.
489 guix-binary.%.tar.xz:
490 $(AM_V_GEN)GUIX_PACKAGE_PATH= \
491 tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
492 -s "$*" guix` ; \
493 cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
494
495
496 dist-hook: sync-descriptions gen-ChangeLog gen-AUTHORS
497 dist-hook: assert-no-store-file-names
498
499 distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
500
501 sync-descriptions:
502 $(AM_V_at)GUIX_PACKAGE_PATH= \
503 $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
504
505 gen-ChangeLog:
506 $(AM_V_GEN)if test -d .git; then \
507 $(top_srcdir)/build-aux/gitlog-to-changelog \
508 > $(distdir)/cl-t; \
509 rm -f $(distdir)/ChangeLog; \
510 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
511 fi
512
513 gen-AUTHORS:
514 $(AM_V_GEN)if test -d .git; then \
515 rm -f "$(distdir)/AUTHORS"; \
516 $(top_builddir)/pre-inst-env "$(GUILE)" \
517 "$(top_srcdir)/build-aux/generate-authors.scm" \
518 "$(top_srcdir)" "$(distdir)/AUTHORS"; \
519 fi
520
521 # Make sure we're not shipping a file that embeds a local /gnu/store file name.
522 assert-no-store-file-names:
523 $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
524 --exclude=*.info-[0-9] --exclude=*.dot \
525 --exclude=*.eps --exclude-dir=bootstrap \
526 --exclude=guix-prettify.el \
527 --exclude=ChangeLog \
528 -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
529 then \
530 echo "error: store file names embedded in the distribution" >&2 ; \
531 exit 1 ; \
532 fi
533
534 # Make sure hydra.gnu.org has the important binaries.
535 assert-binaries-available: $(GOBJECTS)
536 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
537 "$(top_srcdir)/build-aux/check-available-binaries.scm"
538
539 # Make sure the final inputs don't refer to bootstrap tools.
540 assert-final-inputs-self-contained: $(GOBJECTS)
541 $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
542 "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
543
544 # Compute the Hydra jobs and write them in the target file.
545 hydra-jobs.scm: $(GOBJECTS)
546 $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
547 $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
548 "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
549 "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
550 $(AM_V_at)mv "$@.tmp" "$@"
551
552 .PHONY: sync-descriptions gen-ChangeLog gen-AUTHORS clean-go make-go
553 .PHONY: assert-no-store-file-names assert-binaries-available
554 .PHONY: assert-final-inputs-self-contained
555
556 ## -------------- ##
557 ## Silent rules. ##
558 ## -------------- ##
559
560 AM_V_DL = $(AM_V_DL_$(V))
561 AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
562 AM_V_DL_0 = @echo " DL " $@;
563
564 AM_V_DOT = $(AM_V_DOT_$(V))
565 AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
566 AM_V_DOT_0 = @echo " DOT " $@;
567
568 AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
569 AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
570 AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;