guix-install.sh: Support OpenRC.
[jackhill/guix/guix.git] / nix / local.mk
index 3971771..2bb0104 100644 (file)
@@ -1,6 +1,7 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
+# Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 #
 # This file is part of GNU Guix.
 #
@@ -55,8 +56,7 @@ libutil_a_SOURCES =                           \
   %D%/libutil/affinity.cc                      \
   %D%/libutil/serialise.cc                     \
   %D%/libutil/util.cc                          \
-  %D%/libutil/hash.cc                          \
-  %D%/libutil/gcrypt-hash.cc
+  %D%/libutil/hash.cc
 
 libutil_headers =                              \
   %D%/libutil/affinity.hh                      \
@@ -64,12 +64,7 @@ libutil_headers =                            \
   %D%/libutil/serialise.hh                     \
   %D%/libutil/util.hh                          \
   %D%/libutil/archive.hh                       \
-  %D%/libutil/types.hh                         \
-  %D%/libutil/gcrypt-hash.hh                   \
-  %D%/libutil/md5.h                            \
-  %D%/libutil/sha1.h                           \
-  %D%/libutil/sha256.h                         \
-  %D%/libutil/sha512.h
+  %D%/libutil/types.hh
 
 libutil_a_CPPFLAGS =                           \
   -I$(top_builddir)/nix                                \
@@ -107,20 +102,16 @@ libstore_a_CPPFLAGS =                             \
   -I$(top_srcdir)/%D%/libstore                 \
   -I$(top_builddir)/%D%/libstore               \
   -DNIX_STORE_DIR=\"$(storedir)\"              \
-  -DNIX_DATA_DIR=\"$(datadir)\"                        \
   -DNIX_STATE_DIR=\"$(localstatedir)/guix\"    \
   -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\"  \
   -DGUIX_CONFIGURATION_DIRECTORY=\"$(sysconfdir)/guix\"                \
-  -DNIX_LIBEXEC_DIR=\"$(libexecdir)\"          \
   -DNIX_BIN_DIR=\"$(bindir)\"                  \
-  -DOPENSSL_PATH="\"guix-authenticate\""       \
   -DDEFAULT_CHROOT_DIRS="\"\""
 
 libstore_a_CXXFLAGS = $(AM_CXXFLAGS)           \
   $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS)
 
 bin_PROGRAMS = guix-daemon
-sbin_PROGRAMS = guix-register
 
 guix_daemon_SOURCES =                          \
   %D%/nix-daemon/nix-daemon.cc                 \
@@ -138,24 +129,9 @@ guix_daemon_LDADD =                                \
 guix_daemon_headers =                          \
   %D%/nix-daemon/shared.hh
 
-
-guix_register_SOURCES =                                \
-  %D%/guix-register/guix-register.cc
-
-guix_register_CPPFLAGS =                       \
-  $(libutil_a_CPPFLAGS)                                \
-  $(libstore_a_CPPFLAGS)                       \
-  -I$(top_srcdir)/%D%/libstore
-
-# XXX: Should we start using shared libs?
-guix_register_LDADD =                          \
-  libstore.a libutil.a libformat.a -lz         \
-  $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
-
 if HAVE_LIBBZ2
 
 guix_daemon_LDADD += -lbz2
-guix_register_LDADD += -lbz2
 
 endif HAVE_LIBBZ2
 
@@ -163,7 +139,7 @@ noinst_HEADERS =                                            \
   $(libformat_headers) $(libutil_headers) $(libstore_headers)  \
   $(guix_daemon_headers)
 
-%D%/libstore/schema.sql.hh: %D%/libstore/schema.sql
+%D%/libstore/schema.sql.hh: guix/store/schema.sql
        $(AM_V_GEN)$(GUILE) --no-auto-compile -c                \
          "(use-modules (rnrs io ports))                        \
           (call-with-output-file \"$@\"                        \
@@ -172,28 +148,43 @@ noinst_HEADERS =                                          \
                 (lambda (in)                                   \
                   (write (get-string-all in) out)))))"
 
-nodist_pkglibexec_SCRIPTS =                    \
-  %D%/scripts/list-runtime-roots               \
-  %D%/scripts/substitute                       \
-  %D%/scripts/download
-
-if BUILD_DAEMON_OFFLOAD
+# The '.service' files for systemd.
+systemdservicedir = $(libdir)/systemd/system
+nodist_systemdservice_DATA =                   \
+  etc/gnu-store.mount                          \
+  etc/guix-daemon.service                      \
+  etc/guix-publish.service
 
-nodist_pkglibexec_SCRIPTS +=                   \
-  %D%/scripts/offload
+etc/%.mount: etc/%.mount.in    \
+                        $(top_builddir)/config.status
+       $(AM_V_GEN)$(MKDIR_P) "`dirname $@`";   \
+       $(SED) -e 's|@''storedir''@|$(storedir)|' <     \
+              "$<" > "$@.tmp";         \
+       mv "$@.tmp" "$@"
 
-endif BUILD_DAEMON_OFFLOAD
+etc/guix-%.service: etc/guix-%.service.in      \
+                        $(top_builddir)/config.status
+       $(AM_V_GEN)$(MKDIR_P) "`dirname $@`";   \
+       $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <   \
+              "$<" > "$@.tmp";         \
+       mv "$@.tmp" "$@"
 
+# The service script for sysvinit.
+sysvinitservicedir = $(sysconfdir)/init.d
+nodist_sysvinitservice_DATA = etc/init.d/guix-daemon
 
-# XXX: It'd be better to hide it in $(pkglibexecdir).
-nodist_libexec_SCRIPTS =                       \
-  %D%/scripts/guix-authenticate
+etc/init.d/guix-daemon: etc/init.d/guix-daemon.in      \
+                        $(top_builddir)/config.status
+       $(AM_V_GEN)$(MKDIR_P) "`dirname $@`";   \
+       $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <   \
+              "$<" > "$@.tmp";         \
+       mv "$@.tmp" "$@"
 
-# The '.service' files for systemd.
-systemdservicedir = $(libdir)/systemd/system
-nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service
+# The service script for openrc.
+openrcservicedir = $(sysconfdir)/init.d
+nodist_openrcservice_DATA = etc/openrc/guix-daemon
 
-etc/guix-%.service: etc/guix-%.service.in      \
+etc/openrc/guix-daemon: etc/openrc/guix-daemon.in      \
                         $(top_builddir)/config.status
        $(AM_V_GEN)$(MKDIR_P) "`dirname $@`";   \
        $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' <   \
@@ -213,16 +204,19 @@ etc/guix-%.conf: etc/guix-%.conf.in       \
 
 CLEANFILES +=                                  \
   $(nodist_systemdservice_DATA)                        \
-  $(nodist_upstartjob_DATA)
+  $(nodist_upstartjob_DATA)                    \
+  $(nodist_sysvinitservice_DATA)               \
+  $(nodist_openrcservice_DATA)
 
 EXTRA_DIST +=                                  \
-  %D%/libstore/schema.sql                      \
   %D%/AUTHORS                                  \
   %D%/COPYING                                  \
   etc/guix-daemon.service.in                   \
   etc/guix-daemon.conf.in                      \
   etc/guix-publish.service.in                  \
-  etc/guix-publish.conf.in
+  etc/guix-publish.conf.in                     \
+  etc/init.d/guix-daemon.in                    \
+  etc/openrc/guix-daemon.in
 
 if CAN_RUN_TESTS