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.
 
 
 
 
 
 

222 lines
6.0 KiB

  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
  3. # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
  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. #
  20. # Integration of the `guix-daemon' code taken from upstream Nix.
  21. #
  22. BUILT_SOURCES += %D%/libstore/schema.sql.hh
  23. CLEANFILES += %D%/libstore/schema.sql.hh
  24. noinst_LIBRARIES = libformat.a libutil.a libstore.a
  25. # Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more.
  26. AM_CXXFLAGS = -Wall -std=c++11
  27. libformat_a_SOURCES = \
  28. %D%/boost/format/free_funcs.cc \
  29. %D%/boost/format/parsing.cc \
  30. %D%/boost/format/format_implementation.cc
  31. libformat_headers = \
  32. %D%/boost/throw_exception.hpp \
  33. %D%/boost/format.hpp \
  34. %D%/boost/assert.hpp \
  35. %D%/boost/format/macros_default.hpp \
  36. %D%/boost/format/format_fwd.hpp \
  37. %D%/boost/format/format_class.hpp \
  38. %D%/boost/format/exceptions.hpp \
  39. %D%/boost/format/group.hpp \
  40. %D%/boost/format/feed_args.hpp \
  41. %D%/boost/format/internals_fwd.hpp \
  42. %D%/boost/format/internals.hpp
  43. libformat_a_CPPFLAGS = \
  44. -I$(top_srcdir)/nix
  45. libutil_a_SOURCES = \
  46. %D%/libutil/archive.cc \
  47. %D%/libutil/affinity.cc \
  48. %D%/libutil/serialise.cc \
  49. %D%/libutil/util.cc \
  50. %D%/libutil/hash.cc \
  51. %D%/libutil/gcrypt-hash.cc
  52. libutil_headers = \
  53. %D%/libutil/affinity.hh \
  54. %D%/libutil/hash.hh \
  55. %D%/libutil/serialise.hh \
  56. %D%/libutil/util.hh \
  57. %D%/libutil/archive.hh \
  58. %D%/libutil/types.hh \
  59. %D%/libutil/gcrypt-hash.hh \
  60. %D%/libutil/md5.h \
  61. %D%/libutil/sha1.h \
  62. %D%/libutil/sha256.h \
  63. %D%/libutil/sha512.h
  64. libutil_a_CPPFLAGS = \
  65. -I$(top_builddir)/nix \
  66. -I$(top_srcdir)/%D%/libutil \
  67. $(libformat_a_CPPFLAGS)
  68. libstore_a_SOURCES = \
  69. %D%/libstore/gc.cc \
  70. %D%/libstore/globals.cc \
  71. %D%/libstore/misc.cc \
  72. %D%/libstore/references.cc \
  73. %D%/libstore/store-api.cc \
  74. %D%/libstore/optimise-store.cc \
  75. %D%/libstore/local-store.cc \
  76. %D%/libstore/build.cc \
  77. %D%/libstore/pathlocks.cc \
  78. %D%/libstore/derivations.cc \
  79. %D%/libstore/builtins.cc \
  80. %D%/libstore/sqlite.cc
  81. libstore_headers = \
  82. %D%/libstore/references.hh \
  83. %D%/libstore/pathlocks.hh \
  84. %D%/libstore/globals.hh \
  85. %D%/libstore/worker-protocol.hh \
  86. %D%/libstore/derivations.hh \
  87. %D%/libstore/misc.hh \
  88. %D%/libstore/local-store.hh \
  89. %D%/libstore/sqlite.hh \
  90. %D%/libstore/builtins.hh \
  91. %D%/libstore/store-api.hh
  92. libstore_a_CPPFLAGS = \
  93. $(libutil_a_CPPFLAGS) \
  94. -I$(top_srcdir)/%D%/libstore \
  95. -I$(top_builddir)/%D%/libstore \
  96. -DNIX_STORE_DIR=\"$(storedir)\" \
  97. -DNIX_DATA_DIR=\"$(datadir)\" \
  98. -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
  99. -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
  100. -DGUIX_CONFIGURATION_DIRECTORY=\"$(sysconfdir)/guix\" \
  101. -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
  102. -DNIX_BIN_DIR=\"$(bindir)\" \
  103. -DDEFAULT_CHROOT_DIRS="\"\""
  104. libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \
  105. $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
  106. bin_PROGRAMS = guix-daemon
  107. guix_daemon_SOURCES = \
  108. %D%/nix-daemon/nix-daemon.cc \
  109. %D%/nix-daemon/guix-daemon.cc
  110. guix_daemon_CPPFLAGS = \
  111. -DLOCALEDIR=\"$(localedir)\" \
  112. $(libutil_a_CPPFLAGS) \
  113. -I$(top_srcdir)/%D%/libstore
  114. guix_daemon_LDADD = \
  115. libstore.a libutil.a libformat.a -lz \
  116. $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
  117. guix_daemon_headers = \
  118. %D%/nix-daemon/shared.hh
  119. if HAVE_LIBBZ2
  120. guix_daemon_LDADD += -lbz2
  121. endif HAVE_LIBBZ2
  122. noinst_HEADERS = \
  123. $(libformat_headers) $(libutil_headers) $(libstore_headers) \
  124. $(guix_daemon_headers)
  125. %D%/libstore/schema.sql.hh: guix/store/schema.sql
  126. $(AM_V_GEN)$(GUILE) --no-auto-compile -c \
  127. "(use-modules (rnrs io ports)) \
  128. (call-with-output-file \"$@\" \
  129. (lambda (out) \
  130. (call-with-input-file \"$^\" \
  131. (lambda (in) \
  132. (write (get-string-all in) out)))))"
  133. nodist_pkglibexec_SCRIPTS = \
  134. %D%/scripts/list-runtime-roots \
  135. %D%/scripts/substitute \
  136. %D%/scripts/download
  137. if BUILD_DAEMON_OFFLOAD
  138. nodist_pkglibexec_SCRIPTS += \
  139. %D%/scripts/offload
  140. endif BUILD_DAEMON_OFFLOAD
  141. nodist_pkglibexec_SCRIPTS += \
  142. %D%/scripts/authenticate
  143. # The '.service' files for systemd.
  144. systemdservicedir = $(libdir)/systemd/system
  145. nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service
  146. etc/guix-%.service: etc/guix-%.service.in \
  147. $(top_builddir)/config.status
  148. $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
  149. $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
  150. "$<" > "$@.tmp"; \
  151. mv "$@.tmp" "$@"
  152. # The '.conf' jobs for Upstart.
  153. upstartjobdir = $(libdir)/upstart/system
  154. nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
  155. etc/guix-%.conf: etc/guix-%.conf.in \
  156. $(top_builddir)/config.status
  157. $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
  158. $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
  159. "$<" > "$@.tmp"; \
  160. mv "$@.tmp" "$@"
  161. CLEANFILES += \
  162. $(nodist_systemdservice_DATA) \
  163. $(nodist_upstartjob_DATA)
  164. EXTRA_DIST += \
  165. %D%/AUTHORS \
  166. %D%/COPYING \
  167. etc/guix-daemon.service.in \
  168. etc/guix-daemon.conf.in \
  169. etc/guix-publish.service.in \
  170. etc/guix-publish.conf.in
  171. if CAN_RUN_TESTS
  172. AM_TESTS_ENVIRONMENT += \
  173. top_builddir="$(abs_top_builddir)"
  174. TESTS += \
  175. tests/guix-daemon.sh
  176. endif CAN_RUN_TESTS
  177. clean-local:
  178. -if test -d "$(GUIX_TEST_ROOT)"; then \
  179. find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
  180. fi
  181. -rm -rf "$(GUIX_TEST_ROOT)"