GNU bug report logs - #50476
[PATCH 00/10] Update guile-dbi and guile-dbd-*

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Wed, 8 Sep 2021 14:46:01 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50476 in the body.
You can then email your comments to 50476 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arun Isaac <arunisaac <at> systemreboot.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 08 Sep 2021 14:46:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: guix-patches <at> gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 00/10] Update guile-dbi and guile-dbd-*
Date: Wed,  8 Sep 2021 20:15:20 +0530
Hi,

This patchset improves our guile-dbi and guile-dbd-* packages. The two most
significant ones are:

1. It updates guile-dbi and guile-dbd-* upstream to
https://github.com/opencog/guile-dbi . It simplifies and deduplicates the
package definitions of guile-dbd-* by inheriting from guile-dbi.

2. Additionally, it removes the tight LDFLAGS coupling between guile-dbi and
guile-dbd-*. With this patchset, guile-dbd-* are not inputs of guile-dbi. They
are picked up from the profile using the LD_LIBRARY_PATH environment variable
specified in native-search-paths. This way, the user can choose to only
install the specific guile-dbd- package that they are interested in and not
pull in all guile-dbd-* packages.

Regards,
Arun

Arun Isaac (10):
  gnu: guile-dbi: Update upstream source.
  gnu: guile-dbi: Remove hard-coded guile effective version.
  gnu: guile-dbi: Search for dbd libraries using native-search-paths.
  gnu: guile-dbi: Do not return #t from custom phases.
  gnu: guile-dbi: Update to 2.1.8.
  gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
  gnu: guile-dbd-postgresql: Inherit from guile-dbi.
  gnu: guile-dbi-bootstrap: Remove package.
  gnu: Add guile-dbd-mysql.
  gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference.

 gnu/packages/guile-xyz.scm | 209 +++++++++++++++++++------------------
 1 file changed, 109 insertions(+), 100 deletions(-)

-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 05/10] gnu: guile-dbi: Update to 2.1.8.
Date: Wed,  8 Sep 2021 20:24:08 +0530
* gnu/packages/guile-xyz.scm (guile-dbi): Update to 2.1.8.
[arguments]: Add chdir phase.
---
 gnu/packages/guile-xyz.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 80267287d1..baf245c865 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1491,7 +1491,7 @@ library}.")
 (define-public guile-dbi
   (package
     (name "guile-dbi")
-    (version "2.1.6")
+    (version "2.1.8")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1500,7 +1500,7 @@ library}.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
+                "123m4j82bi60s1v95pjh4djb7bh6zdwmljbpyg7zq8ni2gyal7lw"))))
     (build-system gnu-build-system)
     (arguments
      `(#:modules (((guix build guile-build-system)
@@ -1514,6 +1514,11 @@ library}.")
               (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'chdir
+           (lambda _
+             ;; The upstream Git repository contains all the code, so change
+             ;; to the directory specific to guile-dbi.
+             (chdir "guile-dbi")))
          (add-after 'install 'patch-extension-path
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using
 native-search-paths.
Date: Wed,  8 Sep 2021 20:24:06 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Do not set LDFLAGS and
RPATH in #:make-flags.
[inputs]: Remove guile-dbd-sqlite3 and guile-dbd-postgresql.
[native-search-paths]: Add LD_LIBRARY_PATH.
---
 gnu/packages/guile-xyz.scm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index c40eea07a9..e8a7fded14 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1512,11 +1512,6 @@ library}.")
        (list (string-append
               "--with-guile-site-dir=" %output "/share/guile/site/"
               (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
-       #:make-flags
-       (list (string-append
-              "LDFLAGS=-Wl,-rpath=" %output "/lib:"
-              (assoc-ref %build-inputs "guile-dbd-sqlite3") "/lib" ":"
-              (assoc-ref %build-inputs "guile-dbd-postgresql") "/lib"))
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'patch-extension-path
@@ -1529,9 +1524,6 @@ library}.")
                     (ext (string-append out "/lib/libguile-dbi")))
                (substitute* dbi.scm (("libguile-dbi") ext))
                #t))))))
-    (inputs
-     `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3)
-       ("guile-dbd-postgresql" ,guile-dbd-postgresql))) ; only shared library, no scheme files
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -1547,7 +1539,11 @@ library}.")
 SQL databases.  Database programming with guile-dbi is generic in that the same
 programming interface is presented regardless of which database system is used.
 It currently supports MySQL, Postgres and SQLite3.")
