| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 | BUILT_SOURCES += %D%/libstore/schema.sql.hh
|
| 26 | CLEANFILES += %D%/libstore/schema.sql.hh
|
| 27 |
|
| 28 | noinst_LIBRARIES = libutil.a libstore.a
|
| 29 |
|
| 30 |
|
| 31 | AM_CXXFLAGS = -Wall -std=c++20
|
| 32 |
|
| 33 | libutil_a_SOURCES = \
|
| 34 | %D%/libutil/archive.cc \
|
| 35 | %D%/libutil/affinity.cc \
|
| 36 | %D%/libutil/serialise.cc \
|
| 37 | %D%/libutil/util.cc \
|
| 38 | %D%/libutil/hash.cc \
|
| 39 | %D%/libutil/spawn.cc \
|
| 40 | %D%/libutil/seccomp.cc
|
| 41 |
|
| 42 | libutil_headers = \
|
| 43 | %D%/libutil/affinity.hh \
|
| 44 | %D%/libutil/hash.hh \
|
| 45 | %D%/libutil/serialise.hh \
|
| 46 | %D%/libutil/util.hh \
|
| 47 | %D%/libutil/archive.hh \
|
| 48 | %D%/libutil/types.hh \
|
| 49 | %D%/libutil/spawn.hh \
|
| 50 | %D%/libutil/seccomp.hh
|
| 51 |
|
| 52 | libutil_a_CPPFLAGS = \
|
| 53 | -I$(top_builddir)/nix \
|
| 54 | -I$(top_srcdir)/%D%/libutil \
|
| 55 | $(LIBGCRYPT_CPPFLAGS)
|
| 56 |
|
| 57 | libstore_a_SOURCES = \
|
| 58 | %D%/libstore/gc.cc \
|
| 59 | %D%/libstore/globals.cc \
|
| 60 | %D%/libstore/misc.cc \
|
| 61 | %D%/libstore/references.cc \
|
| 62 | %D%/libstore/store-api.cc \
|
| 63 | %D%/libstore/optimise-store.cc \
|
| 64 | %D%/libstore/local-store.cc \
|
| 65 | %D%/libstore/build.cc \
|
| 66 | %D%/libstore/pathlocks.cc \
|
| 67 | %D%/libstore/derivations.cc \
|
| 68 | %D%/libstore/builtins.cc \
|
| 69 | %D%/libstore/sqlite.cc
|
| 70 |
|
| 71 | libstore_headers = \
|
| 72 | %D%/libstore/references.hh \
|
| 73 | %D%/libstore/pathlocks.hh \
|
| 74 | %D%/libstore/globals.hh \
|
| 75 | %D%/libstore/worker-protocol.hh \
|
| 76 | %D%/libstore/derivations.hh \
|
| 77 | %D%/libstore/misc.hh \
|
| 78 | %D%/libstore/local-store.hh \
|
| 79 | %D%/libstore/sqlite.hh \
|
| 80 | %D%/libstore/builtins.hh \
|
| 81 | %D%/libstore/store-api.hh
|
| 82 |
|
| 83 | libstore_a_CPPFLAGS = \
|
| 84 | $(libutil_a_CPPFLAGS) \
|
| 85 | -I$(top_srcdir)/%D%/libstore \
|
| 86 | -I$(top_builddir)/%D%/libstore \
|
| 87 | -DNIX_STORE_DIR=\"$(storedir)\" \
|
| 88 | -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
|
| 89 | -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
|
| 90 | -DGUIX_CONFIGURATION_DIRECTORY=\"$(sysconfdir)/guix\" \
|
| 91 | -DNIX_BIN_DIR=\"$(bindir)\" \
|
| 92 | -DDEFAULT_CHROOT_DIRS="\"\""
|
| 93 |
|
| 94 | libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \
|
| 95 | $(SQLITE3_CFLAGS)
|
| 96 |
|
| 97 | bin_PROGRAMS = guix-daemon
|
| 98 |
|
| 99 | guix_daemon_SOURCES = \
|
| 100 | %D%/nix-daemon/nix-daemon.cc \
|
| 101 | %D%/nix-daemon/guix-daemon.cc
|
| 102 |
|
| 103 | guix_daemon_CPPFLAGS = \
|
| 104 | -DLOCALEDIR=\"$(localedir)\" \
|
| 105 | $(libutil_a_CPPFLAGS) \
|
| 106 | -I$(top_srcdir)/%D%/libstore
|
| 107 |
|
| 108 | guix_daemon_LDFLAGS = \
|
| 109 | $(LIBGCRYPT_LDFLAGS)
|
| 110 |
|
| 111 | guix_daemon_LDADD = \
|
| 112 | libstore.a libutil.a -lz \
|
| 113 | $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
|
| 114 |
|
| 115 | guix_daemon_headers = \
|
| 116 | %D%/nix-daemon/nix-daemon.hh
|
| 117 |
|
| 118 | if HAVE_LIBBZ2
|
| 119 |
|
| 120 | guix_daemon_LDADD += -lbz2
|
| 121 |
|
| 122 | endif HAVE_LIBBZ2
|
| 123 |
|
| 124 | noinst_HEADERS = \
|
| 125 | $(libutil_headers) $(libstore_headers) \
|
| 126 | $(guix_daemon_headers)
|
| 127 |
|
| 128 | %D%/libstore/schema.sql.hh: guix/store/schema.sql
|
| 129 | $(AM_V_GEN)$(GUILE) --no-auto-compile -c \
|
| 130 | "(use-modules (rnrs io ports)) \
|
| 131 | (call-with-output-file \"$@\" \
|
| 132 | (lambda (out) \
|
| 133 | (call-with-input-file \"$^\" \
|
| 134 | (lambda (in) \
|
| 135 | (write (get-string-all in) out)))))"
|
| 136 |
|
| 137 |
|
| 138 | systemdservicedir = $(libdir)/systemd/system
|
| 139 | nodist_systemdservice_DATA = \
|
| 140 | etc/gnu-store.mount \
|
| 141 | etc/guix-daemon.service \
|
| 142 | etc/guix-publish.service \
|
| 143 | etc/guix-gc.service \
|
| 144 | etc/guix-gc.timer
|
| 145 |
|
| 146 | etc/%.mount: etc/%.mount.in \
|
| 147 | $(top_builddir)/config.status
|
| 148 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 149 | $(SED) -e 's|@''storedir''@|$(storedir)|' < \
|
| 150 | "$<" > "$@.tmp"; \
|
| 151 | mv "$@.tmp" "$@"
|
| 152 |
|
| 153 | etc/guix-%.service: etc/guix-%.service.in \
|
| 154 | $(top_builddir)/config.status
|
| 155 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 156 | $(SED) -e 's|@''localstatedir''@|$(localstatedir)|g' \
|
| 157 | -e 's|@''storedir''@|$(storedir)|g' \
|
| 158 | -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
|
| 159 | < "$<" > "$@.tmp"; \
|
| 160 | mv "$@.tmp" "$@"
|
| 161 |
|
| 162 | etc/guix-gc.timer: etc/guix-gc.timer.in \
|
| 163 | $(top_builddir)/config.status
|
| 164 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 165 | cp "$<" "$@"
|
| 166 |
|
| 167 |
|
| 168 | sysvinitservicedir = $(sysconfdir)/init.d
|
| 169 | nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
|
| 170 |
|
| 171 | etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \
|
| 172 | $(top_builddir)/config.status
|
| 173 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 174 | $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \
|
| 175 | -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
|
| 176 | < "$<" > "$@.tmp"; \
|
| 177 | mv "$@.tmp" "$@"
|
| 178 |
|
| 179 |
|
| 180 | openrcservicedir = $(sysconfdir)/openrc
|
| 181 | nodist_openrcservice_DATA = etc/openrc/guix-daemon
|
| 182 |
|
| 183 | etc/openrc/guix-daemon: etc/openrc/guix-daemon.in \
|
| 184 | $(top_builddir)/config.status
|
| 185 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 186 | $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \
|
| 187 | "$<" > "$@.tmp"; \
|
| 188 | mv "$@.tmp" "$@"
|
| 189 |
|
| 190 |
|
| 191 | upstartjobdir = $(libdir)/upstart/system
|
| 192 | nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf
|
| 193 |
|
| 194 | etc/guix-%.conf: etc/guix-%.conf.in \
|
| 195 | $(top_builddir)/config.status
|
| 196 | $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
|
| 197 | $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \
|
| 198 | -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \
|
| 199 | < "$<" > "$@.tmp"; \
|
| 200 | mv "$@.tmp" "$@"
|
| 201 |
|
| 202 | CLEANFILES += \
|
| 203 | $(nodist_systemdservice_DATA) \
|
| 204 | $(nodist_upstartjob_DATA) \
|
| 205 | $(nodist_sysvinitservice_DATA) \
|
| 206 | $(nodist_openrcservice_DATA)
|
| 207 |
|
| 208 | EXTRA_DIST += \
|
| 209 | %D%/AUTHORS \
|
| 210 | %D%/COPYING \
|
| 211 | etc/gnu-store.mount.in \
|
| 212 | etc/guix-daemon.service.in \
|
| 213 | etc/guix-daemon.conf.in \
|
| 214 | etc/guix-publish.service.in \
|
| 215 | etc/guix-publish.conf.in \
|
| 216 | etc/guix-gc.service.in \
|
| 217 | etc/guix-gc.timer.in \
|
| 218 | etc/init.d/guix-daemon.in \
|
| 219 | etc/openrc/guix-daemon.in
|
| 220 |
|
| 221 | if CAN_RUN_TESTS
|
| 222 |
|
| 223 | AM_TESTS_ENVIRONMENT += \
|
| 224 | top_builddir="$(abs_top_builddir)"
|
| 225 |
|
| 226 | TESTS += \
|
| 227 | tests/guix-daemon.sh
|
| 228 |
|
| 229 | endif CAN_RUN_TESTS
|
| 230 |
|
| 231 | clean-local:
|
| 232 | -if test -d "$(GUIX_TEST_ROOT)"; then \
|
| 233 | find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \
|
| 234 | fi
|
| 235 | -rm -rf "$(GUIX_TEST_ROOT)"
|