gnu: Add IceCat.
[jackhill/guix/guix.git] / daemon.am
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
f4b60f5f 2# Copyright © 2012, 2013 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 \
59 nix/libutil/serialise.cc \
c2033df4
LC
60 nix/libutil/util.cc \
61 nix/libutil/xml-writer.cc \
62 nix/libutil/hash.cc \
63 nix/libutil/gcrypt-hash.cc
64
65libutil_headers = \
c2033df4
LC
66 nix/libutil/hash.hh \
67 nix/libutil/serialise.hh \
68 nix/libutil/xml-writer.hh \
69 nix/libutil/util.hh \
70 nix/libutil/archive.hh \
71 nix/libutil/types.hh \
72 nix/libutil/gcrypt-hash.hh \
73 nix/libutil/md5.h \
74 nix/libutil/sha1.h \
75 nix/libutil/sha256.h
76
77libutil_a_CPPFLAGS = \
78 -I$(top_builddir)/nix \
79 -I$(top_srcdir)/nix/libutil \
80 $(libformat_a_CPPFLAGS)
81
82libstore_a_SOURCES = \
83 nix/libstore/gc.cc \
84 nix/libstore/globals.cc \
85 nix/libstore/misc.cc \
86 nix/libstore/references.cc \
87 nix/libstore/store-api.cc \
88 nix/libstore/optimise-store.cc \
89 nix/libstore/local-store.cc \
90 nix/libstore/remote-store.cc \
91 nix/libstore/build.cc \
92 nix/libstore/pathlocks.cc \
93 nix/libstore/derivations.cc
94
95libstore_headers = \
96 nix/libstore/references.hh \
97 nix/libstore/pathlocks.hh \
98 nix/libstore/globals.hh \
99 nix/libstore/schema.sql.hh \
100 nix/libstore/worker-protocol.hh \
101 nix/libstore/remote-store.hh \
102 nix/libstore/derivations.hh \
103 nix/libstore/misc.hh \
104 nix/libstore/local-store.hh \
105 nix/libstore/store-api.hh
106
107libstore_a_CPPFLAGS = \
108 $(libutil_a_CPPFLAGS) \
109 -I$(top_srcdir)/nix/libstore \
0442d345 110 -I$(top_builddir)/nix/libstore \
c2033df4
LC
111 -DNIX_STORE_DIR=\"$(storedir)\" \
112 -DNIX_DATA_DIR=\"$(datadir)\" \
113 -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
114 -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
115 -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
116 -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
117 -DNIX_BIN_DIR=\"$(bindir)\" \
a9128eac 118 -DOPENSSL_PATH="\"openssl\""
c2033df4 119
52e5910c 120libstore_a_CXXFLAGS = \
c2033df4
LC
121 $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
122
123bin_PROGRAMS = guix-daemon
a7a4e6a4 124sbin_PROGRAMS = guix-register
c2033df4
LC
125
126guix_daemon_SOURCES = \
127 nix/nix-daemon/nix-daemon.cc \
128 nix/nix-daemon/guix-daemon.cc
129
130guix_daemon_CPPFLAGS = \
131 $(libutil_a_CPPFLAGS) \
132 -I$(top_srcdir)/nix/libstore
133
134guix_daemon_LDADD = \
135 libstore.a libutil.a libformat.a -lbz2 \
136 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
137
351782e2
LC
138guix_daemon_headers = \
139 nix/nix-daemon/shared.hh
c2033df4 140
a7a4e6a4
LC
141
142guix_register_SOURCES = \
143 nix/guix-register/guix-register.cc
144
145guix_register_CPPFLAGS = \
146 $(libutil_a_CPPFLAGS) \
147 $(libstore_a_CPPFLAGS) \
148 -I$(top_srcdir)/nix/libstore
149
150# XXX: Should we start using shared libs?
151guix_register_LDADD = \
152 libstore.a libutil.a libformat.a -lbz2 \
153 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
154
155
e1b7096a
LC
156libexec_PROGRAMS = nix-setuid-helper
157nix_setuid_helper_SOURCES = \
158 nix/nix-setuid-helper/nix-setuid-helper.cc
159
160nix_setuid_helper_CPPFLAGS = \
161 $(libutil_a_CPPFLAGS)
162
163nix_setuid_helper_LDADD = \
164 libutil.a libformat.a
165
c2033df4 166noinst_HEADERS = \
351782e2
LC
167 $(libformat_headers) $(libutil_headers) $(libstore_headers) \
168 $(guix_daemon_headers)
c2033df4
LC
169
170nix/libstore/schema.sql.hh: nix/libstore/schema.sql
171 $(GUILE) --no-auto-compile -c \
172 "(use-modules (rnrs io ports)) \
173 (call-with-output-file \"$@\" \
174 (lambda (out) \
175 (call-with-input-file \"$^\" \
176 (lambda (in) \
177 (write (get-string-all in) out)))))"
178
f5c82e15 179nodist_pkglibexec_SCRIPTS = \
f65cf81a
LC
180 nix/scripts/list-runtime-roots \
181 nix/scripts/substitute-binary
f5c82e15 182
c2033df4 183EXTRA_DIST += \
b49ffe2d 184 nix/sync-with-upstream \
c2033df4
LC
185 nix/libstore/schema.sql \
186 nix/AUTHORS \
187 nix/COPYING
d23077dc 188
d23077dc 189AM_TESTS_ENVIRONMENT += \
69cfce50 190 top_builddir="$(abs_top_builddir)"
d23077dc
LC
191
192TESTS += \
193 tests/guix-daemon.sh
194
195clean-local:
03fa2758
LC
196 -if test -d "$(GUIX_TEST_ROOT)"; then \
197 find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
198 fi
69cfce50 199 -rm -rf "$(GUIX_TEST_ROOT)"