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.
 
 
 
 
 
 

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