You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

574 lines
16 KiB

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