-    (license license:gpl2+)))
+    (license license:gpl2+)
+    (native-search-paths
+     (list (search-path-specification
+            (variable "LD_LIBRARY_PATH")
+            (files '("lib")))))))
 
 (define guile-dbi-bootstrap
   (package
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:03 GMT) Full text and rfc822 format available.

Message #14 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective
 version.
Date: Wed,  8 Sep 2021 20:24:05 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Import
target-guile-effective-version from (guix build guile-build-system). Use
target-guile-effective-version to determine the guile effective version.
---
 gnu/packages/guile-xyz.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 26623b7770..c40eea07a9 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1503,9 +1503,15 @@ library}.")
                 "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags
+     `(#:modules (((guix build guile-build-system)
+                   #:select (target-guile-effective-version))
+                  ,@%gnu-build-system-modules)
+       #:imported-modules ((guix build guile-build-system)
+                           ,@%gnu-build-system-modules)
+       #:configure-flags
        (list (string-append
-              "--with-guile-site-dir=" %output "/share/guile/site/2.2"))
+              "--with-guile-site-dir=" %output "/share/guile/site/"
+              (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
        #:make-flags
        (list (string-append
               "LDFLAGS=-Wl,-rpath=" %output "/lib:"
@@ -1514,11 +1520,13 @@ library}.")
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'patch-extension-path
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out     (assoc-ref outputs "out"))
-                    (dbi.scm (string-append
-                              out "/share/guile/site/2.2/dbi/dbi.scm"))
-                    (ext     (string-append out "/lib/libguile-dbi")))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (dbi.scm (string-append out "/share/guile/site/"
+                                            (target-guile-effective-version
+                                             (assoc-ref inputs "guile"))
+                                            "/dbi/dbi.scm"))
+                    (ext (string-append out "/lib/libguile-dbi")))
                (substitute* dbi.scm (("libguile-dbi") ext))
                #t))))))
     (inputs
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:03 GMT) Full text and rfc822 format available.

Message #17 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 04/10] gnu: guile-dbi: Do not return #t from custom phases.
Date: Wed,  8 Sep 2021 20:24:07 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Do not return #t from
custom phases.
---
 gnu/packages/guile-xyz.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index e8a7fded14..80267287d1 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1522,8 +1522,7 @@ library}.")
                                              (assoc-ref inputs "guile"))
                                             "/dbi/dbi.scm"))
                     (ext (string-append out "/lib/libguile-dbi")))
-               (substitute* dbi.scm (("libguile-dbi") ext))
-               #t))))))
+               (substitute* dbi.scm (("libguile-dbi") ext))))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:03 GMT) Full text and rfc822 format available.

Message #20 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
Date: Wed,  8 Sep 2021 20:24:09 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-sqlite3): Inherit from
guile-dbi. Remove version, source, build-system, home-page and license fields.
[arguments]: Replace chdir phase. Delete patch-extension-path phase.
[native-inputs]: Replace guile-dbi-bootstrap with guile-dbi.
---
 gnu/packages/guile-xyz.scm | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index baf245c865..1a3ddcf25d 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1560,32 +1560,29 @@ It currently supports MySQL, Postgres and SQLite3.")
 
 (define-public guile-dbd-sqlite3
   (package
+    (inherit guile-dbi)
     (name "guile-dbd-sqlite3")
-    (version "2.1.6")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://example.org") ;only hosted on Software Heritage
-                    (commit "0758c615e9e85ad76d153d5dc6179881f1f50089")))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1rwf3z6ib6nkhfnk2nw8p6fqirdx2pparcrlmsm0i2ii62plpqhb"))))
-    (build-system gnu-build-system)
-    (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ("guile-dbi-bootstrap" ,guile-dbi-bootstrap))) ; only required for headers
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
+             (lambda _
+               ;; The upstream Git repository contains all the code, so change
+               ;; to the directory specific to guile-dbd-sqlite3.
+               (chdir "guile-dbd-sqlite3")))
+           (delete 'patch-extension-path)))))
     (inputs
      `(("sqlite" ,sqlite)
        ("zlib" ,(@ (gnu packages compression) zlib))))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ("pkg-config" ,pkg-config)
+       ,@(package-native-inputs guile-dbi)))
     (synopsis "Guile DBI driver for SQLite")
-    ;; Unofficial home-page.
-    ;; Added by b9cbfa52f71505de8447fefabd97f16d0a9cbde6 (2016-06)
-    (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
     (description
      "guile-dbi is a library for Guile that provides a convenient interface to
-SQL databases.  This package implements the interface for SQLite.")
-    (license license:gpl2+)))
+SQL databases.  This package implements the interface for SQLite.")))
 
 (define-public guile-dbd-postgresql
   (let ((commit "e97589b6b018b206c901e4cc24db463407a4036b")
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:04 GMT) Full text and rfc822 format available.

Message #23 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 01/10] gnu: guile-dbi: Update upstream source.
Date: Wed,  8 Sep 2021 20:24:04 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[source]: Use git-fetch. Update URI.
[home-page]: Update URI.
[native-inputs]: Add autoconf, automake, libtool, perl and texinfo.
---
 gnu/packages/guile-xyz.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 457701a436..26623b7770 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1495,12 +1495,12 @@ library}.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://example.org") ;only hosted on Software Heritage
-                    (commit "e19b019e9683faf66c3f385b20fcc112e65f8c6e")))
+                    (url "https://github.com/opencog/guile-dbi")
+                    (commit (string-append "guile-dbi-" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "09ys5hj7gnj5w1iv1m194j06jk6b8sdhc8j6hcv3bprq1428kyxw"))))
+                "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags
@@ -1524,10 +1524,16 @@ library}.")
     (inputs
      `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3)
        ("guile-dbd-postgresql" ,guile-dbd-postgresql))) ; only shared library, no scheme files
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("texinfo" ,texinfo)))
     (propagated-inputs
      `(("guile" ,guile-2.2)))
     (synopsis "Guile database abstraction layer")
