Commit | Line | Data |
---|---|---|
c2033df4 LC |
1 | # Guix --- Nix package management from Guile. -*- coding: utf-8 -*- |
2 | # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> | |
3 | # | |
4 | # This file is part of Guix. | |
5 | # | |
6 | # 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 | # 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 Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | # | |
20 | # Integration of the `guix-daemon' code taken from upstream Nix. | |
21 | # | |
22 | ||
23 | BUILT_SOURCES = nix/libstore/schema.sql.hh | |
24 | CLEANFILES += $(BUILT_SOURCES) | |
25 | ||
26 | noinst_LIBRARIES = libformat.a libutil.a libstore.a | |
27 | ||
28 | libformat_a_SOURCES = \ | |
29 | nix/boost/format/free_funcs.cc \ | |
30 | nix/boost/format/parsing.cc \ | |
31 | nix/boost/format/format_implementation.cc | |
32 | ||
33 | libformat_headers = \ | |
34 | nix/boost/weak_ptr.hpp \ | |
35 | nix/boost/throw_exception.hpp \ | |
36 | nix/boost/checked_delete.hpp \ | |
37 | nix/boost/shared_ptr.hpp \ | |
38 | nix/boost/format.hpp \ | |
39 | nix/boost/assert.hpp \ | |
40 | nix/boost/format/macros_default.hpp \ | |
41 | nix/boost/format/format_fwd.hpp \ | |
42 | nix/boost/format/format_class.hpp \ | |
43 | nix/boost/format/exceptions.hpp \ | |
44 | nix/boost/format/group.hpp \ | |
45 | nix/boost/format/feed_args.hpp \ | |
46 | nix/boost/format/internals_fwd.hpp \ | |
47 | nix/boost/format/internals.hpp \ | |
48 | nix/boost/detail/workaround.hpp \ | |
49 | nix/boost/detail/shared_count.hpp \ | |
50 | nix/boost/enable_shared_from_this.hpp | |
51 | ||
52 | libformat_a_CPPFLAGS = \ | |
53 | -I$(top_srcdir)/nix | |
54 | ||
55 | libutil_a_SOURCES = \ | |
56 | nix/libutil/archive.cc \ | |
57 | nix/libutil/serialise.cc \ | |
58 | nix/libutil/immutable.cc \ | |
59 | nix/libutil/util.cc \ | |
60 | nix/libutil/xml-writer.cc \ | |
61 | nix/libutil/hash.cc \ | |
62 | nix/libutil/gcrypt-hash.cc | |
63 | ||
64 | libutil_headers = \ | |
65 | nix/libutil/immutable.hh \ | |
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 | ||
77 | libutil_a_CPPFLAGS = \ | |
78 | -I$(top_builddir)/nix \ | |
79 | -I$(top_srcdir)/nix/libutil \ | |
80 | $(libformat_a_CPPFLAGS) | |
81 | ||
82 | libstore_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 | ||
95 | libstore_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 | ||
107 | libstore_a_CPPFLAGS = \ | |
108 | $(libutil_a_CPPFLAGS) \ | |
109 | -I$(top_srcdir)/nix/libstore \ | |
110 | -DNIX_STORE_DIR=\"$(storedir)\" \ | |
111 | -DNIX_DATA_DIR=\"$(datadir)\" \ | |
112 | -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \ | |
113 | -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ | |
114 | -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ | |
115 | -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ | |
116 | -DNIX_BIN_DIR=\"$(bindir)\" \ | |
a9128eac | 117 | -DOPENSSL_PATH="\"openssl\"" |
c2033df4 LC |
118 | |
119 | libstore_a_CFLAGS = \ | |
120 | $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) | |
121 | ||
122 | bin_PROGRAMS = guix-daemon | |
123 | ||
124 | guix_daemon_SOURCES = \ | |
125 | nix/nix-daemon/nix-daemon.cc \ | |
126 | nix/nix-daemon/guix-daemon.cc | |
127 | ||
128 | guix_daemon_CPPFLAGS = \ | |
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 | ||
351782e2 LC |
136 | guix_daemon_headers = \ |
137 | nix/nix-daemon/shared.hh | |
c2033df4 | 138 | |
e1b7096a LC |
139 | libexec_PROGRAMS = nix-setuid-helper |
140 | nix_setuid_helper_SOURCES = \ | |
141 | nix/nix-setuid-helper/nix-setuid-helper.cc | |
142 | ||
143 | nix_setuid_helper_CPPFLAGS = \ | |
144 | $(libutil_a_CPPFLAGS) | |
145 | ||
146 | nix_setuid_helper_LDADD = \ | |
147 | libutil.a libformat.a | |
148 | ||
c2033df4 | 149 | noinst_HEADERS = \ |
351782e2 LC |
150 | $(libformat_headers) $(libutil_headers) $(libstore_headers) \ |
151 | $(guix_daemon_headers) | |
c2033df4 LC |
152 | |
153 | nix/libstore/schema.sql.hh: nix/libstore/schema.sql | |
154 | $(GUILE) --no-auto-compile -c \ | |
155 | "(use-modules (rnrs io ports)) \ | |
156 | (call-with-output-file \"$@\" \ | |
157 | (lambda (out) \ | |
158 | (call-with-input-file \"$^\" \ | |
159 | (lambda (in) \ | |
160 | (write (get-string-all in) out)))))" | |
161 | ||
f5c82e15 LC |
162 | nodist_pkglibexec_SCRIPTS = \ |
163 | nix/scripts/list-runtime-roots | |
164 | ||
c2033df4 | 165 | EXTRA_DIST += \ |
b49ffe2d | 166 | nix/sync-with-upstream \ |
c2033df4 LC |
167 | nix/libstore/schema.sql \ |
168 | nix/AUTHORS \ | |
169 | nix/COPYING | |
d23077dc | 170 | |
d23077dc | 171 | AM_TESTS_ENVIRONMENT += \ |
69cfce50 | 172 | top_builddir="$(abs_top_builddir)" |
d23077dc LC |
173 | |
174 | TESTS += \ | |
175 | tests/guix-daemon.sh | |
176 | ||
177 | clean-local: | |
69cfce50 LC |
178 | -find "$(GUIX_TEST_ROOT)" | xargs chmod +w |
179 | -rm -rf "$(GUIX_TEST_ROOT)" |