Mirror of GNU Guix
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.

599 lines
17 KiB

services: Introduce extensible services. This patch rewrites GuixSD services to make them extensible. * gnu-system.am (GNU_SYSTEM_MODULES): Add gnu/services/dbus.scm. * gnu/services.scm (<service>): Replace with new record type. (<service-extension>, <service-type>): New record types. (write-service-type, compute-boot-script, second-argument): New procedures. (%boot-service, boot-service-type): New variables. (file-union, directory-union, modprobe-wrapper, activation-service->script, activation-script, gexps->activation-gexp): New procedures. (activation-service-type, %activation-service): New variables. (etc-directory, files->etc-directory, etc-service): New procedures. (etc-service-type, setuid-program-service, firmware-service-type): New variables. (firmware->activation-gexp): New procedure. (&service-error, &missing-target-service-error, &ambiguous-target-service-error): New condition types. (service-back-edges, fold-services): New procedures. * gnu/services/avahi.scm (<avahi-configuration>): New record type. (configuration-file): Replace keyword parameters with a single 'config' parameter. (%avahi-accounts, %avahi-activation, avahi-service-type): New variables. (avahi-dmd-service): New procedure. (avahi-service): Rewrite using 'service' and 'avahi-configuration'. * gnu/services/base.scm (%root-file-system-dmd-service, root-file-system-service-type): New variables. (root-file-system-service): Use them. (file-system->dmd-service-name): New procedure. (file-system-service-type): New variable. (file-system-service): Use it. Replace keyword parameters with a single 'file-system' object. (user-unmount-service-type): New variable. (user-unmount-service): Use it. (user-processes-service-type): New variable. (user-processes-service): Use it. (host-name-service-type): New variable. (host-name-service): Use it. (console-keymap-service-type): New variable. (console-keymap-service): Use it. (console-font-service-type): New variable. (console-font-service): Use it. (mingetty-pam-service, mingetty-dmd-service): New procedures. (mingetty-service-type): New variable. (mingetty-service): Use it. (nscd-dmd-service): New procedure. (nscd-activation, nscd-service-type): New variables. (nscd-service): Use the latter. (syslog-service-type): New variable. (syslog-service): Use it. (<guix-configuration>): New record type. (%default-guix-configuration): New variable. (guix-dmd-service, guix-accounts, guix-activation): New procedures. (guix-service-type): New variable. (guix-service): Replace list of keyword parameters with a single 'config' parameter. Rewrite using 'service'. (<udev-configuration>): New record type. (udev-dmd-service): New procedure. (udev-service-type): New variable. (udev-service): Use it. (device-mapping-service-type): New variable. (device-mapping-service): Use it. (swap-service-type): New variable. (swap-service): Use it. * gnu/services/databases.scm (<postgresql-configuration>): New record type. (%postgresql-accounts, postgresql-activation): New variables. (postgresql-dmd-service): New procedure. (postgresql-service): Rewrite using 'service' and 'postgresql-configuration'. * gnu/services/dbus.scm: New file. * gnu/services/desktop.scm (dbus-configuration-directory, dbus-service): Remove. (wrapped-dbus-service): New procedure. (<upower-configuration>): New record type. (upower-configuration-file): Replace keyword parameters with single <upower-configuration> parameter. (%upower-accounts, %upower-activation): New variables. (upower-dbus-service, upower-dmd-service): New procedures. (upower-service-type): New variable. (upower-service): Rewrite using 'service' and 'upower-configuration'. (%colord-activation, %colord-accounts): New variables. (colord-dmd-service): New procedure. (colord-service-type): New variable. (colord-service): Rewrite using 'service'. (<geoclue-configuration>): New record type. (geoclue-configuration-file): Replace keyword parameters with a single 'config' parameter. (geoclue-dbus-service, geoclue-dmd-service): New procedures. (%geoclue-accounts, geoclue-service-type): New variables. (geoclue-service): Rewrite using 'service' and 'geoclue-configuration'. (%polkit-accounts, %polkit-pam-services, polkit-service-type): New variables. (polkit-dmd-service): New procedure. (polkit-service): Rewrite using 'service'. (<elogind-configuration>)[elogind]: New field. (elogind-dmd-service): New procedure. (elogind-service-type): New variable. (elogind-service): Rewrite using 'service'. (%desktop-services): Remove argument to 'dbus-service'. Remove 'map' over %BASE-SERVICES. * gnu/services/dmd.scm (dmd-boot-gexp): New procedure. (dmd-root-service-type, %dmd-root-service): New variables. (dmd-service-type): New macro. (<dmd-service>): New record type. * gnu/services/lirc.scm (<lirc-configuration>): New record type. (%lirc-activation): New variable. (lirc-dmd-service): New procedure. (lirc-service-type): New variable. (lirc-service): Rewrite using 'service' and 'lirc-configuration'. * gnu/services/networking.scm (<static-networking>): New record type. (static-networking-service-type): New variable. (static-networking-service): Rewrite using 'service' and 'static-networking'. (dhcp-client-service-type): New variable. (dhcp-client-service): Rewrite using 'service'. (<ntp-configuration>): New record type. (ntp-dmd-service): New procedure. (ntp-service-type): New variable. (ntp-service): New procedure. (%tor-accounts, tor-service-type): New variable. (tor-dmd-service): New procedure. (tor-service): Rewrite using 'service'. (<bitlbee-configuration>): New record type. (bitlbee-dmd-service): New procedure. (%bitlbee-accounts, %bitlbee-activation, bitlbee-service-type): New variables. (bitlbee-service): Rewrite using 'service'. (%wicd-activation): New variable. (wicd-dmd-service): New procedure. (wicd-service-type): New variable. (wicd-service): Rewrite using 'service'. * gnu/services/ssh.scm (<lsh-configuration>): New record type. (activation): Rename to... (lsh-initialization): ... this. (lsh-activation, lsh-dmd-service, lsh-pam-services): New procedures. (lsh-service-type): New variable. (lsh-service): Rewrite using 'service' and 'lsh-configuration'. * gnu/services/web.scm (<nginx-configuration>): New record type. (%nginx-accounts): New variable. (nginx-activation, nginx-dmd-service): New procedures. (nginx-service-type): New variable. (nginx-service): Rewrite using 'service' and 'nginx-configuration'. * gnu/services/xorg.scm (<slim-configuration>): New record type. (slim-pam-service, slim-dmd-service): New procedures. (slim-service-type): New variable. (slim-service): Rewrite using 'service' and 'slim-configuration'. * gnu/system.scm (file-union): Remove. (other-file-system-services): Adjust to new 'file-system-service' signature. (essential-services): Add #:container? parameter. Add %DMD-ROOT-SERVICE, %ACTIVATION-SERVICE, and calls to 'pam-root-service', 'account-service', 'operating-system-etc-service', and a SETUID-PROGRAM-SERVICE instance. (operating-system-services): Pass #:container? to 'essential-services. (etc-directory): Remove. (operating-system-etc-service): New procedure. Rewrite as a call to 'etc-service'. (operating-system-accounts): Change to not return accounts required by services. (operating-system-etc-directory): Rewrite as a call to 'fold-services' and 'etc-directory'. (user-group->gexp, user-account->gexp, modprobe-wrapper): Remove. (operating-system-activation-script): Rewrite as a call to 'fold-services' and 'activation-service->script'. (operating-system-boot-script): Likewise. (operating-system-derivation): Add call to 'lower-object'. (emacs-site-file, emacs-site-directory, shells-file): Change to use 'computed-file' and 'scheme-file' instead of the monadic procedures. * gnu/system/install.scm (cow-store-service-type): New variable. (cow-store-service): Rewrite using 'service'. (/etc/configuration-files): New procedure. (configuration-template-service-type, %configuration-template-service): New variables. (configuration-template-service): Remove. (installation-services): Adjust accordingly. Adjust argument to 'guix-service'. * gnu/system/linux.scm (/etc-entry, pam-root-service): New procedures. (pam-root-service-type): New variable. * gnu/system/shadow.scm (user-group->gexp, user-account->gexp, account-activation, etc-skel, account-service): New procedures. (account-service-type): New variable. * tests/services.scm: New file. * doc/guix.texi (Base Services, Desktop Services): Adjust accordingly. (Defining Services): Rewrite. * doc/images/service-graph.dot: New file. * doc.am (DOT_FILES): Add it. * po/guix/POTFILES.in: Add gnu/services.scm.
6 years ago
build: Add a Guile custom test driver using SRFI-64. Before that '.log' files for scheme tests were fragmented and not included in test-suite.log. This unifies the semantics of SRFI-64 API with Automake test suite. * build-aux/test-driver.scm: New file. * Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables. (SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables. (AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0. * test-env.in: Silence guix-daemon. * doc/guix.texi (Running the Test Suite): Describe how to display the detailed results. Bug reports require only 'test-suite.log' file. * tests/base32.scm, tests/build-utils.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm, tests/cve.scm, tests/derivations.scm, tests/elpa.scm, tests/file-systems.scm, tests/gem.scm, tests/gexp.scm, tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm, tests/gremlin.scm, tests/hackage.scm, tests/hash.scm, tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm, tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm, tests/profiles.scm, tests/publish.scm, tests/pypi.scm, tests/records.scm, tests/scripts-build.scm, tests/scripts.scm, tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm, tests/store.scm, tests/substitute.scm, tests/syscalls.scm, tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm, tests/utils.scm: Don't exit at the end of test groups. * tests/containers.scm: Likewise. Use 'test-skip' instead of exiting with error code 77.
6 years ago
build: Add a Guile custom test driver using SRFI-64. Before that '.log' files for scheme tests were fragmented and not included in test-suite.log. This unifies the semantics of SRFI-64 API with Automake test suite. * build-aux/test-driver.scm: New file. * Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables. (SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables. (AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0. * test-env.in: Silence guix-daemon. * doc/guix.texi (Running the Test Suite): Describe how to display the detailed results. Bug reports require only 'test-suite.log' file. * tests/base32.scm, tests/build-utils.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm, tests/cve.scm, tests/derivations.scm, tests/elpa.scm, tests/file-systems.scm, tests/gem.scm, tests/gexp.scm, tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm, tests/gremlin.scm, tests/hackage.scm, tests/hash.scm, tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm, tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm, tests/profiles.scm, tests/publish.scm, tests/pypi.scm, tests/records.scm, tests/scripts-build.scm, tests/scripts.scm, tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm, tests/store.scm, tests/substitute.scm, tests/syscalls.scm, tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm, tests/utils.scm: Don't exit at the end of test groups. * tests/containers.scm: Likewise. Use 'test-skip' instead of exiting with error code 77.
6 years ago
  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. # Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
  8. #
  9. # This file is part of GNU Guix.
  10. #
  11. # GNU Guix is free software; you can redistribute it and/or modify it
  12. # under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 3 of the License, or (at
  14. # your option) any later version.
  15. #
  16. # GNU Guix is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. bin_SCRIPTS = \
  24. scripts/guix
  25. nodist_noinst_SCRIPTS = \
  26. pre-inst-env \
  27. test-env
  28. # Modules that are not compiled but are installed nonetheless, such as
  29. # build-side modules with unusual dependencies.
  30. MODULES_NOT_COMPILED =
  31. include gnu/local.mk
  32. MODULES = \
  33. guix/base16.scm \
  34. guix/base32.scm \
  35. guix/base64.scm \
  36. guix/cpio.scm \
  37. guix/records.scm \
  38. guix/gcrypt.scm \
  39. guix/hash.scm \
  40. guix/pk-crypto.scm \
  41. guix/pki.scm \
  42. guix/combinators.scm \
  43. guix/memoization.scm \
  44. guix/utils.scm \
  45. guix/sets.scm \
  46. guix/modules.scm \
  47. guix/download.scm \
  48. guix/discovery.scm \
  49. guix/git-download.scm \
  50. guix/hg-download.scm \
  51. guix/monads.scm \
  52. guix/monad-repl.scm \
  53. guix/gexp.scm \
  54. guix/profiles.scm \
  55. guix/serialization.scm \
  56. guix/nar.scm \
  57. guix/derivations.scm \
  58. guix/grafts.scm \
  59. guix/gnu-maintenance.scm \
  60. guix/upstream.scm \
  61. guix/licenses.scm \
  62. guix/graph.scm \
  63. guix/cache.scm \
  64. guix/cve.scm \
  65. guix/workers.scm \
  66. guix/zlib.scm \
  67. guix/build-system.scm \
  68. guix/build-system/ant.scm \
  69. guix/build-system/cargo.scm \
  70. guix/build-system/cmake.scm \
  71. guix/build-system/dub.scm \
  72. guix/build-system/emacs.scm \
  73. guix/build-system/asdf.scm \
  74. guix/build-system/glib-or-gtk.scm \
  75. guix/build-system/gnu.scm \
  76. guix/build-system/haskell.scm \
  77. guix/build-system/perl.scm \
  78. guix/build-system/python.scm \
  79. guix/build-system/ocaml.scm \
  80. guix/build-system/waf.scm \
  81. guix/build-system/r.scm \
  82. guix/build-system/ruby.scm \
  83. guix/build-system/trivial.scm \
  84. guix/ftp-client.scm \
  85. guix/http-client.scm \
  86. guix/gnupg.scm \
  87. guix/elf.scm \
  88. guix/store.scm \
  89. guix/cvs-download.scm \
  90. guix/svn-download.scm \
  91. guix/ui.scm \
  92. guix/build/ant-build-system.scm \
  93. guix/build/download.scm \
  94. guix/build/cargo-build-system.scm \
  95. guix/build/cmake-build-system.scm \
  96. guix/build/dub-build-system.scm \
  97. guix/build/emacs-build-system.scm \
  98. guix/build/asdf-build-system.scm \
  99. guix/build/git.scm \
  100. guix/build/hg.scm \
  101. guix/build/glib-or-gtk-build-system.scm \
  102. guix/build/gnu-build-system.scm \
  103. guix/build/gnu-dist.scm \
  104. guix/build/perl-build-system.scm \
  105. guix/build/python-build-system.scm \
  106. guix/build/ocaml-build-system.scm \
  107. guix/build/r-build-system.scm \
  108. guix/build/ruby-build-system.scm \
  109. guix/build/waf-build-system.scm \
  110. guix/build/haskell-build-system.scm \
  111. guix/build/store-copy.scm \
  112. guix/build/utils.scm \
  113. guix/build/union.scm \
  114. guix/build/profiles.scm \
  115. guix/build/pull.scm \
  116. guix/build/rpath.scm \
  117. guix/build/cvs.scm \
  118. guix/build/svn.scm \
  119. guix/build/syscalls.scm \
  120. guix/build/gremlin.scm \
  121. guix/build/emacs-utils.scm \
  122. guix/build/lisp-utils.scm \
  123. guix/build/graft.scm \
  124. guix/build/bournish.scm \
  125. guix/build/qt-utils.scm \
  126. guix/build/make-bootstrap.scm \
  127. guix/search-paths.scm \
  128. guix/packages.scm \
  129. guix/import/utils.scm \
  130. guix/import/gnu.scm \
  131. guix/import/snix.scm \
  132. guix/import/cabal.scm \
  133. guix/import/cran.scm \
  134. guix/import/hackage.scm \
  135. guix/import/elpa.scm \
  136. guix/scripts.scm \
  137. guix/scripts/download.scm \
  138. guix/scripts/perform-download.scm \
  139. guix/scripts/build.scm \
  140. guix/scripts/archive.scm \
  141. guix/scripts/import.scm \
  142. guix/scripts/package.scm \
  143. guix/scripts/gc.scm \
  144. guix/scripts/hash.scm \
  145. guix/scripts/pack.scm \
  146. guix/scripts/pull.scm \
  147. guix/scripts/substitute.scm \
  148. guix/scripts/authenticate.scm \
  149. guix/scripts/refresh.scm \
  150. guix/scripts/system.scm \
  151. guix/scripts/lint.scm \
  152. guix/scripts/challenge.scm \
  153. guix/scripts/import/cran.scm \
  154. guix/scripts/import/gnu.scm \
  155. guix/scripts/import/nix.scm \
  156. guix/scripts/import/hackage.scm \
  157. guix/scripts/import/stackage.scm \
  158. guix/scripts/import/elpa.scm \
  159. guix/scripts/environment.scm \
  160. guix/scripts/publish.scm \
  161. guix/scripts/edit.scm \
  162. guix/scripts/size.scm \
  163. guix/scripts/graph.scm \
  164. guix/scripts/container.scm \
  165. guix/scripts/container/exec.scm \
  166. guix.scm \
  167. $(GNU_SYSTEM_MODULES)
  168. if HAVE_GUILE_JSON
  169. MODULES += \
  170. guix/docker.scm \
  171. guix/import/cpan.scm \
  172. guix/import/crate.scm \
  173. guix/import/gem.scm \
  174. guix/import/github.scm \
  175. guix/import/json.scm \
  176. guix/import/pypi.scm \
  177. guix/import/stackage.scm \
  178. guix/scripts/import/crate.scm \
  179. guix/scripts/import/gem.scm \
  180. guix/scripts/import/pypi.scm
  181. endif
  182. if HAVE_GUILE_SSH
  183. MODULES += \
  184. guix/ssh.scm \
  185. guix/scripts/copy.scm \
  186. guix/store/ssh.scm
  187. endif HAVE_GUILE_SSH
  188. if HAVE_GUILE_GIT
  189. MODULES += \
  190. guix/git.scm
  191. endif HAVE_GUILE_GIT
  192. if BUILD_DAEMON_OFFLOAD
  193. MODULES += \
  194. guix/scripts/offload.scm
  195. endif BUILD_DAEMON_OFFLOAD
  196. # Internal modules with test suite support.
  197. dist_noinst_DATA = guix/tests.scm guix/tests/http.scm
  198. # Auxiliary files for packages.
  199. AUX_FILES = \
  200. gnu/packages/aux-files/emacs/guix-emacs.el \
  201. gnu/packages/aux-files/linux-libre/4.11-i686.conf \
  202. gnu/packages/aux-files/linux-libre/4.11-x86_64.conf \
  203. gnu/packages/aux-files/linux-libre/4.9-i686.conf \
  204. gnu/packages/aux-files/linux-libre/4.9-x86_64.conf \
  205. gnu/packages/aux-files/linux-libre/4.4-i686.conf \
  206. gnu/packages/aux-files/linux-libre/4.4-x86_64.conf \
  207. gnu/packages/aux-files/linux-libre/4.1-i686.conf \
  208. gnu/packages/aux-files/linux-libre/4.1-x86_64.conf
  209. # Templates, examples.
  210. EXAMPLES = \
  211. gnu/system/examples/bare-bones.tmpl \
  212. gnu/system/examples/desktop.tmpl \
  213. gnu/system/examples/lightweight-desktop.tmpl
  214. GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
  215. nobase_dist_guilemodule_DATA = \
  216. $(MODULES) $(MODULES_NOT_COMPILED) $(AUX_FILES) $(EXAMPLES) \
  217. $(MISC_DISTRO_FILES)
  218. nobase_nodist_guilemodule_DATA = guix/config.scm
  219. nobase_nodist_guileobject_DATA = $(GOBJECTS)
  220. # Do we need to provide our own non-broken (srfi srfi-37) module?
  221. if INSTALL_SRFI_37
  222. nobase_nodist_guilemodule_DATA += srfi/srfi-37.scm
  223. GOBJECTS += srfi/srfi-37.go
  224. srfi/srfi-37.scm: srfi/srfi-37.scm.in
  225. $(MKDIR_P) srfi
  226. cp "$<" "$@"
  227. endif INSTALL_SRFI_37
  228. # Handy way to remove the .go files without removing all the rest.
  229. clean-go:
  230. -$(RM) -f $(GOBJECTS)
  231. @find . -name '*.go' -print | \
  232. if test -t 1; then \
  233. xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \
  234. else \
  235. xargs -r echo "warning: stray .go files:"; \
  236. fi
  237. # Test extensions; has to be unconditional.
  238. TEST_EXTENSIONS = .scm .sh
  239. if CAN_RUN_TESTS
  240. SCM_TESTS = \
  241. tests/base16.scm \
  242. tests/base32.scm \
  243. tests/base64.scm \
  244. tests/cpio.scm \
  245. tests/hash.scm \
  246. tests/pk-crypto.scm \
  247. tests/pki.scm \
  248. tests/sets.scm \
  249. tests/modules.scm \
  250. tests/gnu-maintenance.scm \
  251. tests/substitute.scm \
  252. tests/builders.scm \
  253. tests/derivations.scm \
  254. tests/grafts.scm \
  255. tests/ui.scm \
  256. tests/records.scm \
  257. tests/upstream.scm \
  258. tests/combinators.scm \
  259. tests/discovery.scm \
  260. tests/utils.scm \
  261. tests/build-utils.scm \
  262. tests/packages.scm \
  263. tests/snix.scm \
  264. tests/hackage.scm \
  265. tests/cran.scm \
  266. tests/elpa.scm \
  267. tests/store.scm \
  268. tests/monads.scm \
  269. tests/gexp.scm \
  270. tests/nar.scm \
  271. tests/union.scm \
  272. tests/profiles.scm \
  273. tests/search-paths.scm \
  274. tests/syscalls.scm \
  275. tests/gremlin.scm \
  276. tests/bournish.scm \
  277. tests/lint.scm \
  278. tests/publish.scm \
  279. tests/scripts.scm \
  280. tests/size.scm \
  281. tests/graph.scm \
  282. tests/challenge.scm \
  283. tests/cache.scm \
  284. tests/cve.scm \
  285. tests/workers.scm \
  286. tests/zlib.scm \
  287. tests/file-systems.scm \
  288. tests/system.scm \
  289. tests/services.scm \
  290. tests/scripts-build.scm \
  291. tests/containers.scm \
  292. tests/pack.scm \
  293. tests/import-utils.scm
  294. if HAVE_GUILE_JSON
  295. SCM_TESTS += \
  296. tests/pypi.scm \
  297. tests/cpan.scm \
  298. tests/gem.scm \
  299. tests/crate.scm
  300. endif
  301. SH_TESTS = \
  302. tests/guix-build.sh \
  303. tests/guix-download.sh \
  304. tests/guix-gc.sh \
  305. tests/guix-hash.sh \
  306. tests/guix-package.sh \
  307. tests/guix-package-net.sh \
  308. tests/guix-system.sh \
  309. tests/guix-archive.sh \
  310. tests/guix-authenticate.sh \
  311. tests/guix-environment.sh \
  312. tests/guix-environment-container.sh \
  313. tests/guix-graph.sh \
  314. tests/guix-lint.sh
  315. if BUILD_DAEMON
  316. SH_TESTS += tests/guix-register.sh
  317. endif BUILD_DAEMON
  318. TESTS = $(SCM_TESTS) $(SH_TESTS)
  319. AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" GUILE_AUTO_COMPILE=0
  320. SCM_LOG_DRIVER = \
  321. $(top_builddir)/test-env --quiet-stderr \
  322. $(GUILE) --no-auto-compile -e main \
  323. $(top_srcdir)/build-aux/test-driver.scm
  324. AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
  325. SH_LOG_COMPILER = $(top_builddir)/test-env $(SHELL)
  326. AM_SH_LOG_FLAGS = -x -e
  327. # Make sure `tests/guix-gc.sh' runs last, after all the others. Otherwise it
  328. # could end up removing files from the store while they are being used by
  329. # other instances of the daemon.
  330. tests/guix-gc.log: \
  331. $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS))) \
  332. $(SCM_TESTS:%.scm=%.log)
  333. else !CAN_RUN_TESTS
  334. TESTS =
  335. SH_TESTS =
  336. SCM_TESTS =
  337. # Automake always generates a 'check' target, so better not override it.
  338. check-local:
  339. @echo
  340. @echo "Cannot run tests because file name limits would be exceeded." >&2
  341. @echo "Look for 'length' in the 'config.log' file for details." >&2
  342. @echo
  343. @exit 1
  344. endif !CAN_RUN_TESTS
  345. check-system: $(GOBJECTS) $(BOOTSTRAP_GUILE_TARBALLS)
  346. $(AM_V_at)$(top_builddir)/pre-inst-env \
  347. $(GUILE) --no-auto-compile \
  348. -e '(@@ (run-system-tests) run-system-tests)' \
  349. $(top_srcdir)/build-aux/run-system-tests.scm
  350. # Public key used to sign substitutes from hydra.gnu.org.
  351. dist_pkgdata_DATA = hydra.gnu.org.pub
  352. # Bash completion file.
  353. dist_bashcompletion_DATA = etc/completion/bash/guix
  354. # Zsh completion file.
  355. dist_zshcompletion_DATA = etc/completion/zsh/_guix
  356. EXTRA_DIST = \
  357. HACKING \
  358. ROADMAP \
  359. TODO \
  360. CODE-OF-CONDUCT \
  361. .dir-locals.el \
  362. build-aux/build-self.scm \
  363. build-aux/compile-all.scm \
  364. build-aux/hydra/evaluate.scm \
  365. build-aux/hydra/gnu-system.scm \
  366. build-aux/hydra/guix.scm \
  367. build-aux/check-available-binaries.scm \
  368. build-aux/check-final-inputs-self-contained.scm \
  369. build-aux/download.scm \
  370. build-aux/generate-authors.scm \
  371. build-aux/test-driver.scm \
  372. build-aux/run-system-tests.scm \
  373. d3.v3.js \
  374. graph.js \
  375. srfi/srfi-37.scm.in \
  376. srfi/srfi-64.scm \
  377. srfi/srfi-64.upstream.scm \
  378. tests/test.drv \
  379. tests/signing-key.pub \
  380. tests/signing-key.sec \
  381. tests/cve-sample.xml \
  382. build-aux/config.rpath \
  383. bootstrap \
  384. release.nix \
  385. $(TESTS)
  386. if !BUILD_DAEMON_OFFLOAD
  387. EXTRA_DIST += \
  388. guix/scripts/offload.scm
  389. endif !BUILD_DAEMON_OFFLOAD
  390. CLEANFILES = \
  391. $(GOBJECTS) \
  392. $(SCM_TESTS:tests/%.scm=%.log)
  393. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  394. # $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
  395. # there that are newer than the local .scm files (for instance because the
  396. # user ran 'make install' recently). When that happens, we end up loading
  397. # those previously-installed .go files, which may be stale, thereby breaking
  398. # the whole thing. Likewise, set 'XDG_CACHE_HOME' to avoid loading possibly
  399. # stale files from ~/.cache/guile/ccache.
  400. %.go: make-go ; @:
  401. make-go: $(MODULES) guix/config.scm $(dist_noinst_DATA)
  402. $(AM_V_at)echo "Compiling Scheme modules..." ; \
  403. unset GUILE_LOAD_COMPILED_PATH ; \
  404. XDG_CACHE_HOME=/nowhere \
  405. host=$(host) srcdir="$(top_srcdir)" \
  406. $(top_builddir)/pre-inst-env \
  407. $(GUILE) -L "$(top_builddir)" -L "$(top_srcdir)" \
  408. --no-auto-compile \
  409. -s "$(top_srcdir)"/build-aux/compile-all.scm $^
  410. SUFFIXES = .go
  411. # Make sure source files are installed first, so that the mtime of
  412. # installed compiled files is greater than that of installed source
  413. # files. See
  414. # <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
  415. # for details.
  416. guix_install_go_files = install-nobase_nodist_guileobjectDATA
  417. $(guix_install_go_files): install-nobase_dist_guilemoduleDATA
  418. # The above trick doesn't work for 'config.go' because both 'config.scm' and
  419. # 'config.go' are listed in $(nobase_nodist_guileobject_DATA). Thus, give it
  420. # special treatment.
  421. install-data-hook: set-bootstrap-executable-permissions
  422. touch "$(DESTDIR)$(guileobjectdir)/guix/config.go"
  423. SUBDIRS = po/guix po/packages
  424. BUILT_SOURCES =
  425. include doc/local.mk
  426. if BUILD_DAEMON
  427. include nix/local.mk
  428. endif BUILD_DAEMON
  429. ACLOCAL_AMFLAGS = -I m4
  430. # Pass an explicit '--localstatedir' so that configure does not error out if
  431. # it finds an existing installation with a different localstatedir.
  432. AM_DISTCHECK_CONFIGURE_FLAGS = \
  433. --localstatedir="$$dc_install_base/var" \
  434. --with-libgcrypt-prefix="$(LIBGCRYPT_PREFIX)" \
  435. --with-libgcrypt-libdir="$(LIBGCRYPT_LIBDIR)" \
  436. --with-nix-prefix="$(NIX_PREFIX)" \
  437. --enable-daemon
  438. # The self-contained tarball. Add 'glibc-utf8-locales' along with glibc just
  439. # so 'etc/profile' defines 'GUIX_LOCPATH' pointing to a valid set of locales.
  440. guix-binary.%.tar.xz:
  441. $(AM_V_GEN)GUIX_PACKAGE_PATH= \
  442. tarball=`$(top_builddir)/pre-inst-env guix pack -C xz \
  443. -s "$*" --localstatedir guix glibc-utf8-locales \
  444. -e '(@@ (gnu packages commencement) glibc-final)'` ; \
  445. cp "$$tarball" "$@.tmp" ; mv "$@.tmp" "$@"
  446. dist-hook: gen-ChangeLog gen-AUTHORS gen-tarball-version
  447. dist-hook: assert-no-store-file-names
  448. distcheck-hook: assert-binaries-available assert-final-inputs-self-contained
  449. EXTRA_DIST += $(top_srcdir)/.version
  450. BUILT_SOURCES += $(top_srcdir)/.version
  451. $(top_srcdir)/.version:
  452. echo $(VERSION) > "$@-t" && mv "$@-t" "$@"
  453. gen-tarball-version:
  454. echo $(VERSION) > "$(distdir)/.tarball-version"
  455. gen-ChangeLog:
  456. $(AM_V_GEN)if test -d .git; then \
  457. $(top_srcdir)/build-aux/gitlog-to-changelog \
  458. > $(distdir)/cl-t; \
  459. rm -f $(distdir)/ChangeLog; \
  460. mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  461. fi
  462. gen-AUTHORS:
  463. $(AM_V_GEN)if test -d .git; then \
  464. rm -f "$(distdir)/AUTHORS"; \
  465. $(top_builddir)/pre-inst-env "$(GUILE)" \
  466. "$(top_srcdir)/build-aux/generate-authors.scm" \
  467. "$(top_srcdir)" "$(distdir)/AUTHORS"; \
  468. fi
  469. # Make sure we're not shipping a file that embeds a local /gnu/store file name.
  470. assert-no-store-file-names:
  471. $(AM_V_at)if grep -r --exclude=*.texi --exclude=*.info \
  472. --exclude=*.info-[0-9] --exclude=*.dot \
  473. --exclude=*.eps --exclude-dir=bootstrap \
  474. --exclude=guix-prettify.el \
  475. --exclude=ChangeLog \
  476. -E "$(storedir)/[a-z0-9]{32}-" $(distdir) ; \
  477. then \
  478. echo "error: store file names embedded in the distribution" >&2 ; \
  479. exit 1 ; \
  480. fi
  481. # Make sure hydra.gnu.org has the important binaries.
  482. assert-binaries-available: $(GOBJECTS)
  483. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  484. "$(top_srcdir)/build-aux/check-available-binaries.scm"
  485. # Make sure the final inputs don't refer to bootstrap tools.
  486. assert-final-inputs-self-contained: $(GOBJECTS)
  487. $(AM_V_at)$(top_builddir)/pre-inst-env "$(GUILE)" \
  488. "$(top_srcdir)/build-aux/check-final-inputs-self-contained.scm"
  489. # Compute the Hydra jobs and write them in the target file.
  490. hydra-jobs.scm: $(GOBJECTS)
  491. $(AM_V_at)$(MKDIR_P) "`dirname "$@"`"
  492. $(AM_V_GEN)$(top_builddir)/pre-inst-env "$(GUILE)" \
  493. "$(top_srcdir)/build-aux/hydra/evaluate.scm" \
  494. "$(top_srcdir)/build-aux/hydra/gnu-system.scm" > "$@.tmp"
  495. $(AM_V_at)mv "$@.tmp" "$@"
  496. .PHONY: gen-ChangeLog gen-AUTHORS gen-tarball-version
  497. .PHONY: assert-no-store-file-names assert-binaries-available
  498. .PHONY: assert-final-inputs-self-contained
  499. .PHONY: clean-go make-go
  500. ## -------------- ##
  501. ## Silent rules. ##
  502. ## -------------- ##
  503. AM_V_DL = $(AM_V_DL_$(V))
  504. AM_V_DL_ = $(AM_V_DL_$(AM_DEFAULT_VERBOSITY))
  505. AM_V_DL_0 = @echo " DL " $@;
  506. AM_V_DOT = $(AM_V_DOT_$(V))
  507. AM_V_DOT_ = $(AM_V_DOT_$(AM_DEFAULT_VERBOSITY))
  508. AM_V_DOT_0 = @echo " DOT " $@;
  509. AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
  510. AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
  511. AM_V_HELP2MAN_0 = @echo " HELP2MAN" $@;