From patchwork Tue Feb 5 09:23:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 960 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 936A616B8D; Tue, 5 Feb 2019 09:24:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id DD53B16B8A for ; Tue, 5 Feb 2019 09:24:14 +0000 (GMT) Received: from localhost ([127.0.0.1]:56926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqwxi-0005nU-FV for patchwork@mira.cbaines.net; Tue, 05 Feb 2019 04:24:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqwxb-0005mh-D0 for guix-patches@gnu.org; Tue, 05 Feb 2019 04:24:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqwxZ-0005nV-EP for guix-patches@gnu.org; Tue, 05 Feb 2019 04:24:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqwxX-0005mh-1g for guix-patches@gnu.org; Tue, 05 Feb 2019 04:24:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gqwxW-0003ZG-ST for guix-patches@gnu.org; Tue, 05 Feb 2019 04:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34327] [PATCH] gnu: Add guile-dbd-postgresql. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 05 Feb 2019 09:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34327 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34327@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154935861213667 (code B ref -1); Tue, 05 Feb 2019 09:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Feb 2019 09:23:32 +0000 Received: from localhost ([127.0.0.1]:60067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqwx2-0003YK-77 for submit@debbugs.gnu.org; Tue, 05 Feb 2019 04:23:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqwwz-0003Xp-SH for submit@debbugs.gnu.org; Tue, 05 Feb 2019 04:23:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:42487) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gqwwt-0005Xw-AZ for submit@debbugs.gnu.org; Tue, 05 Feb 2019 04:23:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqwwr-0005ge-Ma for guix-patches@gnu.org; Tue, 05 Feb 2019 04:23:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqwwq-0005X3-9k for guix-patches@gnu.org; Tue, 05 Feb 2019 04:23:21 -0500 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:46256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqwwq-0005Vw-0y for guix-patches@gnu.org; Tue, 05 Feb 2019 04:23:20 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 3EA9B16B88 for ; Tue, 5 Feb 2019 09:23:17 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 32a63038 for ; Tue, 5 Feb 2019 09:23:16 +0000 (UTC) From: Christopher Baines Date: Tue, 5 Feb 2019 09:23:16 +0000 Message-Id: <20190205092316.3563-1-mail@cbaines.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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")