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.
 
 
 
 
 
 

223 lines
6.2 KiB

  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
  3. #
  4. # This file is part of GNU Guix.
  5. #
  6. # GNU Guix is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # GNU Guix is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Integration of the `guix-daemon' code taken from upstream Nix.
  20. #
  21. BUILT_SOURCES += nix/libstore/schema.sql.hh
  22. CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service etc/guix-daemon.conf
  23. noinst_LIBRARIES = libformat.a libutil.a libstore.a
  24. # Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more.
  25. AM_CXXFLAGS = -Wall -std=c++11
  26. libformat_a_SOURCES = \
  27. nix/boost/format/free_funcs.cc \
  28. nix/boost/format/parsing.cc \
  29. nix/boost/format/format_implementation.cc
  30. libformat_headers = \
  31. nix/boost/throw_exception.hpp \
  32. nix/boost/format.hpp \
  33. nix/boost/assert.hpp \
  34. nix/boost/format/macros_default.hpp \
  35. nix/boost/format/format_fwd.hpp \
  36. nix/boost/format/format_class.hpp \
  37. nix/boost/format/exceptions.hpp \
  38. nix/boost/format/group.hpp \
  39. nix/boost/format/feed_args.hpp \
  40. nix/boost/format/internals_fwd.hpp \
  41. nix/boost/format/internals.hpp
  42. libformat_a_CPPFLAGS = \
  43. -I$(top_srcdir)/nix
  44. libutil_a_SOURCES = \
  45. nix/libutil/archive.cc \
  46. nix/libutil/affinity.cc \
  47. nix/libutil/serialise.cc \
  48. nix/libutil/util.cc \
  49. nix/libutil/xml-writer.cc \
  50. nix/libutil/hash.cc \
  51. nix/libutil/gcrypt-hash.cc
  52. libutil_headers = \
  53. nix/libutil/affinity.hh \
  54. nix/libutil/hash.hh \
  55. nix/libutil/serialise.hh \
  56. nix/libutil/xml-writer.hh \
  57. nix/libutil/util.hh \
  58. nix/libutil/archive.hh \
  59. nix/libutil/types.hh \
  60. nix/libutil/gcrypt-hash.hh \
  61. nix/libutil/md5.h \
  62. nix/libutil/sha1.h \
  63. nix/libutil/sha256.h
  64. libutil_a_CPPFLAGS = \
  65. -I$(top_builddir)/nix \
  66. -I$(top_srcdir)/nix/libutil \
  67. $(libformat_a_CPPFLAGS)
  68. libstore_a_SOURCES = \
  69. nix/libstore/gc.cc \
  70. nix/libstore/globals.cc \
  71. nix/libstore/misc.cc \
  72. nix/libstore/references.cc \
  73. nix/libstore/store-api.cc \
  74. nix/libstore/optimise-store.cc \
  75. nix/libstore/local-store.cc \
  76. nix/libstore/remote-store.cc \
  77. nix/libstore/build.cc \
  78. nix/libstore/pathlocks.cc \
  79. nix/libstore/derivations.cc
  80. libstore_headers = \
  81. nix/libstore/references.hh \
  82. nix/libstore/pathlocks.hh \
  83. nix/libstore/globals.hh \
  84. nix/libstore/worker-protocol.hh \
  85. nix/libstore/remote-store.hh \
  86. nix/libstore/derivations.hh \
  87. nix/libstore/misc.hh \
  88. nix/libstore/local-store.hh \
  89. nix/libstore/store-api.hh
  90. libstore_a_CPPFLAGS = \
  91. $(libutil_a_CPPFLAGS) \
  92. -I$(top_srcdir)/nix/libstore \
  93. -I$(top_builddir)/nix/libstore \
  94. -DNIX_STORE_DIR=\"$(storedir)\" \
  95. -DNIX_DATA_DIR=\"$(datadir)\" \
  96. -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
  97. -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
  98. -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \
  99. -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
  100. -DNIX_BIN_DIR=\"$(bindir)\" \
  101. -DOPENSSL_PATH="\"guix-authenticate\"" \
  102. -DDEFAULT_CHROOT_DIRS="\"\""
  103. libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \
  104. $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
  105. bin_PROGRAMS = guix-daemon
  106. sbin_PROGRAMS = guix-register
  107. guix_daemon_SOURCES = \
  108. nix/nix-daemon/nix-daemon.cc \
  109. nix/nix-daemon/guix-daemon.cc
  110. guix_daemon_CPPFLAGS = \
  111. -DLOCALEDIR=\"$(localedir)\" \
  112. $(libutil_a_CPPFLAGS) \
  113. -I$(top_srcdir)/nix/libstore
  114. guix_daemon_LDADD = \
  115. libstore.a libutil.a libformat.a -lbz2 \
  116. $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
  117. guix_daemon_headers = \
  118. nix/nix-daemon/shared.hh
  119. guix_register_SOURCES = \
  120. nix/guix-register/guix-register.cc
  121. guix_register_CPPFLAGS = \
  122. $(libutil_a_CPPFLAGS) \
  123. $(libstore_a_CPPFLAGS) \
  124. -I$(top_srcdir)/nix/libstore
  125. # XXX: Should we start using shared libs?
  126. guix_register_LDADD = \
  127. libstore.a libutil.a libformat.a -lbz2 \
  128. $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
  129. noinst_HEADERS = \
  130. $(libformat_headers) $(libutil_headers) $(libstore_headers) \
  131. $(guix_daemon_headers)
  132. nix/libstore/schema.sql.hh: nix/libstore/schema.sql
  133. $(GUILE) --no-auto-compile -c \
  134. "(use-modules (rnrs io ports)) \
  135. (call-with-output-file \"$@\" \
  136. (lambda (out) \
  137. (call-with-input-file \"$^\" \
  138. (lambda (in) \
  139. (write (get-string-all in) out)))))"
  140. nodist_pkglibexec_SCRIPTS = \
  141. nix/scripts/list-runtime-roots \
  142. nix/scripts/substitute
  143. if BUILD_DAEMON_OFFLOAD
  144. nodist_pkglibexec_SCRIPTS += \
  145. nix/scripts/offload
  146. endif BUILD_DAEMON_OFFLOAD
  147. # XXX: It'd be better to hide it in $(pkglibexecdir).
  148. nodist_libexec_SCRIPTS = \
  149. nix/scripts/guix-authenticate
  150. # The '.service' file for systemd.
  151. systemdservicedir = $(libdir)/systemd/system
  152. nodist_systemdservice_DATA = etc/guix-daemon.service
  153. etc/guix-daemon.service: etc/guix-daemon.service.in \
  154. $(top_builddir)/config.status
  155. $(MKDIR_P) "`dirname "$@"`"
  156. $(SED) -e 's|@''bindir''@|$(bindir)|' < \
  157. "$(srcdir)/etc/guix-daemon.service.in" > "$@.tmp"
  158. mv "$@.tmp" "$@"
  159. # The '.conf' job for Upstart.
  160. upstartjobdir = $(libdir)/upstart/system
  161. nodist_upstartjob_DATA = etc/guix-daemon.conf
  162. etc/guix-daemon.conf: etc/guix-daemon.conf.in \
  163. $(top_builddir)/config.status
  164. $(MKDIR_P) "`dirname "$@"`"
  165. $(SED) -e 's|@''bindir''@|$(bindir)|' < \
  166. "$(srcdir)/etc/guix-daemon.conf.in" > "$@.tmp"
  167. mv "$@.tmp" "$@"
  168. EXTRA_DIST += \
  169. nix/libstore/schema.sql \
  170. nix/AUTHORS \
  171. nix/COPYING \
  172. etc/guix-daemon.service.in \
  173. etc/guix-daemon.conf.in
  174. AM_TESTS_ENVIRONMENT += \
  175. top_builddir="$(abs_top_builddir)"
  176. TESTS += \
  177. tests/guix-daemon.sh
  178. clean-local:
  179. -if test -d "$(GUIX_TEST_ROOT)"; then \
  180. find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
  181. fi
  182. -rm -rf "$(GUIX_TEST_ROOT)"