doc: Update description of the chroot contents.
[jackhill/guix/guix.git] / daemon.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
d43eb499 2# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
c2033df4 3#
233e7676 4# This file is part of GNU Guix.
c2033df4 5#
233e7676 6# GNU Guix is free software; you can redistribute it and/or modify it
c2033df4
LC
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#
233e7676 11# GNU Guix is distributed in the hope that it will be useful, but
c2033df4
LC
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
233e7676 17# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c2033df4
LC
18
19#
20# Integration of the `guix-daemon' code taken from upstream Nix.
21#
22
23BUILT_SOURCES = nix/libstore/schema.sql.hh
24CLEANFILES += $(BUILT_SOURCES)
25
26noinst_LIBRARIES = libformat.a libutil.a libstore.a
27
996ed6ac
LC
28AM_CXXFLAGS = -Wall
29
c2033df4
LC
30libformat_a_SOURCES = \
31 nix/boost/format/free_funcs.cc \
32 nix/boost/format/parsing.cc \
33 nix/boost/format/format_implementation.cc
34
35libformat_headers = \
36 nix/boost/weak_ptr.hpp \
37 nix/boost/throw_exception.hpp \
38 nix/boost/checked_delete.hpp \
39 nix/boost/shared_ptr.hpp \
40 nix/boost/format.hpp \
41 nix/boost/assert.hpp \
42 nix/boost/format/macros_default.hpp \
43 nix/boost/format/format_fwd.hpp \
44 nix/boost/format/format_class.hpp \
45 nix/boost/format/exceptions.hpp \
46 nix/boost/format/group.hpp \
47 nix/boost/format/feed_args.hpp \
48 nix/boost/format/internals_fwd.hpp \
49 nix/boost/format/internals.hpp \
50 nix/boost/detail/workaround.hpp \
51 nix/boost/detail/shared_count.hpp \
52 nix/boost/enable_shared_from_this.hpp
53
54libformat_a_CPPFLAGS = \
55 -I$(top_srcdir)/nix
56
57libutil_a_SOURCES = \
58 nix/libutil/archive.cc \
d43eb499 59 nix/libutil/affinity.cc \
c2033df4 60 nix/libutil/serialise.cc \
c2033df4
LC
61 nix/libutil/util.cc \
62 nix/libutil/xml-writer.cc \
63 nix/libutil/hash.cc \
64 nix/libutil/gcrypt-hash.cc
65
66libutil_headers = \
d43eb499 67 nix/libutil/affinity.hh \
c2033df4
LC
68 nix/libutil/hash.hh \
69 nix/libutil/serialise.hh \
70 nix/libutil/xml-writer.hh \
71 nix/libutil/util.hh \
72 nix/libutil/archive.hh \
73 nix/libutil/types.hh \
74 nix/libutil/gcrypt-hash.hh \
75 nix/libutil/md5.h \
76 nix/libutil/sha1.h \
77 nix/libutil/sha256.h
78
79libutil_a_CPPFLAGS = \
80 -I$(top_builddir)/nix \
81 -I$(top_srcdir)/nix/libutil \
82 $(libformat_a_CPPFLAGS)
83
84libstore_a_SOURCES = \
85 nix/libstore/gc.cc \
86 nix/libstore/globals.cc \
87 nix/libstore/misc.cc \
88 nix/libstore/references.cc \
89 nix/libstore/store-api.cc \
90 nix/libstore/optimise-store.cc \
91 nix/libstore/local-store.cc \
92 nix/libstore/remote-store.cc \
93 nix/libstore/build.cc \
94 nix/libstore/pathlocks.cc \
95 nix/libstore/derivations.cc
96
97libstore_headers = \
98 nix/libstore/references.hh \
99 nix/libstore/pathlocks.hh \
100 nix/libstore/globals.hh \
101 nix/libstore/schema.sql.hh \
102 nix/libstore/worker-protocol.hh \
103 nix/libstore/remote-store.hh \
104 nix/libstore/derivations.hh \
105 nix/libstore/misc.hh \
106 nix/libstore/local-store.hh \
107 nix/libstore/store-api.hh
108
109libstore_a_CPPFLAGS = \
110 $(libutil_a_CPPFLAGS) \
111 -I$(top_srcdir)/nix/libstore \
0442d345 112 -I$(top_builddir)/nix/libstore \
c2033df4
LC
113 -DNIX_STORE_DIR=\"$(storedir)\" \
114 -DNIX_DATA_DIR=\"$(datadir)\" \
f5768afa
LC
115 -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
116 -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
526382ff 117 -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \
c2033df4
LC
118 -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
119 -DNIX_BIN_DIR=\"$(bindir)\" \
526382ff 120 -DOPENSSL_PATH="\"guix-authenticate\""
c2033df4 121
52e5910c 122libstore_a_CXXFLAGS = \
c2033df4
LC
123 $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
124
125bin_PROGRAMS = guix-daemon
a7a4e6a4 126sbin_PROGRAMS = guix-register
c2033df4
LC
127
128guix_daemon_SOURCES = \
129 nix/nix-daemon/nix-daemon.cc \
130 nix/nix-daemon/guix-daemon.cc
131
132guix_daemon_CPPFLAGS = \
133 $(libutil_a_CPPFLAGS) \
134 -I$(top_srcdir)/nix/libstore
135
136guix_daemon_LDADD = \
137 libstore.a libutil.a libformat.a -lbz2 \
138 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
139
351782e2
LC
140guix_daemon_headers = \
141 nix/nix-daemon/shared.hh
c2033df4 142
a7a4e6a4
LC
143
144guix_register_SOURCES = \
145 nix/guix-register/guix-register.cc
146
147guix_register_CPPFLAGS = \
148 $(libutil_a_CPPFLAGS) \
149 $(libstore_a_CPPFLAGS) \
150 -I$(top_srcdir)/nix/libstore
151
152# XXX: Should we start using shared libs?
153guix_register_LDADD = \
154 libstore.a libutil.a libformat.a -lbz2 \
155 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
156
157
c2033df4 158noinst_HEADERS = \
351782e2
LC
159 $(libformat_headers) $(libutil_headers) $(libstore_headers) \
160 $(guix_daemon_headers)
c2033df4
LC
161
162nix/libstore/schema.sql.hh: nix/libstore/schema.sql
163 $(GUILE) --no-auto-compile -c \
164 "(use-modules (rnrs io ports)) \
165 (call-with-output-file \"$@\" \
166 (lambda (out) \
167 (call-with-input-file \"$^\" \
168 (lambda (in) \
169 (write (get-string-all in) out)))))"
170
f5c82e15 171nodist_pkglibexec_SCRIPTS = \
f65cf81a
LC
172 nix/scripts/list-runtime-roots \
173 nix/scripts/substitute-binary
f5c82e15 174
49e6291a
LC
175if BUILD_DAEMON_OFFLOAD
176
177nodist_pkglibexec_SCRIPTS += \
178 nix/scripts/offload
179
180endif BUILD_DAEMON_OFFLOAD
181
182
7edccf4d
LC
183# XXX: It'd be better to hide it in $(pkglibexecdir).
184nodist_libexec_SCRIPTS = \
185 nix/scripts/guix-authenticate
186
c2033df4 187EXTRA_DIST += \
b49ffe2d 188 nix/sync-with-upstream \
c2033df4
LC
189 nix/libstore/schema.sql \
190 nix/AUTHORS \
191 nix/COPYING
d23077dc 192
d23077dc 193AM_TESTS_ENVIRONMENT += \
69cfce50 194 top_builddir="$(abs_top_builddir)"
d23077dc
LC
195
196TESTS += \
197 tests/guix-daemon.sh
198
199clean-local:
03fa2758
LC
200 -if test -d "$(GUIX_TEST_ROOT)"; then \
201 find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
202 fi
69cfce50 203 -rm -rf "$(GUIX_TEST_ROOT)"