(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+))) (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+))) gnucash-with-dbi