GNU bug report logs - #34327
[PATCH] gnu: Add guile-dbd-postgresql.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Tue, 5 Feb 2019 09:24:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.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 34327 in the body.
You can then email your comments to 34327 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#34327; Package guix-patches. (Tue, 05 Feb 2019 09:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 05 Feb 2019 09:24:03 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add guile-dbd-postgresql.
Date: Tue,  5 Feb 2019 09:23:16 +0000
Currently, there are packages for guile-dbi and guile-dbd-sqlite3, but the
PostgreSQL and MySQL parts are not packaged. As GNA which did host the release
archives for guile-dbi no longer exists, this package definition uses the
upstream Git repository.

* gnu/packages/guile-xyz.scm (guile-dbd-postgresql): New variable.
(guile-dbi)[arguments]: Add guile-dbd-postgresql to the rpath through the
[inputs]: Add guile-dbd-postgresql.
---
 gnu/packages/guile-xyz.scm | 67 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 64 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 9640d17c3c..e959275318 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -45,6 +45,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages disk)
   #:use-module (gnu packages ed)
   #:use-module (gnu packages emacs)
@@ -63,6 +64,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
@@ -1046,8 +1048,10 @@ library}.")
        (list (string-append
               "--with-guile-site-dir=" %output "/share/guile/site/2.2"))
        #:make-flags
-       (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib:"
-                            (assoc-ref %build-inputs "guile-dbd-sqlite3") "/lib"))
+       (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
@@ -1059,7 +1063,8 @@ library}.")
                (substitute* dbi.scm (("libguile-dbi") ext))
                #t))))))
     (inputs
-     `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3))) ; only shared library, no scheme files
+     `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3)
+       ("guile-dbd-postgresql" ,guile-dbd-postgresql))) ; only shared library, no scheme files
     (propagated-inputs
      `(("guile" ,guile-2.2)))
     (synopsis "Guile database abstraction layer")
@@ -1106,6 +1111,62 @@ It currently supports MySQL, Postgres and SQLite3.")
 SQL databases.  This package implements the interface for SQLite.")
     (license license:gpl2+)))
 
+(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.git")
+               (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
+             (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
+             (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
+interface to SQL databases.  This package implements the interface for
+PostgreSQL.")
+      (license license:gpl2+))))
+
 (define-public guile-config
   (package
     (name "guile-config")
-- 
2.20.1





Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Tue, 05 Feb 2019 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Tue, 05 Feb 2019 15:45:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 34327-done <at> debbugs.gnu.org
Subject: Re: [bug#34327] [PATCH] gnu: Add guile-dbd-postgresql.
Date: Tue, 05 Feb 2019 15:44:31 +0000
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Currently, there are packages for guile-dbi and guile-dbd-sqlite3, but the
>> PostgreSQL and MySQL parts are not packaged. As GNA which did host the release
>> archives for guile-dbi no longer exists, this package definition uses the
>> upstream Git repository.
>>
>> * gnu/packages/guile-xyz.scm (guile-dbd-postgresql): New variable.
>> (guile-dbi)[arguments]: Add guile-dbd-postgresql to the rpath through the
>> [inputs]: Add guile-dbd-postgresql.
>
> “to the rpath through the” …?

How odd, it was meant to say "to the rpath through the #:make-flags".

> The rest looks good to me.

Thanks for taking a look, I've updated the commit message and pushed.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34327; Package guix-patches. (Wed, 06 Feb 2019 02:26:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 34327 <at> debbugs.gnu.org
Subject: Re: [bug#34327] [PATCH] gnu: Add guile-dbd-postgresql.
Date: Tue, 05 Feb 2019 11:38:35 +0100
Christopher Baines <mail <at> cbaines.net> writes:

> Currently, there are packages for guile-dbi and guile-dbd-sqlite3, but the
> PostgreSQL and MySQL parts are not packaged. As GNA which did host the release
> archives for guile-dbi no longer exists, this package definition uses the
> upstream Git repository.
>
> * gnu/packages/guile-xyz.scm (guile-dbd-postgresql): New variable.
> (guile-dbi)[arguments]: Add guile-dbd-postgresql to the rpath through the
> [inputs]: Add guile-dbd-postgresql.

“to the rpath through the” …?

The rest looks good to me.

-- 
Ricardo





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Mar 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 53 days ago.

Previous Next


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