| 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2012, 2013 Ludovic Courtès <[email protected]> |
| 3 | # |
| 4 | # This file is part of GNU Guix. |
| 5 | # |
| 6 | # GNU 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 | # GNU 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 GNU 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/util.cc \ |
| 59 | nix/libutil/xml-writer.cc \ |
| 60 | nix/libutil/hash.cc \ |
| 61 | nix/libutil/gcrypt-hash.cc |
| 62 | |
| 63 | libutil_headers = \ |
| 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 | |
| 75 | libutil_a_CPPFLAGS = \ |
| 76 | -I$(top_builddir)/nix \ |
| 77 | -I$(top_srcdir)/nix/libutil \ |
| 78 | $(libformat_a_CPPFLAGS) |
| 79 | |
| 80 | libstore_a_SOURCES = \ |
| 81 | nix/libstore/gc.cc \ |
| 82 | nix/libstore/globals.cc \ |
| 83 | nix/libstore/misc.cc \ |
| 84 | nix/libstore/references.cc \ |
| 85 | nix/libstore/store-api.cc \ |
| 86 | nix/libstore/optimise-store.cc \ |
| 87 | nix/libstore/local-store.cc \ |
| 88 | nix/libstore/remote-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/schema.sql.hh \ |
| 98 | nix/libstore/worker-protocol.hh \ |
| 99 | nix/libstore/remote-store.hh \ |
| 100 | nix/libstore/derivations.hh \ |
| 101 | nix/libstore/misc.hh \ |
| 102 | nix/libstore/local-store.hh \ |
| 103 | nix/libstore/store-api.hh |
| 104 | |
| 105 | libstore_a_CPPFLAGS = \ |
| 106 | $(libutil_a_CPPFLAGS) \ |
| 107 | -I$(top_srcdir)/nix/libstore \ |
| 108 | -DNIX_STORE_DIR=\"$(storedir)\" \ |
| 109 | -DNIX_DATA_DIR=\"$(datadir)\" \ |
| 110 | -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \ |
| 111 | -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ |
| 112 | -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ |
| 113 | -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ |
| 114 | -DNIX_BIN_DIR=\"$(bindir)\" \ |
| 115 | -DOPENSSL_PATH="\"openssl\"" |
| 116 | |
| 117 | libstore_a_CFLAGS = \ |
| 118 | $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) |
| 119 | |
| 120 | bin_PROGRAMS = guix-daemon |
| 121 | |
| 122 | guix_daemon_SOURCES = \ |
| 123 | nix/nix-daemon/nix-daemon.cc \ |
| 124 | nix/nix-daemon/guix-daemon.cc |
| 125 | |
| 126 | guix_daemon_CPPFLAGS = \ |
| 127 | $(libutil_a_CPPFLAGS) \ |
| 128 | -I$(top_srcdir)/nix/libstore |
| 129 | |
| 130 | guix_daemon_LDADD = \ |
| 131 | libstore.a libutil.a libformat.a -lbz2 \ |
| 132 | $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) |
| 133 | |
| 134 | guix_daemon_headers = \ |
| 135 | nix/nix-daemon/shared.hh |
| 136 | |
| 137 | libexec_PROGRAMS = nix-setuid-helper |
| 138 | nix_setuid_helper_SOURCES = \ |
| 139 | nix/nix-setuid-helper/nix-setuid-helper.cc |
| 140 | |
| 141 | nix_setuid_helper_CPPFLAGS = \ |
| 142 | $(libutil_a_CPPFLAGS) |
| 143 | |
| 144 | nix_setuid_helper_LDADD = \ |
| 145 | libutil.a libformat.a |
| 146 | |
| 147 | noinst_HEADERS = \ |
| 148 | $(libformat_headers) $(libutil_headers) $(libstore_headers) \ |
| 149 | $(guix_daemon_headers) |
| 150 | |
| 151 | nix/libstore/schema.sql.hh: nix/libstore/schema.sql |
| 152 | $(GUILE) --no-auto-compile -c \ |
| 153 | "(use-modules (rnrs io ports)) \ |
| 154 | (call-with-output-file \"$@\" \ |
| 155 | (lambda (out) \ |
| 156 | (call-with-input-file \"$^\" \ |
| 157 | (lambda (in) \ |
| 158 | (write (get-string-all in) out)))))" |
| 159 | |
| 160 | nodist_pkglibexec_SCRIPTS = \ |
| 161 | nix/scripts/list-runtime-roots |
| 162 | |
| 163 | EXTRA_DIST += \ |
| 164 | nix/sync-with-upstream \ |
| 165 | nix/libstore/schema.sql \ |
| 166 | nix/AUTHORS \ |
| 167 | nix/COPYING |
| 168 | |
| 169 | AM_TESTS_ENVIRONMENT += \ |
| 170 | top_builddir="$(abs_top_builddir)" |
| 171 | |
| 172 | TESTS += \ |
| 173 | tests/guix-daemon.sh |
| 174 | |
| 175 | clean-local: |
| 176 | -if test -d "$(GUIX_TEST_ROOT)"; then \ |
| 177 | find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \ |
| 178 | fi |
| 179 | -rm -rf "$(GUIX_TEST_ROOT)" |