Re: [PATCH 6/6] gnu: gnucash: Add Finance::Quote support.

2015-07-22 Thread Ludovic Courtès
ericbav...@openmailbox.org skribis:

 From: Eric Bavier bav...@member.fsf.org

 * gnu/packages/patches/gnucash-price-quotes-perl.patch: New patch.
 * gnu-system.am (dist_patch_DATA): Add it.
 * gnu/packages/gnucash.scm (gnucash)[source]: Use it.
   [arguments]: Add 'wrap-programs' phase.
   [inputs]: Add perl-date-manip and perl-finance-quote.

OK!

Thanks,
Ludo'.



[PATCH 6/6] gnu: gnucash: Add Finance::Quote support.

2015-07-09 Thread ericbavier
From: Eric Bavier bav...@member.fsf.org

* gnu/packages/patches/gnucash-price-quotes-perl.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/gnucash.scm (gnucash)[source]: Use it.
  [arguments]: Add 'wrap-programs' phase.
  [inputs]: Add perl-date-manip and perl-finance-quote.
---
 gnu-system.am  |  1 +
 gnu/packages/gnucash.scm   | 41 --
 .../patches/gnucash-price-quotes-perl.patch| 23 
 3 files changed, 62 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/gnucash-price-quotes-perl.patch

diff --git a/gnu-system.am b/gnu-system.am
index fafe9ed..99899e7 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -447,6 +447,7 @@ dist_patch_DATA =   
\
   gnu/packages/patches/glibc-ldd-x86_64.patch  \
   gnu/packages/patches/glibc-locales.patch \
   gnu/packages/patches/gmp-arm-asm-nothumb.patch   \
+  gnu/packages/patches/gnucash-price-quotes-perl.patch \
   gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   gnu/packages/patches/gobject-introspection-cc.patch  \
   gnu/packages/patches/gobject-introspection-girepository.patch\
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 6ab8f09..d7e72c9 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus rek...@elephly.net
+;;; Copyright © 2015 Eric Bavier bav...@member.fsf.org
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,7 +28,9 @@
   #: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))
 
@@ -42,11 +45,41 @@
   version .tar.bz2))
   (sha256
(base32
-103ir5qg6k8m2mmg9b99c3gn8myxh1gsqyr0mfhmrhqya68wfdr3
+103ir5qg6k8m2mmg9b99c3gn8myxh1gsqyr0mfhmrhqya68wfdr3))
+  (patches (list (search-patch gnucash-price-quotes-perl.patch)
 (build-system gnu-build-system)
 (arguments
  `(#:tests? #f ;FIXME: failing at /qof/gnc-date/qof print date dmy buff
-   #:configure-flags '(--disable-dbi)))
+   #:configure-flags '(--disable-dbi)
+   #:modules ((srfi srfi-1)
+  ,@%gnu-build-system-modules)
+   #: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)))
+  (delete-duplicates
+   (if (string=? prog gnc-fq-helper)
+   (list
+,@(package-propagated-input-refs
+   'inputs
+   (list perl-finance-quote
+ perl-date-manip)))
+   (list
+,@(package-propagated-input-refs
+   'inputs
+   (list perl-finance-quote)
+  '(gnucash
+gnc-fq-check
+gnc-fq-helper
+gnc-fq-dump)))
 (inputs
  `((guile ,guile-2.0)
(icu4c ,icu4c)
@@ -56,7 +89,9 @@
(libgnomecanvas ,libgnomecanvas)
(libxml2 ,libxml2)
(libxslt ,libxslt)
-   (webkitgtk ,webkitgtk/gtk+-2)))
+   (webkitgtk ,webkitgtk/gtk+-2)
+   (perl-date-manip ,perl-date-manip)
+   (perl-finance-quote ,perl-finance-quote)))
 (native-inputs
  `((glib ,glib bin) ; glib-compile-schemas, etc.
(intltool ,intltool)
diff --git a/gnu/packages/patches/gnucash-price-quotes-perl.patch 
b/gnu/packages/patches/gnucash-price-quotes-perl.patch
new file mode 100644
index 000..982763f
--- /dev/null
+++ b/gnu/packages/patches/gnucash-price-quotes-perl.patch
@@ -0,0 +1,23 @@
+After wrapping gnc-fq-check and gnc-fq-helper we can no longer execute them
+with perl, so execute them directly instead.
+
+--- gnucash-2.6.6/src/scm/price-quotes.scm.orig2014-04-27 
17:42:28.0 -0500