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.
 
 
 
 
 
 

381 lines
11 KiB

  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
  3. # Copyright © 2013 Andreas Enge <andreas@enge.fr>
  4. #
  5. # This file is part of GNU Guix.
  6. #
  7. # GNU Guix is free software; you can redistribute it and/or modify it
  8. # under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # GNU Guix is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. bin_SCRIPTS = \
  20. scripts/guix
  21. nodist_noinst_SCRIPTS = \
  22. pre-inst-env \
  23. test-env
  24. include gnu-system.am
  25. MODULES = \
  26. guix/base32.scm \
  27. guix/base64.scm \
  28. guix/records.scm \
  29. guix/gcrypt.scm \
  30. guix/hash.scm \
  31. guix/pk-crypto.scm \
  32. guix/pki.scm \
  33. guix/utils.scm \
  34. guix/sets.scm \
  35. guix/download.scm \
  36. guix/git-download.scm \
  37. guix/monads.scm \
  38. guix/monad-repl.scm \
  39. guix/gexp.scm \
  40. guix/profiles.scm \
  41. guix/serialization.scm \
  42. guix/nar.scm \
  43. guix/derivations.scm \
  44. guix/gnu-maintenance.scm \
  45. guix/licenses.scm \
  46. guix/build-system.scm \
  47. guix/build-system/cmake.scm \
  48. guix/build-system/glib-or-gtk.scm \
  49. guix/build-system/gnu.scm \
  50. guix/build-system/perl.scm \
  51. guix/build-system/python.scm \
  52. guix/build-system/waf.scm \
  53. guix/build-system/ruby.scm \
  54. guix/build-system/trivial.scm \
  55. guix/ftp-client.scm \
  56. guix/http-client.scm \
  57. guix/gnupg.scm \
  58. guix/elf.scm \
  59. guix/store.scm \
  60. guix/cvs-download.scm \
  61. guix/svn-download.scm \
  62. guix/ui.scm \
  63. guix/build/download.scm \
  64. guix/build/cmake-build-system.scm \
  65. guix/build/git.scm \
  66. guix/build/glib-or-gtk-build-system.scm \
  67. guix/build/gnu-build-system.scm \
  68. guix/build/gnu-dist.scm \
  69. guix/build/perl-build-system.scm \
  70. guix/build/python-build-system.scm \
  71. guix/build/ruby-build-system.scm \
  72. guix/build/waf-build-system.scm \
  73. guix/build/store-copy.scm \
  74. guix/build/utils.scm \
  75. guix/build/union.scm \
  76. guix/build/pull.scm \
  77. guix/build/rpath.scm \
  78. guix/build/cvs.scm \
  79. guix/build/svn.scm \
  80. guix/build/syscalls.scm \
  81. guix/build/gremlin.scm \
  82. guix/build/emacs-utils.scm \
  83. guix/build/graft.scm \
  84. guix/packages.scm \
  85. guix/import/utils.scm \
  86. guix/import/gnu.scm \
  87. guix/import/snix.scm \
  88. guix/scripts/download.scm \
  89. guix/scripts/build.scm \
  90. guix/scripts/archive.scm \
  91. guix/scripts/import.scm \
  92. guix/scripts/package.scm \
  93. guix/scripts/gc.scm \
  94. guix/scripts/hash.scm \
  95. guix/scripts/pull.scm \
  96. guix/scripts/substitute.scm \
  97. guix/scripts/authenticate.scm \
  98. guix/scripts/refresh.scm \
  99. guix/scripts/system.scm \
  100. guix/scripts/lint.scm \
  101. guix/scripts/import/gnu.scm \
  102. guix/scripts/import/nix.scm \
  103. guix/scripts/environment.scm \
  104. guix/scripts/publish.scm \
  105. guix.scm \
  106. $(GNU_SYSTEM_MODULES)
  107. if BUILD_DAEMON_OFFLOAD
  108. MODULES += \
  109. guix/scripts/offload.scm
  110. endif BUILD_DAEMON_OFFLOAD
  111. # Internal module with test suite support.
  112. dist_noinst_DATA = guix/tests.scm
  113. # Because of the autoload hack in (guix build download), we must build it
  114. # first to avoid errors on systems where (gnutls) is unavailable.
  115. guix/scripts/download.go: guix/build/download.go
  116. guix/download.go: guix/build/download.go
  117. # Linux-Libre configurations.
  118. KCONFIGS = \
  119. gnu/packages/linux-libre-i686.conf \
  120. gnu/packages/linux-libre-x86_64.conf
  121. # Templates, examples.
  122. EXAMPLES = \
  123. gnu/system/os-config.tmpl
  124. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
  125. nobase_dist_guilemodule_DATA = \
  126. $(MODULES) $(KCONFIGS) $(EXAMPLES) \
  127. $(MISC_DISTRO_FILES)
  128. nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
  129. # Do we need to provide our own non-broken (srfi srfi-37) module?
  130. if INSTALL_SRFI_37
  131. nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
  132. GOBJECTS += srfi/srfi-37.go
  133. srfi/srfi-37.scm: srfi/srfi-37.scm.in
  134. $(MKDIR_P) srfi
  135. cp "$<" "$@"
  136. endif INSTALL_SRFI_37
  137. # Handy way to remove the .go files without removing all the rest.
  138. clean-go:
  139. -$(RM) -f $(GOBJECTS)
  140. SCM_TESTS = \
  141. tests/base32.scm \
  142. tests/base64.scm \
  143. tests/hash.scm \
  144. tests/pk-crypto.scm \
  145. tests/pki.scm \
  146. tests/sets.scm \
  147. tests/substitute.scm \
  148. tests/builders.scm \
  149. tests/derivations.scm \
  150. tests/ui.scm \
  151. tests/records.scm \
  152. tests/utils.scm \
  153. tests/build-utils.scm \
  154. tests/packages.scm \
  155. tests/snix.scm \
  156. tests/store.scm \
  157. tests/monads.scm \
  158. tests/gexp.scm \
  159. tests/nar.scm \
  160. tests/union.scm \
  161. tests/profiles.scm \
  162. tests/syscalls.scm \
  163. tests/gremlin.scm \
  164. tests/lint.scm \
  165. tests/publish.scm
  166. if HAVE_GUILE_JSON
  167. MODULES += \
  168. guix/import/json.scm \
  169. guix/import/pypi.scm \
  170. guix/scripts/import/pypi.scm \
  171. guix/import/cpan.scm \
  172. guix/scripts/import/cpan.scm
  173. SCM_TESTS += \
  174. tests/pypi.scm \
  175. tests/cpan.scm
  176. endif
  177. SH_TESTS = \
  178. tests/guix-build.sh \
  179. tests/guix-download.sh \
  180. tests/guix-gc.sh \
  181. tests/guix-hash.sh \
  182. tests/guix-package.sh \
  183. tests/guix-package-net.sh \
  184. tests/guix-system.sh \
  185. tests/guix-archive.sh \
  186. tests/guix-authenticate.sh \
  187. tests/guix-lint.sh
  188. if BUILD_DAEMON
  189. SH_TESTS += tests/guix-register.sh
  190. endif BUILD_DAEMON
  191. TESTS = $(SCM_TESTS) $(SH_TESTS)
  192. TEST_EXTENSIONS = .scm .sh
  193. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
  194. SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
  195. AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
  196. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  197. AM_SH_LOG_FLAGS = -x -e
  198. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  199. # could end up removing files from the store while they are being used by
  200. # other instances of the daemon.
  201. tests/guix-gc.log: \
  202. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  203. $(SCM_TESTS:%.scm=%.log)
  204. # Public key used to sign substitutes from hydra.gnu.org.
  205. dist_pkgdata_DATA = hydra.gnu.org.pub
  206. # Bash completion file.
  207. dist_bashcompletion_DATA = etc/completion/bash/guix
  208. EXTRA_DIST = \
  209. HACKING \
  210. ROADMAP \
  211. TODO \
  212. .dir-locals.el \
  213. build-aux/build-self.scm \
  214. build-aux/hydra/gnu-system.scm \
  215. build-aux/hydra/demo-os.scm \
  216. build-aux/hydra/guix.scm \
  217. build-aux/check-available-binaries.scm \
  218. build-aux/check-final-inputs-self-contained.scm \
  219. build-aux/download.scm \
  220. build-aux/list-packages.scm \
  221. srfi/srfi-37.scm.in \
  222. srfi/srfi-64.scm \
  223. srfi/srfi-64.upstream.scm \
  224. tests/test.drv \
  225. tests/signing-key.pub \
  226. tests/signing-key.sec \
  227. build-aux/config.rpath \
  228. bootstrap \
  229. release.nix \
  230. $(TESTS)
  231. if !BUILD_DAEMON_OFFLOAD
  232. EXTRA_DIST += \
  233. guix/scripts/offload.scm
  234. endif !BUILD_DAEMON_OFFLOAD
  235. CLEANFILES = \
  236. $(GOBJECTS) \
  237. $(SCM_TESTS:tests/%.scm=%.log)
  238. AM_V_GUILEC = $(AM_V_GUILEC_$(V))
  239. AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
  240. AM_V_GUILEC_0 = @echo " GUILEC" $@;
  241. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  242. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  243. # there that are newer than the local .scm files (for instance because the
  244. # user ran 'make install' recently). When that happens, we end up loading
  245. # those previously-installed .go files, which may be stale, thereby breaking
  246. # the whole thing.
  247. #
  248. # XXX: Use the C locale for when Guile lacks
  249. # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  250. .scm.go:
  251. $(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
  252. unset GUILE_LOAD_COMPILED_PATH ; \
  253. LC_ALL=C \
  254. $(top_builddir)/pre-inst-env \
  255. $(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \
  256. -Wformat -Wunbound-variable -Warity-mismatch \
  257. --target="$(host)" \
  258. -o "$@" "$<"
  259. SUFFIXES = .go
  260. # Make sure source files are installed first, so that the mtime of
  261. # installed compiled files is greater than that of installed source
  262. # files. See
  263. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  264. # for details.
  265. guix_install_go_files = install-nobase_nodist_guilemoduleDATA
  266. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  267. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  268. # 'config.go' are listed in $(nobase_nodist_guilemodule_DATA). Thus, give it
  269. # special treatment.
  270. install-data-hook: set-bootstrap-executable-permissions
  271. touch "$(DESTDIR)$(guilemoduledir)/guix/config.go"
  272. SUBDIRS = po/guix po/packages
  273. BUILT_SOURCES =
  274. include doc.am
  275. if BUILD_DAEMON
  276. include daemon.am
  277. endif BUILD_DAEMON
  278. ACLOCAL_AMFLAGS = -I m4
  279. AM_DISTCHECK_CONFIGURE_FLAGS = \
  280. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  281. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  282. --with-nix-prefix="$(NIX_PREFIX)" \
  283. --enable-daemon
  284. dist_emacsui_DATA = emacs/guix-main.scm
  285. nodist_emacsui_DATA = emacs/guix-helper.scm
  286. include emacs.am
  287. dist-hook: sync-descriptions gen-ChangeLog assert-no-store-file-names
  288. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  289. sync-descriptions:
  290. -GUIX_PACKAGE_PATH= \
  291. $(top_builddir)/pre-inst-env guix lint --checkers=gnu-description
  292. gen-ChangeLog:
  293. if test -d .git; then \
  294. $(top_srcdir)/build-aux/gitlog-to-changelog \
  295. > $(distdir)/cl-t; \
  296. rm -f $(distdir)/ChangeLog; \
  297. mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  298. fi
  299. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  300. assert-no-store-file-names:
  301. if grep -r --exclude=*.texi --exclude=*.info \
  302. "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  303. then \
  304. echo "error: store file names embedded in the distribution" >&2 ; \
  305. exit 1 ; \
  306. fi
  307. # Make sure hydra.gnu.org has the important binaries.
  308. assert-binaries-available:
  309. $(top_builddir)/pre-inst-env "$(GUILE)" \
  310. "$(top_srcdir)/build-aux/check-available-binaries.scm"
  311. # Make sure the final inputs don't refer to bootstrap tools.
  312. assert-final-inputs-self-contained:
  313. $(top_builddir)/pre-inst-env "$(GUILE)" \
  314. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  315. .PHONY: sync-descriptions gen-ChangeLog clean-go
  316. .PHONY: assert-no-store-file-names assert-binaries-available
  317. .PHONY: assert-final-inputs-self-contained