unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-*
@ 2021-09-08 14:45 Arun Isaac
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
  0 siblings, 1 reply; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:45 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

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





^ permalink raw reply	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source.
  2021-09-08 14:45 [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-* Arun Isaac
@ 2021-09-08 14:54 ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
                     ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective version.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-21 12:53     ` [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-* Ludovic Courtès
  2021-09-08 14:54   ` [bug#50476] [PATCH 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
                     ` (6 subsequent siblings)
  8 siblings, 1 reply; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 04/10] gnu: guile-dbi: Do not return #t from custom phases.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 05/10] gnu: guile-dbi: Update to 2.1.8.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (2 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (3 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 07/10] gnu: guile-dbd-postgresql: Inherit from guile-dbi.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (4 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 08/10] gnu: guile-dbi-bootstrap: Remove package.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (5 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 09/10] gnu: Add guile-dbd-mysql Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 10/10] gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference Arun Isaac
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 09/10] gnu: Add guile-dbd-mysql.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (6 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  2021-09-08 14:54   ` [bug#50476] [PATCH 10/10] gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference Arun Isaac
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 10/10] gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference.
  2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                     ` (7 preceding siblings ...)
  2021-09-08 14:54   ` [bug#50476] [PATCH 09/10] gnu: Add guile-dbd-mysql Arun Isaac
@ 2021-09-08 14:54   ` Arun Isaac
  8 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-08 14:54 UTC (permalink / raw)
  To: 50476; +Cc: Arun Isaac

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-*
  2021-09-08 14:54   ` [bug#50476] [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
@ 2021-09-21 12:53     ` Ludovic Courtès
  2021-09-22 20:23       ` Arun Isaac
  0 siblings, 1 reply; 26+ messages in thread
From: Ludovic Courtès @ 2021-09-21 12:53 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 50476

Hello!

Arun Isaac <arunisaac@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’.




^ permalink raw reply	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-*
  2021-09-21 12:53     ` [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-* Ludovic Courtès
@ 2021-09-22 20:23       ` Arun Isaac
  2021-09-27 15:59         ` Ludovic Courtès
  0 siblings, 1 reply; 26+ messages in thread
From: Arun Isaac @ 2021-09-22 20:23 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 50476

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]


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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-*
  2021-09-22 20:23       ` Arun Isaac
@ 2021-09-27 15:59         ` Ludovic Courtès
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 " Arun Isaac
                             ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Ludovic Courtès @ 2021-09-27 15:59 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 50476

Hi,

Arun Isaac <arunisaac@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’.




^ permalink raw reply	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
  2021-09-27 15:59         ` Ludovic Courtès
@ 2021-09-30 16:52           ` Arun Isaac
  2021-10-02 14:04             ` Ludovic Courtès
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
                             ` (8 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

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





^ permalink raw reply	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 01/10] gnu: guile-dbi: Update upstream source.
  2021-09-27 15:59         ` Ludovic Courtès
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 " Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
                             ` (7 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 02/10] gnu: guile-dbi: Remove hard-coded guile effective version.
  2021-09-27 15:59         ` Ludovic Courtès
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 " Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
                             ` (6 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (2 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
                             ` (5 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 04/10] gnu: guile-dbi: Do not return #t from custom phases.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (3 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
                             ` (4 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 05/10] gnu: guile-dbi: Update to 2.1.8.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (4 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
                             ` (3 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (5 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
                             ` (2 subsequent siblings)
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 07/10] gnu: guile-dbd-postgresql: Inherit from guile-dbi.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (6 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 09/10] gnu: Add guile-dbd-mysql Arun Isaac
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 08/10] gnu: guile-dbi-bootstrap: Remove package.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (7 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 09/10] gnu: Add guile-dbd-mysql Arun Isaac
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 09/10] gnu: Add guile-dbd-mysql.
  2021-09-27 15:59         ` Ludovic Courtès
                             ` (8 preceding siblings ...)
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
@ 2021-09-30 16:52           ` Arun Isaac
  9 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-09-30 16:52 UTC (permalink / raw)
  To: Ludovic Courtès, Arun Isaac; +Cc: 50476

* 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





^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [bug#50476] [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
  2021-09-30 16:52           ` [bug#50476] [PATCH v2 " Arun Isaac
@ 2021-10-02 14:04             ` Ludovic Courtès
  2021-10-03 15:03               ` bug#50476: " Arun Isaac
  0 siblings, 1 reply; 26+ messages in thread
From: Ludovic Courtès @ 2021-10-02 14:04 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 50476

Hi Arun,

Arun Isaac <arunisaac@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’.




^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#50476: [PATCH v2 00/10] Update guile-dbi and guile-dbd-*
  2021-10-02 14:04             ` Ludovic Courtès
@ 2021-10-03 15:03               ` Arun Isaac
  0 siblings, 0 replies; 26+ messages in thread
From: Arun Isaac @ 2021-10-03 15:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 50476-done

[-- Attachment #1: Type: text/plain, Size: 27 bytes --]


Pushed to master, thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-10-03 15:06 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 14:45 [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-* Arun Isaac
2021-09-08 14:54 ` [bug#50476] [PATCH 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
2021-09-21 12:53     ` [bug#50476] [PATCH 00/10] Update guile-dbi and guile-dbd-* Ludovic Courtès
2021-09-22 20:23       ` Arun Isaac
2021-09-27 15:59         ` Ludovic Courtès
2021-09-30 16:52           ` [bug#50476] [PATCH v2 " Arun Isaac
2021-10-02 14:04             ` Ludovic Courtès
2021-10-03 15:03               ` bug#50476: " Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 01/10] gnu: guile-dbi: Update upstream source Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 02/10] gnu: guile-dbi: Remove hard-coded guile effective version Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 03/10] gnu: guile-dbi: Search for dbd libraries using native-search-paths Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
2021-09-30 16:52           ` [bug#50476] [PATCH v2 09/10] gnu: Add guile-dbd-mysql Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 04/10] gnu: guile-dbi: Do not return #t from custom phases Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 05/10] gnu: guile-dbi: Update to 2.1.8 Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 06/10] gnu: guile-dbd-sqlite3: Inherit from guile-dbi Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 07/10] gnu: guile-dbd-postgresql: " Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 08/10] gnu: guile-dbi-bootstrap: Remove package Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 09/10] gnu: Add guile-dbd-mysql Arun Isaac
2021-09-08 14:54   ` [bug#50476] [PATCH 10/10] gnu: guile-dbd-sqlite3: Use normal variable instead of @ reference Arun Isaac

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).