help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Further attempts at building GnuCash with SQLite support


From: Gary Johnson
Subject: Further attempts at building GnuCash with SQLite support
Date: Mon, 18 Dec 2017 16:14:25 -0500
User-agent: mu4e 0.9.18; emacs 25.3.1

Hi Guix,

After spending some more time with the Guix manual and a bit of REPL
experimentation, I tweaked my package definitions for libdbi and
libdbi-drivers-sqlite so that they now appear to be building
successfully. Here they are for your consideration:

======================================================================
=
= (define-module (my-packages gnucash-with-dbi)
=   #:use-module ((guix licenses) #:prefix license:)
=   #:use-module (guix store)
=   #:use-module (guix packages)
=   #:use-module (guix download)
=   #:use-module (guix build-system gnu)
=   #:use-module (gnu packages)
=   #:use-module (gnu packages databases)
=   #:use-module (gnu packages gnome)
=   #:use-module (gnu packages gnucash)
=   #:use-module (gnu packages glib)
=   #:use-module (gnu packages gtk)
=   #:use-module (gnu packages guile)
=   #:use-module (gnu packages icu4c)
=   #:use-module (gnu packages perl)
=   #:use-module (gnu packages pkg-config)
=   #:use-module (gnu packages web)
=   #:use-module (gnu packages webkit)
=   #:use-module (gnu packages xml))
=
= (define-public libdbi
=   (package
=     (name "libdbi")
=     (version "0.9.0")
=     (source
=      (origin
=       (method url-fetch)
=       (uri
=        (string-append 
"https://versaweb.dl.sourceforge.net/project/libdbi/libdbi/libdbi-";
=                       version "/libdbi-" version ".tar.gz"))
=       (sha256
=        (base32
=         "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
=     (build-system gnu-build-system)
=     (home-page "http://libdbi.sourceforge.net/";)
=     (synopsis "Database-independent abstraction layer in C")
=     (description
=      "The libdbi framework 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.")
=     (license license:lgpl2.1+)))
=
= (define-public libdbi-drivers-sqlite
=   (package
=     (name "libdbi-drivers-sqlite")
=     (version "0.9.0")
=     (source
=      (origin
=       (method url-fetch)
=       (uri
=        (string-append 
"https://versaweb.dl.sourceforge.net/project/libdbi-drivers/libdbi-drivers/libdbi-drivers-";
=                       version "/libdbi-drivers-" version ".tar.gz"))
=       (sha256
=        (base32
=         "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
=     (build-system gnu-build-system)
=     (propagated-inputs
=      `(("libdbi" ,libdbi)
=        ("sqlite" ,sqlite)))
=     (arguments
=      `(#:configure-flags '("--with-sqlite3"
=                            ,(string-append "--with-dbi-libdir="
=                                            (package-output (open-connection) 
libdbi)))))
=     (home-page "http://libdbi-drivers.sourceforge.net/";)
=     (synopsis "Database-specific drivers for the libdbi framework")
=     (description
=      "The libdbi-drivers project provides the database-specific drivers for
= the libdbi framework. The current version of libdbi-drivers will work
= with any 0.9.x release of the framework. The drivers officially
= supported by libdbi are MySQL, PostgreSQL, and SQLite3.")
=     (license license:lgpl2.1+)))
=
======================================================================

So...now that those are installing themselves successfully, I moved on
to install GnuCash with DBI support for SQLite3. Here's my package
definition:

======================================================================
=
= (define-public gnucash-with-dbi
=   (package
=     (name "gnucash-with-dbi")
=     (version "2.6.16")
=     (source
=      (origin
=       (method url-fetch)
=       (uri (string-append 
"mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
=                           version "/gnucash-" version ".tar.bz2"))
=       (sha256
=        (base32
=         "1088rssg9xgwi3wdfrhdcga46gby6lrd9a1fvn9zq456lscn4m9c"))
=       (patches (search-patches "gnucash-price-quotes-perl.patch"))))
=     (build-system gnu-build-system)
=     (inputs
=      `(("guile" ,guile-2.0)
=        ("icu4c" ,icu4c)
=        ("glib" ,glib)
=        ("gtk" ,gtk+-2)
=        ("goffice" ,goffice-0.8)
=        ("libgnomecanvas" ,libgnomecanvas)
=        ("libxml2" ,libxml2)
=        ("libxslt" ,libxslt)
=        ("webkitgtk" ,webkitgtk/gtk+-2)
=        ("aqbanking" ,aqbanking)
=        ("perl-date-manip" ,perl-date-manip)
=        ("perl-finance-quote" ,perl-finance-quote)))
=     (propagated-inputs
=      `(("sqlite" ,sqlite)
=        ("libdbi" ,libdbi)
=        ("libdbi-drivers-sqlite" ,libdbi-drivers-sqlite)))
=     (native-inputs
=      `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
=        ("intltool" ,intltool)
=        ("pkg-config" ,pkg-config)))
=     (arguments
=      `(#:tests? #f ;FIXME: failing at /qof/gnc-date/qof print date dmy buff
=        #:configure-flags '("--enable-aqbanking"
=                            ,(string-append "--with-dbi-dbd-dir="
=                                            (package-output (open-connection) 
libdbi-drivers-sqlite)
=                                            "/lib/dbd"))
=        #:phases
=        (modify-phases %standard-phases
=          (add-after
=           'install 'wrap-programs
=           (lambda* (#:key inputs outputs #:allow-other-keys)
=             (for-each (lambda (prog)
=                         (wrap-program (string-append (assoc-ref outputs "out")
=                                                      "/bin/" prog)
=                           `("PERL5LIB" ":" prefix
=                             ,(map (lambda (o)
=                                     (string-append o "/lib/perl5/site_perl/"
=                                                    ,(package-version perl)))
=                                   (if (string=? prog "gnc-fq-helper")
=                                       (list
=                                        ,@(transitive-input-references
=                                           'inputs
=                                           (map (lambda (l)
=                                                  (assoc l (inputs)))
=                                                '("perl-finance-quote"
=                                                  "perl-date-manip"))))
=                                       (list
=                                        ,@(transitive-input-references
=                                           'inputs
=                                           (map (lambda (l)
=                                                  (assoc l (inputs)))
=                                                '("perl-finance-quote")))))))))
=                       '("gnucash"
=                         "gnc-fq-check"
=                         "gnc-fq-helper"
=                         "gnc-fq-dump")))))))
=     (home-page "http://www.gnucash.org/";)
=     (synopsis "Personal and small business financial accounting software")
=     (description
=      "GnuCash is personal and professional financial-accounting
= software. It can be used to track bank accounts, stocks, income and
= expenses, based on the double-entry accounting practice. It includes
= support for QIF/OFX/HBCI import and transaction matching. It also
= automates several tasks, such as financial calculations or scheduled
= transactions.")
=     (license license:gpl3+)))
=
======================================================================

This is based off of the Guix distribution's gnucash package, but
notably "--disable-dbi" has been removed from #:configure-flags and
"--with-dbi-dbd-dir" has been added.

Bear in mind that without "--with-dbi-dbd-dir", GnuCash's configure
phase tries to find the libdbi drivers in
/gnu/store/...libdbi-0.9.0/lib/dbd and NOT in
/gnu/store/...libdbi-drivers-sqlite-0.9.0/lib/dbd as it should.

I'm guessing this has something to do with the GnuCash build procedure
not keeping up with the source code reorganization in the libdbi
project. Ah well...anyway, "with-dbi-dbd-dir" is supposed to overcome
this obstacle, so on we go...

When I run "guix build gnucash-with-dbi", the package build fails in the
configure phase like so:

======================================================================
=
= checking dbi/dbi.h usability... yes
= checking dbi/dbi.h presence... yes
= checking for dbi/dbi.h... yes
= configure: Search Path 
:/gnu/store/2clnv9i49dx33k4rr7aym5sfiryhysna-libdbi-drivers-sqlite-0.9.0/lib/dbd
= checking Looking for at least one supported DBD module... configure: error:
= Unable to find any of the supported dbd modules
= (libdbdsqlite3, libdbdmysql, or libdbdpgsql) needed to actually use the SQL
= backend.
=
=
= If you do have them installed the problem is either that dlopen cannot
= find them or that dlopen itself is not getting linked. Check config.log
= to find out which.  You can add the option --with-dbi-dbd-dir pointing to
= the directory in which they are located.
=
= If you do not actually want to build with libdi add --disable-dbi
= to the configure argument list and run it again.
=
= phase `configure' failed after 7.9 seconds
=
======================================================================

Okay...so...what? If I look where configure is supposedly looking, I see
the drivers right there:

======================================================================

$ ls -l 
/gnu/store/2clnv9i49dx33k4rr7aym5sfiryhysna-libdbi-drivers-sqlite-0.9.0/lib/dbd
-r--r--r--   2 root           root     50840 1969-12-31  1969 libdbdsqlite3.a
-r-xr-xr-x   2 root           root      1240 1969-12-31  1969 libdbdsqlite3.la
-r-xr-xr-x   2 root           root     52880 1969-12-31  1969 libdbdsqlite3.so

======================================================================

I've attached the config.log created in the build environment after
running "guix build -K gnucash-with-dbi" to this email for your review.

Attachment: config.log
Description: Text document

The notable part appears to start on line 1890:

======================================================================

configure:21739: Search Path 
:/gnu/store/2clnv9i49dx33k4rr7aym5sfiryhysna-libdbi-drivers-sqlite-0.9.0/lib/dbd
configure:21741: checking Looking for at least one supported DBD module
configure:21761: gcc -o conftest -g -O2 -std=gnu99   conftest.c -ldl -lpthread  
>&5
configure:21761: $? = 0
configure:21761: ./conftest
configure:21761: $? = 255
configure: program exited with status 255
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GnuCash"
| #define PACKAGE_TARNAME "gnucash"
| #define PACKAGE_VERSION "2.6.16"
| #define PACKAGE_STRING "GnuCash 2.6.16"
| #define PACKAGE_BUGREPORT 
"https://bugzilla.gnome.org/page.cgi?id=browse.html&product=GnuCash";
| #define PACKAGE_URL "http://www.gnucash.org/";
| #define PACKAGE "gnucash"
| #define VERSION "2.6.16"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define GNUCASH_MAJOR_VERSION 2
| #define GNUCASH_MINOR_VERSION 6
| #define GNUCASH_MICRO_VERSION 16
| #define GNUCASH_NANO_VERSION 0
| #define GNUCASH_RESAVE_VERSION 19920
| #define GNUCASH_LATEST_STABLE_SERIES "2.6"
| #define GETTEXT_PACKAGE "gnucash"
| #define HAVE_LOCALE_H 1
| #define HAVE_LC_MESSAGES 1
| #define HAVE_BIND_TEXTDOMAIN_CODESET 1
| #define HAVE_GETTEXT 1
| #define HAVE_DCGETTEXT 1
| #define ENABLE_NLS 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define STDC_HEADERS 1
| #define HAVE_LIMITS_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_STPCPY 1
| #define HAVE_MEMCPY 1
| #define HAVE_TIMEGM 1
| #define HAVE_TOWUPPER 1
| #define HAVE_SETENV 1
| #define HAVE_STRUCT_TM_GMTOFF 1
| #define HAVE_SCANF_LLD 1
| #define ENABLE_BINRELOC /**/
| #define HAVE_LIBPTHREAD 1
| #define BR_PTHREAD 1
| #define HAVE_GLIB_2_38 1
| #define HAVE_GLIB_2_36 1
| #define HAVE_GLIB_2_32 1
| #define HAVE_DIRENT_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_UTMP_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MCHECK_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_WCTYPE_H 1
| #define HAVE_DLERROR 1
| #define HAVE_X11_XLIB_H 1
| #define HAVE_GLOB_H 1
| #define HAVE_CHOWN 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETPPID 1
| #define HAVE_GETUID 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_GMTIME_R 1
| #define HAVE_GETHOSTID 1
| #define HAVE_LINK 1
| #define HAVE_LTDL_H 1
| #define HAVE_DBI_DBI_H 1
| /* end confdefs.h.  */
| #include <dlfcn.h>
| int
| main ()
| {
| if (!dlopen("libdbdsqlite3.so", RTLD_NOW)) return -1;
|
|   ;
|   return 0;
| }

... repeat this test for libdbdmysql.so and libdbdpgsql.so ...

configure:21809: error:
Unable to find any of the supported dbd modules
(libdbdsqlite3, libdbdmysql, or libdbdpgsql) needed to actually use the SQL
backend.

If you do have them installed the problem is either that dlopen cannot
find them or that dlopen itself is not getting linked. Check config.log
to find out which.  You can add the option --with-dbi-dbd-dir pointing to
the directory in which they are located.

If you do not actually want to build with libdi add --disable-dbi
to the configure argument list and run it again.

======================================================================

So...gnucash-with-dbi's configure phase appears to be looking in the
right directory for the dbd modules, however dlopen is failing to
actually open libdbdsqlite3.so. What gives?

Help?
  Gary

reply via email to

[Prev in Thread] Current Thread [Next in Thread]