-    (home-page "https://web.archive.org/web/20160328232717/http://home.gna.org/guile-dbi/guile-dbi.html")
+    (home-page "https://github.com/opencog/guile-dbi")
     (description
      "guile-dbi is a library for Guile that provides a convenient interface to
 SQL databases.  Database programming with guile-dbi is generic in that the same
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:04 GMT) Full text and rfc822 format available.

Message #26 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 07/10] gnu: guile-dbd-postgresql: Inherit from guile-dbi.
Date: Wed,  8 Sep 2021 20:24:10 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-postgresql): Inherit from
guile-dbi. Remove version, source, build-system, home-page and license fields.
[arguments]: Remove patch-src/Makefile.am phase. Do not return #t from phases.
[native-inputs]: Replace guile-dbi-bootstrap with guile-dbi.
---
 gnu/packages/guile-xyz.scm | 72 ++++++++++++--------------------------
 1 file changed, 23 insertions(+), 49 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 1a3ddcf25d..c59e7e51c8 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1585,60 +1585,34 @@ It currently supports MySQL, Postgres and SQLite3.")
 SQL databases.  This package implements the interface for SQLite.")))
 
 (define-public guile-dbd-postgresql
-  (let ((commit "e97589b6b018b206c901e4cc24db463407a4036b")
-        (revision 0))
-    (package
-      (name "guile-dbd-postgresql")
-      (version (string-append
-                "2.1.6-" (number->string revision) "." (string-take commit 7)))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/opencog/guile-dbi")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32 "0n1gv9a0kdys10a4qmnrwvg5sydwb03880asri4gqdchcj3fimni"))))
-      (build-system gnu-build-system)
-      (arguments
-       '(#:phases
-         (modify-phases %standard-phases
-           (add-after 'unpack 'chdir
+  (package
+    (inherit guile-dbi)
+    (name "guile-dbd-postgresql")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
              (lambda _
                ;; The upstream Git repository contains all the code, so change
-               ;; to the relevant directory.
-               (chdir "guile-dbd-postgresql")
-               #t))
-           (add-after 'chdir 'patch-src/Makefile.am
-             (lambda* (#:key inputs #:allow-other-keys)
-               (substitute* "src/Makefile.am"
-                 (("/usr/include")
-                  (string-append (assoc-ref inputs "postgresql") "/include")))
-               #t))
-           (add-after 'patch-src/Makefile.am 'patch-src
+               ;; to the directory specific to guile-dbd-mysql.
+               (chdir "guile-dbd-postgresql")))
+           (add-after 'chdir 'patch-src
              (lambda _
                (substitute* "src/guile-dbd-postgresql.c"
-                 (("postgresql/libpq-fe\\.h") "libpq-fe.h"))
-               #t)))))
-      (native-inputs
-       `(("pkg-config" ,pkg-config)
-         ("automake" ,automake)
-         ("autoconf" ,autoconf)
-         ("perl" ,perl)
-         ("libtool" ,libtool)
-         ("guile-dbi-bootstrap" ,guile-dbi-bootstrap)))
-      (inputs
-       `(("postgresql" ,postgresql)
-         ("zlib" ,zlib)))
-      (synopsis "Guile DBI driver for PostgreSQL")
-      (home-page
-       "https://github.com/opencog/guile-dbi/tree/master/guile-dbd-postgresql")
-      (description
-       "@code{guile-dbi} is a library for Guile that provides a convenient
+                 (("postgresql/libpq-fe\\.h") "libpq-fe.h"))))
+           (delete 'patch-extension-path)))))
+    (inputs
+     `(("postgresql" ,postgresql)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ,@(package-native-inputs guile-dbi)))
+    (synopsis "Guile DBI driver for PostgreSQL")
+    (description
+     "@code{guile-dbi} is a library for Guile that provides a convenient
 interface to SQL databases.  This package implements the interface for
-PostgreSQL.")
-      (license license:gpl2+))))
+PostgreSQL.")))
 
 (define-public guile-config
   (package
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:05 GMT) Full text and rfc822 format available.

Message #29 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 08/10] gnu: guile-dbi-bootstrap: Remove package.
Date: Wed,  8 Sep 2021 20:24:11 +0530
guile-dbi-bootstrap was formerly used by guile-dbd-sqlite3 and
guile-dbd-postgresql. It is no longer required now that guile-dbi uses
native-search-paths to find guile-dbd-* libraries.

* gnu/packages/guile-xyz.scm (guile-dbi-bootstrap): Delete variable.
---
 gnu/packages/guile-xyz.scm | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index c59e7e51c8..15dc8b1219 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1549,15 +1549,6 @@ It currently supports MySQL, Postgres and SQLite3.")
             (variable "LD_LIBRARY_PATH")
             (files '("lib")))))))
 
-(define guile-dbi-bootstrap
-  (package
-    (inherit guile-dbi)
-    (name "guile-dbi-bootstrap")
-    (inputs '())
-    (arguments
-     (substitute-keyword-arguments (package-arguments guile-dbi)
-       ((#:make-flags _) '(list))))))
-
 (define-public guile-dbd-sqlite3
   (package
     (inherit guile-dbi)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:05 GMT) Full text and rfc822 format available.

Message #32 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 10/10] gnu: guile-dbd-sqlite3: Use normal variable instead of
 @ reference.
Date: Wed,  8 Sep 2021 20:24:13 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-sqlite3)[inputs]: Replace (@ (gnu
packages compression) zlib) with zlib.
---
 gnu/packages/guile-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a5166ec46c..0633446442 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1565,7 +1565,7 @@ It currently supports MySQL, Postgres and SQLite3.")
            (delete 'patch-extension-path)))))
     (inputs
      `(("sqlite" ,sqlite)
-       ("zlib" ,(@ (gnu packages compression) zlib))))
+       ("zlib" ,zlib)))
     (native-inputs
      `(("guile-dbi" ,guile-dbi)         ; only required for headers
        ("pkg-config" ,pkg-config)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 08 Sep 2021 14:55:06 GMT) Full text and rfc822 format available.

Message #35 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 50476 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 09/10] gnu: Add guile-dbd-mysql.
Date: Wed,  8 Sep 2021 20:24:12 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-mysql): New variable.
---
 gnu/packages/guile-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 15dc8b1219..a5166ec46c 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1605,6 +1605,39 @@ SQL databases.  This package implements the interface for SQLite.")))
 interface to SQL databases.  This package implements the interface for
 PostgreSQL.")))
 
+(define-public guile-dbd-mysql
+  (package
+    (inherit guile-dbi)
+    (name "guile-dbd-mysql")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
+             (lambda _
+               ;; The upstream Git repository contains all the code, so change
+               ;; to the directory specific to guile-dbd-mysql.
+               (chdir "guile-dbd-mysql")))
+           (add-after 'chdir 'patch-src
+             (lambda _
+               (substitute* "configure.ac"
+                 (("mariadbclient") "mariadb"))
+               (substitute* "src/guile-dbd-mysql.c"
+                 (("<mariadb/") "<mysql/"))))
+           (delete 'patch-extension-path)))))
+    (inputs
+     `(("mariadb" ,mariadb "dev")
+       ("mariadb" ,mariadb "lib")
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ,@(package-native-inputs guile-dbi)))
+    (synopsis "Guile DBI driver for MySQL")
+    (description "@code{guile-dbi} is a library for Guile that provides a
+convenient interface to SQL databases.  This package implements the interface
+for MySQL.")
+    (license license:gpl2+)))
+
 (define-public guile-config
   (package
     (name "guile-config")
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Tue, 21 Sep 2021 12:54:01 GMT) Full text and rfc822 format available.

Message #38 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: Re: bug#50476: [PATCH 00/10] Update guile-dbi and guile-dbd-*
Date: Tue, 21 Sep 2021 14:53:47 +0200
Hello!

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> * gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Do not set LDFLAGS and
> RPATH in #:make-flags.
> [inputs]: Remove guile-dbd-sqlite3 and guile-dbd-postgresql.
> [native-search-paths]: Add LD_LIBRARY_PATH.

[...]

> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "LD_LIBRARY_PATH")
> +            (files '("lib")))))))

I think we should not add LD_LIBRARY_PATH as a search path spec as it
can have undesirable side effects; it’s just too broad and risky.

The difficulty here is that we want guile-dbi to be able to find its
guile-dbd-* plugins, right?  The previous method, which was to set the
RUNPATH of guile-dbi pointing to guile-dbd-*, sounds preferable to me:
it’s localized and does the job.

The downside of the RUNPATH method is that these are no longer really
“plugins”: you end up pulling them whether or not you use them.  Perhaps
you were concerned about the closure size?

If that really is a concern, I’d recommend taking a different approach,
such as using/defining a dedicated search path variable.

WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Wed, 22 Sep 2021 20:24:02 GMT) Full text and rfc822 format available.

Message #41 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 50476 <at> debbugs.gnu.org
Subject: Re: bug#50476: [PATCH 00/10] Update guile-dbi and guile-dbd-*
Date: Thu, 23 Sep 2021 01:53:11 +0530
[Message part 1 (text/plain, inline)]
Hi Ludo,

>> +    (native-search-paths
>> +     (list (search-path-specification
>> +            (variable "LD_LIBRARY_PATH")
>> +            (files '("lib")))))))
>
> I think we should not add LD_LIBRARY_PATH as a search path spec as it
> can have undesirable side effects; it’s just too broad and risky.

This makes sense.

> The difficulty here is that we want guile-dbi to be able to find its
> guile-dbd-* plugins, right?  The previous method, which was to set the
> RUNPATH of guile-dbi pointing to guile-dbd-*, sounds preferable to me:
> it’s localized and does the job.
>
> The downside of the RUNPATH method is that these are no longer really
> “plugins”: you end up pulling them whether or not you use them.  Perhaps
> you were concerned about the closure size?

Yes, I was concerned about the closure size, but not merely about the
closure size in MB, but also the closure size in number of packages. It
does look a bit awkward when we're pulling in dependencies that are not
really required.

> If that really is a concern, I’d recommend taking a different approach,
> such as using/defining a dedicated search path variable.

That sounds good. How about I create a GUILE_DBD_LD_LIBRARY_PATH
environment variable?

Regards,
Arun
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Mon, 27 Sep 2021 16:01:02 GMT) Full text and rfc822 format available.

Message #44 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: Re: bug#50476: [PATCH 00/10] Update guile-dbi and guile-dbd-*
Date: Mon, 27 Sep 2021 17:59:51 +0200
Hi,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

>> If that really is a concern, I’d recommend taking a different approach,
>> such as using/defining a dedicated search path variable.
>
> That sounds good. How about I create a GUILE_DBD_LD_LIBRARY_PATH
> environment variable?

Or just GUILE_DBD_PATH?  But yes, that’d be great.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:53:02 GMT) Full text and rfc822 format available.

Message #47 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
Date: Thu, 30 Sep 2021 22:22:25 +0530
Hi Ludo,

The fix was surprisingly simple. It turns out that guile-dbi already supports
a GUILE_DBD_PATH environment variable. See line 312 of
guile-dbi/src/guile-dbi.c. So, I just had to fix patch 03/10 to set
GUILE_DBD_PATH in the native-search-paths of the guile-dbi package. Otherwise,
this patchset is the same.

Regards,
Arun

Arun Isaac (10):
  gnu: guile-dbi: Update upstream source.
  gnu: guile-dbi: Remove hard-coded guile effective version.
  gnu: guile-dbi: Search for dbd libraries using native-search-paths.
  gnu: guile-dbi: Do not return #t from custom phases.
  gnu: guile-dbi: Update to 2.1.8.
  gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
  gnu: guile-dbd-postgresql: Inherit from guile-dbi.
  gnu: guile-dbi-bootstrap: Remove package.
  gnu: Add guile-dbd-mysql.
  gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference.

 gnu/packages/guile-xyz.scm | 209 +++++++++++++++++++------------------
 1 file changed, 109 insertions(+), 100 deletions(-)

-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:53:02 GMT) Full text and rfc822 format available.

Message #50 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 01/10] gnu: guile-dbi: Update upstream source.
Date: Thu, 30 Sep 2021 22:22:26 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[source]: Use git-fetch. Update URI.
[home-page]: Update URI.
[native-inputs]: Add autoconf, automake, libtool, perl and texinfo.
---
 gnu/packages/guile-xyz.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 7188058b42..d50212fb66 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1495,12 +1495,12 @@ library}.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://example.org") ;only hosted on Software Heritage
-                    (commit "e19b019e9683faf66c3f385b20fcc112e65f8c6e")))
+                    (url "https://github.com/opencog/guile-dbi")
+                    (commit (string-append "guile-dbi-" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "09ys5hj7gnj5w1iv1m194j06jk6b8sdhc8j6hcv3bprq1428kyxw"))))
+                "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags
@@ -1524,10 +1524,16 @@ library}.")
     (inputs
      `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3)
        ("guile-dbd-postgresql" ,guile-dbd-postgresql))) ; only shared library, no scheme files
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("perl" ,perl)
+       ("texinfo" ,texinfo)))
     (propagated-inputs
      `(("guile" ,guile-2.2)))
     (synopsis "Guile database abstraction layer")
-    (home-page "https://web.archive.org/web/20160328232717/http://home.gna.org/guile-dbi/guile-dbi.html")
+    (home-page "https://github.com/opencog/guile-dbi")
     (description
      "guile-dbi is a library for Guile that provides a convenient interface to
 SQL databases.  Database programming with guile-dbi is generic in that the same
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:53:02 GMT) Full text and rfc822 format available.

Message #53 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 02/10] gnu: guile-dbi: Remove hard-coded guile effective
 version.
Date: Thu, 30 Sep 2021 22:22:27 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Import
target-guile-effective-version from (guix build guile-build-system). Use
target-guile-effective-version to determine the guile effective version.
---
 gnu/packages/guile-xyz.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index d50212fb66..bc7bf63dc5 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1503,9 +1503,15 @@ library}.")
                 "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags
+     `(#:modules (((guix build guile-build-system)
+                   #:select (target-guile-effective-version))
+                  ,@%gnu-build-system-modules)
+       #:imported-modules ((guix build guile-build-system)
+                           ,@%gnu-build-system-modules)
+       #:configure-flags
        (list (string-append
-              "--with-guile-site-dir=" %output "/share/guile/site/2.2"))
+              "--with-guile-site-dir=" %output "/share/guile/site/"
+              (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
        #:make-flags
        (list (string-append
               "LDFLAGS=-Wl,-rpath=" %output "/lib:"
@@ -1514,11 +1520,13 @@ library}.")
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'patch-extension-path
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out     (assoc-ref outputs "out"))
-                    (dbi.scm (string-append
-                              out "/share/guile/site/2.2/dbi/dbi.scm"))
-                    (ext     (string-append out "/lib/libguile-dbi")))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (dbi.scm (string-append out "/share/guile/site/"
+                                            (target-guile-effective-version
+                                             (assoc-ref inputs "guile"))
+                                            "/dbi/dbi.scm"))
+                    (ext (string-append out "/lib/libguile-dbi")))
                (substitute* dbi.scm (("libguile-dbi") ext))
                #t))))))
     (inputs
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:02 GMT) Full text and rfc822 format available.

Message #56 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 08/10] gnu: guile-dbi-bootstrap: Remove package.
Date: Thu, 30 Sep 2021 22:22:33 +0530
guile-dbi-bootstrap was formerly used by guile-dbd-sqlite3 and
guile-dbd-postgresql. It is no longer required now that guile-dbi uses
native-search-paths to find guile-dbd-* libraries.

* gnu/packages/guile-xyz.scm (guile-dbi-bootstrap): Delete variable.
---
 gnu/packages/guile-xyz.scm | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index bc86bf3f68..b321df93a5 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1549,15 +1549,6 @@ It currently supports MySQL, Postgres and SQLite3.")
             (variable "GUILE_DBD_PATH")
             (files '("lib")))))))
 
-(define guile-dbi-bootstrap
-  (package
-    (inherit guile-dbi)
-    (name "guile-dbi-bootstrap")
-    (inputs '())
-    (arguments
-     (substitute-keyword-arguments (package-arguments guile-dbi)
-       ((#:make-flags _) '(list))))))
-
 (define-public guile-dbd-sqlite3
   (package
     (inherit guile-dbi)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:02 GMT) Full text and rfc822 format available.

Message #59 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 03/10] gnu: guile-dbi: Search for dbd libraries using
 native-search-paths.
Date: Thu, 30 Sep 2021 22:22:28 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Do not set LDFLAGS and
RPATH in #:make-flags.
[inputs]: Remove guile-dbd-sqlite3 and guile-dbd-postgresql.
[native-search-paths]: Add GUILE_DBD_PATH.
---
 gnu/packages/guile-xyz.scm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index bc7bf63dc5..098988bc1a 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1512,11 +1512,6 @@ library}.")
        (list (string-append
               "--with-guile-site-dir=" %output "/share/guile/site/"
               (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
-       #:make-flags
-       (list (string-append
-              "LDFLAGS=-Wl,-rpath=" %output "/lib:"
-              (assoc-ref %build-inputs "guile-dbd-sqlite3") "/lib" ":"
-              (assoc-ref %build-inputs "guile-dbd-postgresql") "/lib"))
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'patch-extension-path
@@ -1529,9 +1524,6 @@ library}.")
                     (ext (string-append out "/lib/libguile-dbi")))
                (substitute* dbi.scm (("libguile-dbi") ext))
                #t))))))
-    (inputs
-     `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3)
-       ("guile-dbd-postgresql" ,guile-dbd-postgresql))) ; only shared library, no scheme files
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -1547,7 +1539,11 @@ library}.")
 SQL databases.  Database programming with guile-dbi is generic in that the same
 programming interface is presented regardless of which database system is used.
 It currently supports MySQL, Postgres and SQLite3.")
