Subject: [bug#39258] [PATCH v2 1/3] build-self: Add guile-xapian to Guix dependencies.

From: Arun Isaac <[email-masked]>
Date: Sat, 7 Mar 2020 19:01:14 +0530

* build-aux/build-self.scm (build-program): Import fake guile-xapian module.
* guix/self.scm (compiled-guix): Add guile-xapian to Guix dependencies.
---
 build-aux/build-self.scm | 11 +++++++++++
 guix/self.scm            |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index f2e785b7f1..05d0353ccf 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2020 Arun Isaac <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -261,6 +262,10 @@ interface (FFI) of Guile.")
                  #~(define-module (gcrypt hash)
                      #:export (sha1 sha256))))
 
+  (define fake-xapian-hash
+    ;; Fake (xapian xapian) module; see below.
+    (scheme-file "xapian.scm" #~(define-module (xapian xapian))))
+
   (define fake-git
     (scheme-file "git.scm" #~(define-module (git))))
 
@@ -273,6 +278,12 @@ interface (FFI) of Guile.")
                            ;; adjust %LOAD-PATH later on.
                            ((gcrypt hash) => ,fake-gcrypt-hash)
 
+                           ;; To avoid relying on 'with-extensions', which was
+                           ;; introduced in 0.15.0, provide a fake (xapian
+                           ;; xapian) just so that we can build modules, and
+                           ;; adjust %LOAD-PATH later on.
+                           ((xapian xapian) => ,fake-xapian-hash)
+
                            ;; (guix git-download) depends on (git) but only
                            ;; for peripheral functionality.  Provide a dummy
                            ;; (git) to placate it.
diff --git a/guix/self.scm b/guix/self.scm
index 6b633f9bc0..a4f40574d1 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2020 Arun Isaac <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,6 +55,7 @@
       ("guile-git"  (ref '(gnu packages guile) 'guile3.0-git))
       ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3))
       ("guile-gcrypt"  (ref '(gnu packages gnupg) 'guile3.0-gcrypt))
+      ("guile-xapian"  (ref '(gnu packages guile-xyz) 'guile3.0-xapian))
       ("gnutls"     (ref '(gnu packages tls) 'guile3.0-gnutls))
       ("zlib"       (ref '(gnu packages compression) 'zlib))
       ("lzlib"      (ref '(gnu packages compression) 'lzlib))
@@ -682,6 +684,9 @@ Info manual."
   (define guile-gcrypt
     (specification->package "guile-gcrypt"))
 
+  (define guile-xapian
+    (specification->package "guile-xapian"))
+
   (define gnutls
     (specification->package "gnutls"))
 
@@ -690,7 +695,7 @@ Info manual."
                          (cons (list "x" package)
                                (package-transitive-propagated-inputs package)))
                        (list guile-gcrypt gnutls guile-git guile-json
-                             guile-ssh guile-sqlite3))
+                             guile-ssh guile-sqlite3 guile-xapian))
       (((labels packages _ ...) ...)
        packages)))
 
-- 
2.25.1