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.
 
 
 
 
 
 

549 lines
16 KiB

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