-    (license license:gpl2+)))
+    (license license:gpl2+)
+    (native-search-paths
+     (list (search-path-specification
+            (variable "GUILE_DBD_PATH")
+            (files '("lib")))))))
 
 (define guile-dbi-bootstrap
   (package
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:03 GMT) Full text and rfc822 format available.

Message #62 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 05/10] gnu: guile-dbi: Update to 2.1.8.
Date: Thu, 30 Sep 2021 22:22:30 +0530
* gnu/packages/guile-xyz.scm (guile-dbi): Update to 2.1.8.
[arguments]: Add chdir phase.
---
 gnu/packages/guile-xyz.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 1d56bbfede..e250d4d1f2 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1491,7 +1491,7 @@ library}.")
 (define-public guile-dbi
   (package
     (name "guile-dbi")
-    (version "2.1.6")
+    (version "2.1.8")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1500,7 +1500,7 @@ library}.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0nswd067gvpy9pnig409ympkw29akh9lb2i6g3w7r18g1s0ivah2"))))
+                "123m4j82bi60s1v95pjh4djb7bh6zdwmljbpyg7zq8ni2gyal7lw"))))
     (build-system gnu-build-system)
     (arguments
      `(#:modules (((guix build guile-build-system)
@@ -1514,6 +1514,11 @@ library}.")
               (target-guile-effective-version (assoc-ref %build-inputs "guile"))))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'chdir
+           (lambda _
+             ;; The upstream Git repository contains all the code, so change
+             ;; to the directory specific to guile-dbi.
+             (chdir "guile-dbi")))
          (add-after 'install 'patch-extension-path
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:03 GMT) Full text and rfc822 format available.

Message #65 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
Date: Thu, 30 Sep 2021 22:22:31 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-sqlite3): Inherit from
guile-dbi. Remove version, source, build-system, home-page and license fields.
[arguments]: Replace chdir phase. Delete patch-extension-path phase.
[native-inputs]: Replace guile-dbi-bootstrap with guile-dbi.
---
 gnu/packages/guile-xyz.scm | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index e250d4d1f2..96182d7362 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1560,32 +1560,29 @@ It currently supports MySQL, Postgres and SQLite3.")
 
 (define-public guile-dbd-sqlite3
   (package
+    (inherit guile-dbi)
     (name "guile-dbd-sqlite3")
-    (version "2.1.6")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://example.org") ;only hosted on Software Heritage
-                    (commit "0758c615e9e85ad76d153d5dc6179881f1f50089")))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1rwf3z6ib6nkhfnk2nw8p6fqirdx2pparcrlmsm0i2ii62plpqhb"))))
-    (build-system gnu-build-system)
-    (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ("guile-dbi-bootstrap" ,guile-dbi-bootstrap))) ; only required for headers
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
+             (lambda _
+               ;; The upstream Git repository contains all the code, so change
+               ;; to the directory specific to guile-dbd-sqlite3.
+               (chdir "guile-dbd-sqlite3")))
+           (delete 'patch-extension-path)))))
     (inputs
      `(("sqlite" ,sqlite)
        ("zlib" ,(@ (gnu packages compression) zlib))))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ("pkg-config" ,pkg-config)
+       ,@(package-native-inputs guile-dbi)))
     (synopsis "Guile DBI driver for SQLite")
