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.
 
 
 
 
 
 

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