unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH]: gnu: Add guile-dbi.
@ 2016-06-18  8:09 宋文武
  2016-06-20  8:24 ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: 宋文武 @ 2016-06-18  8:09 UTC (permalink / raw)
  To: guix-devel

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

Here are 'guile-dbi' and 'guile-dbd-sqlite3':


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-guile-dbi.patch --]
[-- Type: text/x-patch, Size: 2338 bytes --]

From 8e73c3e1a798b134e341c71c4b1c17d60956e3d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Fri, 17 Jun 2016 22:44:56 +0800
Subject: [PATCH 1/2] gnu: Add guile-dbi.

* gnu/packages/guile.scm (guile-dbi): New variable.
---
 gnu/packages/guile.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 6f00edb..284b123 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -958,4 +958,42 @@ provides access to that interface and its types from the Scheme level.")
     (home-page "http://www.nongnu.org/g-wrap/index.html")
     (license lgpl2.1+)))
 
+(define-public guile-dbi
+  (package
+    (name "guile-dbi")
+    (version "2.1.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://download.gna.org/guile-dbi/guile-dbi-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "116njrprhgrsv1qm904sp3b02rq01fx639r433d657gyhw3x159n"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append
+              "--with-guile-site-dir=" %output "/share/guile/site/2.0"))
+       #: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.0/dbi/dbi.scm"))
+                    (ext     (string-append out "/lib/libguile-dbi")))
+               (substitute* dbi.scm (("libguile-dbi") ext))
+               #t))))))
+    (propagated-inputs
+     `(("guile" ,guile-2.0)))
+    (synopsis "Guile database abstraction layer")
+    (home-page "http://home.gna.org/guile-dbi/guile-dbi.html")
+    (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
+programming interface is presented regardless of which database system is used.
+It currently supports MySQL, Postgres and SQLite3.")
+    (license gpl2+)))
+
 ;;; guile.scm ends here
-- 
2.8.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-guile-dbd-sqlite3.patch --]
[-- Type: text/x-patch, Size: 1730 bytes --]

From 87c3ef658e24035715b48606fb9ef24d55aaddfa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Sat, 18 Jun 2016 15:49:36 +0800
Subject: [PATCH 2/2] gnu: Add guile-dbd-sqlite3.

* gnu/packages/guile.scm (guile-dbd-sqlite3): New variable.
---
 gnu/packages/guile.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 284b123..29c7ed2 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -996,4 +996,31 @@ programming interface is presented regardless of which database system is used.
 It currently supports MySQL, Postgres and SQLite3.")
     (license gpl2+)))
 
+(define-public guile-dbd-sqlite3
+  (package
+    (name "guile-dbd-sqlite3")
+    (version "2.1.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://download.gna.org/guile-dbi/guile-dbd-sqlite3-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("sqlite" ,sqlite)
+       ("zlib" ,(@ (gnu packages compression) zlib))))
+    (propagated-inputs
+     `(("guile-dbi" ,guile-dbi)))
+    (synopsis "Guile DBI driver for SQLite")
+    (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 gpl2+)))
+
 ;;; guile.scm ends here
-- 
2.8.4


[-- Attachment #4: Type: text/plain, Size: 139 bytes --]


Unfortunately, Guile DBI loads its backends using `dlopen',
so I have to set 'LD_LIBRARY_PATH' to '$guile-dbd-sqlite/lib'
for loading it.

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

end of thread, other threads:[~2017-07-11 18:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18  8:09 [PATCH]: gnu: Add guile-dbi 宋文武
2016-06-20  8:24 ` Ludovic Courtès
2016-06-21  8:35   ` Maurizio Boriani
2016-06-21 14:14     ` Ludovic Courtès
2016-06-21 15:09       ` 宋文武
2016-06-21 20:56         ` Ludovic Courtès
2016-09-16  3:36           ` guile-dbi: Use libltdl and prefer GUILE_DBD_PATH 宋文武
2016-09-16  6:57             ` baux
2017-07-10 22:54             ` Linas Vepstas
2017-07-11 11:02               ` 宋文武
2017-07-11 18:31                 ` Nala Ginrut

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).