gnu: gtk+-2: Update to 2.24.30.
[jackhill/guix/guix.git] / daemon.am
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012, 2013, 2014, 2015, 2016 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 #
21 # Integration of the `guix-daemon' code taken from upstream Nix.
22 #
23
24 BUILT_SOURCES += nix/libstore/schema.sql.hh
25 CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service etc/guix-daemon.conf
26
27 noinst_LIBRARIES = libformat.a libutil.a libstore.a
28
29 # Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more.
30 AM_CXXFLAGS = -Wall -std=c++11
31
32 libformat_a_SOURCES = \
33 nix/boost/format/free_funcs.cc \
34 nix/boost/format/parsing.cc \
35 nix/boost/format/format_implementation.cc
36
37 libformat_headers = \
38 nix/boost/throw_exception.hpp \
39 nix/boost/format.hpp \
40 nix/boost/assert.hpp \
41 nix/boost/format/macros_default.hpp \
42 nix/boost/format/format_fwd.hpp \
43 nix/boost/format/format_class.hpp \
44 nix/boost/format/exceptions.hpp \
45 nix/boost/format/group.hpp \
46 nix/boost/format/feed_args.hpp \
47 nix/boost/format/internals_fwd.hpp \
48 nix/boost/format/internals.hpp
49
50 libformat_a_CPPFLAGS = \
51 -I$(top_srcdir)/nix
52
53 libutil_a_SOURCES = \
54 nix/libutil/archive.cc \
55 nix/libutil/affinity.cc \
56 nix/libutil/serialise.cc \
57 nix/libutil/util.cc \
58 nix/libutil/xml-writer.cc \
59 nix/libutil/hash.cc \
60 nix/libutil/gcrypt-hash.cc
61
62 libutil_headers = \
63 nix/libutil/affinity.hh \
64 nix/libutil/hash.hh \
65 nix/libutil/serialise.hh \
66 nix/libutil/xml-writer.hh \
67 nix/libutil/util.hh \
68 nix/libutil/archive.hh \
69 nix/libutil/types.hh \
70 nix/libutil/gcrypt-hash.hh \
71 nix/libutil/md5.h \
72 nix/libutil/sha1.h \
73 nix/libutil/sha256.h \
74 nix/libutil/sha512.h
75
76 libutil_a_CPPFLAGS = \
77 -I$(top_builddir)/nix \
78 -I$(top_srcdir)/nix/libutil \
79 $(libformat_a_CPPFLAGS)
80
81 libstore_a_SOURCES = \
82 nix/libstore/gc.cc \
83 nix/libstore/globals.cc \
84 nix/libstore/misc.cc \
85 nix/libstore/references.cc \
86 nix/libstore/store-api.cc \
87 nix/libstore/optimise-store.cc \
88 nix/libstore/local-store.cc \
89 nix/libstore/build.cc \
90 nix/libstore/pathlocks.cc \
91 nix/libstore/derivations.cc
92
93 libstore_headers = \
94 nix/libstore/references.hh \
95 nix/libstore/pathlocks.hh \
96 nix/libstore/globals.hh \
97 nix/libstore/worker-protocol.hh \
98 nix/libstore/derivations.hh \
99 nix/libstore/misc.hh \
100 nix/libstore/local-store.hh \
101 nix/libstore/store-api.hh
102
103 libstore_a_CPPFLAGS = \
104 $(libutil_a_CPPFLAGS) \
105 -I$(top_srcdir)/nix/libstore \
106 -I$(top_builddir)/nix/libstore \
107 -DNIX_STORE_DIR=\"$(storedir)\" \
108 -DNIX_DATA_DIR=\"$(datadir)\" \
109 -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
110 -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
111 -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \
112 -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
113 -DNIX_BIN_DIR=\"$(bindir)\" \
114 -DOPENSSL_PATH="\"guix-authenticate\"" \
115 -DDEFAULT_CHROOT_DIRS="\"\""
116
117 libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \
118 $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
119
120 bin_PROGRAMS = guix-daemon
121 sbin_PROGRAMS = guix-register
122
123 guix_daemon_SOURCES = \
124 nix/nix-daemon/nix-daemon.cc \
125 nix/nix-daemon/guix-daemon.cc
126
127 guix_daemon_CPPFLAGS = \
128 -DLOCALEDIR=\"$(localedir)\" \
129 $(libutil_a_CPPFLAGS) \
130 -I$(top_srcdir)/nix/libstore
131
132 guix_daemon_LDADD = \
133 libstore.a libutil.a libformat.a -lbz2 \
134 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
135
136 guix_daemon_headers = \
137 nix/nix-daemon/shared.hh
138
139
140 guix_register_SOURCES = \
141 nix/guix-register/guix-register.cc
142
143 guix_register_CPPFLAGS = \
144 $(libutil_a_CPPFLAGS) \
145 $(libstore_a_CPPFLAGS) \
146 -I$(top_srcdir)/nix/libstore
147
148 # XXX: Should we start using shared libs?
149 guix_register_LDADD = \
150 libstore.a libutil.a libformat.a -lbz2 \
151 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
152
153
154 noinst_HEADERS = \
155 $(libformat_headers) $(libutil_headers) $(libstore_headers) \
156 $(guix_daemon_headers)
157
158 nix/libstore/schema.sql.hh: nix/libstore/schema.sql
159 $(AM_V_GEN)$(GUILE) --no-auto-compile -c \
160 "(use-modules (rnrs io ports)) \
161 (call-with-output-file \"$@\" \
162 (lambda (out) \
163 (call-with-input-file \"$^\" \
164 (lambda (in) \
165 (write (get-string-all in) out)))))"
166
167 nodist_pkglibexec_SCRIPTS = \
168 nix/scripts/list-runtime-roots \
169 nix/scripts/substitute
170
171 if BUILD_DAEMON_OFFLOAD
172
173 nodist_pkglibexec_SCRIPTS += \
174 nix/scripts/offload
175
176 endif BUILD_DAEMON_OFFLOAD
177
178
179 # XXX: It'd be better to hide it in $(pkglibexecdir).
180 nodist_libexec_SCRIPTS = \
181 nix/scripts/guix-authenticate
182
183 # The '.service' file for systemd.
184 systemdservicedir = $(libdir)/systemd/system
185 nodist_systemdservice_DATA = etc/guix-daemon.service
186
187 etc/guix-daemon.service: etc/guix-daemon.service.in \
188 $(top_builddir)/config.status
189 $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
190 $(SED) -e 's|@''bindir''@|$(bindir)|' < \
191 "$(srcdir)/etc/guix-daemon.service.in" > "$@.tmp"; \
192 mv "$@.tmp" "$@"
193
194 # The '.conf' job for Upstart.
195 upstartjobdir = $(libdir)/upstart/system
196 nodist_upstartjob_DATA = etc/guix-daemon.conf
197
198 etc/guix-daemon.conf: etc/guix-daemon.conf.in \
199 $(top_builddir)/config.status
200 $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
201 $(SED) -e 's|@''bindir''@|$(bindir)|' < \
202 "$(srcdir)/etc/guix-daemon.conf.in" > "$@.tmp"; \
203 mv "$@.tmp" "$@"
204
205 EXTRA_DIST += \
206 nix/libstore/schema.sql \
207 nix/AUTHORS \
208 nix/COPYING \
209 etc/guix-daemon.service.in \
210 etc/guix-daemon.conf.in
211
212 if CAN_RUN_TESTS
213
214 AM_TESTS_ENVIRONMENT += \
215 top_builddir="$(abs_top_builddir)"
216
217 TESTS += \
218 tests/guix-daemon.sh
219
220 endif CAN_RUN_TESTS
221
222 clean-local:
223 -if test -d "$(GUIX_TEST_ROOT)"; then \
224 find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
225 fi
226 -rm -rf "$(GUIX_TEST_ROOT)"