guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: Make "guile-avahi" dependency optional.


From: guix-commits
Subject: 02/02: Make "guile-avahi" dependency optional.
Date: Sun, 29 Nov 2020 13:22:16 -0500 (EST)

mothacehe pushed a commit to branch master
in repository guix.

commit 35a32fefb4695442265809805145b7a262ae4988
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Nov 29 18:05:11 2020 +0100

    Make "guile-avahi" dependency optional.
    
    * configure.ac (HAVE_GUILE_AVAHI): New conditional.
    * Makefile.am (MODULES): Add "guix/avahi.scm" and 
"guix/scripts/discover.scm"
    if HAVE_GUILE_AVAHI is set.
    * guix/scripts/publish.scm: Autoload (guix avahi).
    * guix/scripts/substitute.scm: Autoload (guix scripts discovery).
---
 Makefile.am                 | 10 ++++++++--
 configure.ac                |  5 ++---
 guix/scripts/publish.scm    |  2 +-
 guix/scripts/substitute.scm |  2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 41b366e..fc60d15 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,6 @@ include gnu/local.mk
 include po/doc/local.mk
 
 MODULES =                                      \
-  guix/avahi.scm                               \
   guix/base16.scm                              \
   guix/base32.scm                              \
   guix/base64.scm                              \
@@ -257,7 +256,6 @@ MODULES =                                   \
   guix/import/texlive.scm                      \
   guix/import/utils.scm                                \
   guix/scripts.scm                             \
-  guix/scripts/discover.scm                    \
   guix/scripts/download.scm                    \
   guix/scripts/perform-download.scm            \
   guix/scripts/build.scm                       \
@@ -321,6 +319,14 @@ MODULES +=                                 \
 
 endif HAVE_GUILE_SSH
 
+if HAVE_GUILE_AVAHI
+
+MODULES +=                                     \
+  guix/avahi.scm                               \
+  guix/scripts/discover.scm
+
+endif HAVE_GUILE_AVAHI
+
 if BUILD_DAEMON_OFFLOAD
 
 MODULES +=                                     \
diff --git a/configure.ac b/configure.ac
index 307e8b3..942e841 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,9 +163,8 @@ fi
 
 dnl Check for Guile-Avahi.
 GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)])
-if test "x$have_guile_avahi" != "xyes"; then
-  AC_MSG_ERROR([Guile-Avahi is missing; please install it.])
-fi
+AM_CONDITIONAL([HAVE_GUILE_AVAHI],
+  [test "x$have_guile_avahi" = "xyes"])
 
 dnl Guile-newt is used by the graphical installer.
 GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index 4822ea5..c31cef3 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -42,7 +42,7 @@
   #:use-module (web server)
   #:use-module (web uri)
   #:autoload   (sxml simple) (sxml->xml)
-  #:use-module (guix avahi)
+  #:autoload   (guix avahi) (avahi-publish-service-thread)
   #:use-module (guix base32)
   #:use-module (guix base64)
   #:use-module (guix config)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 8e5953b..adc6852 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -27,7 +27,7 @@
   #:use-module (guix config)
   #:use-module (guix records)
   #:use-module ((guix serialization) #:select (restore-file))
-  #:use-module (guix scripts discover)
+  #:autoload   (guix scripts discover) (read-substitute-urls)
   #:use-module (gcrypt hash)
   #:use-module (guix base32)
   #:use-module (guix base64)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]