-    ;; Unofficial home-page.
-    ;; Added by b9cbfa52f71505de8447fefabd97f16d0a9cbde6 (2016-06)
-    (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
     (description
      "guile-dbi is a library for Guile that provides a convenient interface to
-SQL databases.  This package implements the interface for SQLite.")
-    (license license:gpl2+)))
+SQL databases.  This package implements the interface for SQLite.")))
 
 (define-public guile-dbd-postgresql
   (let ((commit "e97589b6b018b206c901e4cc24db463407a4036b")
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:03 GMT) Full text and rfc822 format available.

Message #68 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 07/10] gnu: guile-dbd-postgresql: Inherit from guile-dbi.
Date: Thu, 30 Sep 2021 22:22:32 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-postgresql): Inherit from
guile-dbi. Remove version, source, build-system, home-page and license fields.
[arguments]: Remove patch-src/Makefile.am phase. Do not return #t from phases.
[native-inputs]: Replace guile-dbi-bootstrap with guile-dbi.
---
 gnu/packages/guile-xyz.scm | 72 ++++++++++++--------------------------
 1 file changed, 23 insertions(+), 49 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 96182d7362..bc86bf3f68 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1585,60 +1585,34 @@ It currently supports MySQL, Postgres and SQLite3.")
 SQL databases.  This package implements the interface for SQLite.")))
 
 (define-public guile-dbd-postgresql
-  (let ((commit "e97589b6b018b206c901e4cc24db463407a4036b")
-        (revision 0))
-    (package
-      (name "guile-dbd-postgresql")
-      (version (string-append
-                "2.1.6-" (number->string revision) "." (string-take commit 7)))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/opencog/guile-dbi")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32 "0n1gv9a0kdys10a4qmnrwvg5sydwb03880asri4gqdchcj3fimni"))))
-      (build-system gnu-build-system)
-      (arguments
-       '(#:phases
-         (modify-phases %standard-phases
-           (add-after 'unpack 'chdir
+  (package
+    (inherit guile-dbi)
+    (name "guile-dbd-postgresql")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
              (lambda _
                ;; The upstream Git repository contains all the code, so change
-               ;; to the relevant directory.
-               (chdir "guile-dbd-postgresql")
-               #t))
-           (add-after 'chdir 'patch-src/Makefile.am
-             (lambda* (#:key inputs #:allow-other-keys)
-               (substitute* "src/Makefile.am"
-                 (("/usr/include")
-                  (string-append (assoc-ref inputs "postgresql") "/include")))
-               #t))
-           (add-after 'patch-src/Makefile.am 'patch-src
+               ;; to the directory specific to guile-dbd-mysql.
+               (chdir "guile-dbd-postgresql")))
+           (add-after 'chdir 'patch-src
              (lambda _
                (substitute* "src/guile-dbd-postgresql.c"
-                 (("postgresql/libpq-fe\\.h") "libpq-fe.h"))
-               #t)))))
-      (native-inputs
-       `(("pkg-config" ,pkg-config)
-         ("automake" ,automake)
-         ("autoconf" ,autoconf)
-         ("perl" ,perl)
-         ("libtool" ,libtool)
-         ("guile-dbi-bootstrap" ,guile-dbi-bootstrap)))
-      (inputs
-       `(("postgresql" ,postgresql)
-         ("zlib" ,zlib)))
-      (synopsis "Guile DBI driver for PostgreSQL")
-      (home-page
-       "https://github.com/opencog/guile-dbi/tree/master/guile-dbd-postgresql")
-      (description
-       "@code{guile-dbi} is a library for Guile that provides a convenient
+                 (("postgresql/libpq-fe\\.h") "libpq-fe.h"))))
+           (delete 'patch-extension-path)))))
+    (inputs
+     `(("postgresql" ,postgresql)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ,@(package-native-inputs guile-dbi)))
+    (synopsis "Guile DBI driver for PostgreSQL")
+    (description
+     "@code{guile-dbi} is a library for Guile that provides a convenient
 interface to SQL databases.  This package implements the interface for
-PostgreSQL.")
-      (license license:gpl2+))))
+PostgreSQL.")))
 
 (define-public guile-config
   (package
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:04 GMT) Full text and rfc822 format available.

Message #71 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 04/10] gnu: guile-dbi: Do not return #t from custom phases.
Date: Thu, 30 Sep 2021 22:22:29 +0530
* gnu/packages/guile-xyz.scm (guile-dbi)[arguments]: Do not return #t from
custom phases.
---
 gnu/packages/guile-xyz.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 098988bc1a..1d56bbfede 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1522,8 +1522,7 @@ library}.")
                                              (assoc-ref inputs "guile"))
                                             "/dbi/dbi.scm"))
                     (ext (string-append out "/lib/libguile-dbi")))
-               (substitute* dbi.scm (("libguile-dbi") ext))
-               #t))))))
+               (substitute* dbi.scm (("libguile-dbi") ext))))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Thu, 30 Sep 2021 16:54:04 GMT) Full text and rfc822 format available.

Message #74 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: [PATCH v2 09/10] gnu: Add guile-dbd-mysql.
Date: Thu, 30 Sep 2021 22:22:34 +0530
* gnu/packages/guile-xyz.scm (guile-dbd-mysql): New variable.
---
 gnu/packages/guile-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index b321df93a5..07e3f6ba2b 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1605,6 +1605,39 @@ SQL databases.  This package implements the interface for SQLite.")))
 interface to SQL databases.  This package implements the interface for
 PostgreSQL.")))
 
+(define-public guile-dbd-mysql
+  (package
+    (inherit guile-dbi)
+    (name "guile-dbd-mysql")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-dbi)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'chdir
+             (lambda _
+               ;; The upstream Git repository contains all the code, so change
+               ;; to the directory specific to guile-dbd-mysql.
+               (chdir "guile-dbd-mysql")))
+           (add-after 'chdir 'patch-src
+             (lambda _
+               (substitute* "configure.ac"
+                 (("mariadbclient") "mariadb"))
+               (substitute* "src/guile-dbd-mysql.c"
+                 (("<mariadb/") "<mysql/"))))
+           (delete 'patch-extension-path)))))
+    (inputs
+     `(("mariadb" ,mariadb "dev")
+       ("mariadb" ,mariadb "lib")
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("guile-dbi" ,guile-dbi)         ; only required for headers
+       ,@(package-native-inputs guile-dbi)))
+    (synopsis "Guile DBI driver for MySQL")
+    (description "@code{guile-dbi} is a library for Guile that provides a
+convenient interface to SQL databases.  This package implements the interface
+for MySQL.")
+    (license license:gpl2+)))
+
 (define-public guile-config
   (package
     (name "guile-config")
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50476; Package guix-patches. (Sat, 02 Oct 2021 14:05:02 GMT) Full text and rfc822 format available.

Message #77 received at 50476 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 50476 <at> debbugs.gnu.org
Subject: Re: [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
Date: Sat, 02 Oct 2021 16:04:17 +0200
Hi Arun,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> The fix was surprisingly simple. It turns out that guile-dbi already supports
> a GUILE_DBD_PATH environment variable. See line 312 of
> guile-dbi/src/guile-dbi.c. So, I just had to fix patch 03/10 to set
> GUILE_DBD_PATH in the native-search-paths of the guile-dbi package. Otherwise,
> this patchset is the same.

Wonderful.

>   gnu: guile-dbi: Update upstream source.
>   gnu: guile-dbi: Remove hard-coded guile effective version.
>   gnu: guile-dbi: Search for dbd libraries using native-search-paths.
>   gnu: guile-dbi: Do not return #t from custom phases.
>   gnu: guile-dbi: Update to 2.1.8.
>   gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
>   gnu: guile-dbd-postgresql: Inherit from guile-dbi.
>   gnu: guile-dbi-bootstrap: Remove package.
>   gnu: Add guile-dbd-mysql.
>   gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference.

LGTM!

Thanks,
Ludo’.




Reply sent to Arun Isaac <arunisaac <at> systemreboot.net>:
You have taken responsibility. (Sun, 03 Oct 2021 15:05:02 GMT) Full text and rfc822 format available.

Notification sent to Arun Isaac <arunisaac <at> systemreboot.net>:
bug acknowledged by developer. (Sun, 03 Oct 2021 15:05:02 GMT) Full text and rfc822 format available.

Message #82 received at 50476-done <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 50476-done <at> debbugs.gnu.org
Subject: Re: [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
Date: Sun, 03 Oct 2021 20:33:56 +0530
[Message part 1 (text/plain, inline)]
Pushed to master, thanks!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Nov 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.