unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38298] [PATCH 0/3] Activate database support in gnucash.
@ 2019-11-20 12:40 Guillaume Le Vaillant
  2019-11-20 12:46 ` [bug#38298] [PATCH 1/3] gnu: Add libdbi Guillaume Le Vaillant
  2019-11-25 23:17 ` bug#38298: [PATCH 0/3] Activate database support in gnucash Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2019-11-20 12:40 UTC (permalink / raw)
  To: 38298

This patch series adds database support (based on libdbi) to gnucash.

Patches:
 1- gnu: Add libdbi.
 2- gnu: Add libdbi-drivers.
 3- gnu: gnucash: Activate database support.

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

* [bug#38298] [PATCH 1/3] gnu: Add libdbi.
  2019-11-20 12:40 [bug#38298] [PATCH 0/3] Activate database support in gnucash Guillaume Le Vaillant
@ 2019-11-20 12:46 ` Guillaume Le Vaillant
  2019-11-20 12:46   ` [bug#38298] [PATCH 2/3] gnu: Add libdbi-drivers Guillaume Le Vaillant
  2019-11-20 12:46   ` [bug#38298] [PATCH 3/3] gnu: gnucash: Activate database support Guillaume Le Vaillant
  2019-11-25 23:17 ` bug#38298: [PATCH 0/3] Activate database support in gnucash Ludovic Courtès
  1 sibling, 2 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2019-11-20 12:46 UTC (permalink / raw)
  To: 38298; +Cc: Guillaume Le Vaillant

* gnu/packages/databases.scm (libdbi): New variable.
---
 gnu/packages/databases.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index acce540e06..2ccaae205c 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -37,6 +37,7 @@
 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3170,3 +3171,24 @@ NumPy, and other traditional Python scientific computing packages.")
 It implements the Python DB API 2.0 specification and includes support for
 SQLAlchemy.")
     (license license:asl2.0)))
+
+(define-public libdbi
+  (package
+    (name "libdbi")
+    (version "0.9.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
+                                  version "/libdbi-" version ".tar.gz"))
+              (sha256
+               (base32
+                "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
+    (build-system gnu-build-system)
+    (synopsis "Database independent abstraction layer in C")
+    (description
+     "This library implements a database independent abstraction layer in C,
+similar to the DBI/DBD layer in Perl.  Writing one generic set of code,
+programmers can leverage the power of multiple databases and multiple
+simultaneous database connections by using this framework.")
+    (home-page "http://libdbi.sourceforge.net/")
+    (license license:lgpl2.1+)))
-- 
2.24.0

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

* [bug#38298] [PATCH 2/3] gnu: Add libdbi-drivers.
  2019-11-20 12:46 ` [bug#38298] [PATCH 1/3] gnu: Add libdbi Guillaume Le Vaillant
@ 2019-11-20 12:46   ` Guillaume Le Vaillant
  2019-11-20 12:46   ` [bug#38298] [PATCH 3/3] gnu: gnucash: Activate database support Guillaume Le Vaillant
  1 sibling, 0 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2019-11-20 12:46 UTC (permalink / raw)
  To: 38298; +Cc: Guillaume Le Vaillant

* gnu/packages/databases.scm (libdbi-drivers): New variable.
---
 gnu/packages/databases.scm | 68 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 2ccaae205c..4be5912022 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -3192,3 +3192,71 @@ programmers can leverage the power of multiple databases and multiple
 simultaneous database connections by using this framework.")
     (home-page "http://libdbi.sourceforge.net/")
     (license license:lgpl2.1+)))
+
+(define-public libdbi-drivers
+  (package
+    (name "libdbi-drivers")
+    (version "0.9.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/libdbi-drivers/"
+                                  "libdbi-drivers/libdbi-drivers-" version
+                                  "/libdbi-drivers-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("inetutils" ,inetutils)
+       ("glibc-locales" ,glibc-locales)))
+    (inputs
+     `(("libdbi" ,libdbi)
+       ("mysql" ,mariadb)
+       ("postgresql" ,postgresql)
+       ("sqlite" ,sqlite)))
+    (arguments
+     `(#:configure-flags
+       (let ((libdbi (assoc-ref %build-inputs "libdbi"))
+             (mysql (assoc-ref %build-inputs "mysql"))
+             (postgresql (assoc-ref %build-inputs "postgresql"))
+             (sqlite (assoc-ref %build-inputs "sqlite")))
+         (list "--disable-docs"
+               (string-append "--with-dbi-incdir=" libdbi "/include")
+               (string-append "--with-dbi-libdir=" libdbi "/lib")
+               "--with-mysql"
+               (string-append "--with-mysql-incdir=" mysql "/include/mysql")
+               (string-append "--with-mysql-libdir=" mysql "/lib")
+               "--with-pgsql"
+               (string-append "--with-pgsql-incdir=" postgresql "/include")
+               (string-append "--with-pgsql-libdir=" postgresql "/lib")
+               "--with-sqlite3"
+               (string-append "--with-sqlite-incdir=" sqlite "/include")
+               (string-append "--with-sqlite-libdir=" sqlite "/lib")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "tests/test_mysql.sh"
+               (("^MYMYSQLD=.*")
+                (string-append "MYMYSQLD="
+                               (assoc-ref inputs "mysql")
+                               "/bin/mysqld")))
+             #t))
+         (add-after 'install 'remove-empty-directories
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((var (string-append (assoc-ref outputs "out") "/var")))
+               (delete-file-recursively var))
+             #t)))))
+    (synopsis "Database drivers for the libdbi framework")
+    (description
+     "The @code{libdbi-drivers} library provides the database specific drivers
+for the @code{libdbi} framework.
+
+The drivers officially supported by @code{libdbi} are:
+@itemize
+@item MySQL,
+@item PostgreSQL,
+@item SQLite.
+@end itemize")
+    (home-page "http://libdbi-drivers.sourceforge.net/")
+    (license license:lgpl2.1+)))
-- 
2.24.0

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

* [bug#38298] [PATCH 3/3] gnu: gnucash: Activate database support.
  2019-11-20 12:46 ` [bug#38298] [PATCH 1/3] gnu: Add libdbi Guillaume Le Vaillant
  2019-11-20 12:46   ` [bug#38298] [PATCH 2/3] gnu: Add libdbi-drivers Guillaume Le Vaillant
@ 2019-11-20 12:46   ` Guillaume Le Vaillant
  1 sibling, 0 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2019-11-20 12:46 UTC (permalink / raw)
  To: 38298; +Cc: Guillaume Le Vaillant

* gnu/packages/gnucash.scm (gnucash)[inputs]: Add libdbi and libdbi-drivers.
  [arguments]: Remove '-DWITH_SQL=OFF' from 'configure-flags' and add
  'GNC_DBD_DIR' to program wrapping.
---
 gnu/packages/gnucash.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index de916a8829..af017e108d 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages gnome)
@@ -70,6 +72,8 @@
        ("icu4c" ,icu4c)
        ("glib" ,glib)
        ("gtk" ,gtk+)
+       ("libdbi" ,libdbi)
+       ("libdbi-drivers" ,libdbi-drivers)
        ("libgnomecanvas" ,libgnomecanvas)
        ("libxml2" ,libxml2)
        ("libxslt" ,libxslt)
@@ -89,8 +93,7 @@
     (arguments
      `(#:test-target "check"
        #:configure-flags
-       (list "-DWITH_OFX=OFF"           ; libofx is not available yet
-             "-DWITH_SQL=OFF")          ; without dbi.h
+       (list "-DWITH_OFX=OFF")          ; libofx is not available yet
        #:make-flags '("GUILE_AUTO_COMPILE=0")
        #:modules ((guix build cmake-build-system)
                   ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
@@ -147,6 +150,10 @@
              (for-each (lambda (prog)
                          (wrap-program (string-append (assoc-ref outputs "out")
                                                       "/bin/" prog)
+                           `("GNC_DBD_DIR" =
+                             (,(string-append
+                                (assoc-ref inputs "libdbi-drivers")
+                                "/lib/dbd")))
                            `("PERL5LIB" ":" prefix
                              ,(map (lambda (o)
                                      (string-append o "/lib/perl5/site_perl/"
-- 
2.24.0

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

* bug#38298: [PATCH 0/3] Activate database support in gnucash.
  2019-11-20 12:40 [bug#38298] [PATCH 0/3] Activate database support in gnucash Guillaume Le Vaillant
  2019-11-20 12:46 ` [bug#38298] [PATCH 1/3] gnu: Add libdbi Guillaume Le Vaillant
@ 2019-11-25 23:17 ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2019-11-25 23:17 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 38298-done

Guillaume Le Vaillant <glv@posteo.net> skribis:

> This patch series adds database support (based on libdbi) to gnucash.
>
> Patches:
>  1- gnu: Add libdbi.
>  2- gnu: Add libdbi-drivers.
>  3- gnu: gnucash: Activate database support.

Applied all three patches, thanks!

Ludo’.

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

end of thread, other threads:[~2019-11-25 23:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-20 12:40 [bug#38298] [PATCH 0/3] Activate database support in gnucash Guillaume Le Vaillant
2019-11-20 12:46 ` [bug#38298] [PATCH 1/3] gnu: Add libdbi Guillaume Le Vaillant
2019-11-20 12:46   ` [bug#38298] [PATCH 2/3] gnu: Add libdbi-drivers Guillaume Le Vaillant
2019-11-20 12:46   ` [bug#38298] [PATCH 3/3] gnu: gnucash: Activate database support Guillaume Le Vaillant
2019-11-25 23:17 ` bug#38298: [PATCH 0/3] Activate database support in gnucash Ludovic Courtès

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