[PATCH 0/6] gnu: gnucash: Fix getting quotes

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 2 months ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
cover.1735912713.git.~@wolfsden.cz
It seems the ability to fetch quotes for stocks and currencies from the
internet has bit-rotten a bit. This series fixed that.

Tomas Volf (6):
gnu: gnucash: Fix locating perl binary.
gnu: gnucash: Do not install gnc-fq-update.
gnu: gnucash: Drop special case for gnc-fq-helper.
gnu: gnucash: Do not wrap finance-quote-wrapper.
gnu: perl-finance-quote: Update to 1.64.
gnu: gnucash: Update to 5.10.

gnu/packages/gnucash.scm | 53 +++++++++++++++++++++++++---------------
gnu/packages/web.scm | 4 +--
2 files changed, 35 insertions(+), 22 deletions(-)

--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 3/6] gnu: gnucash: Drop special case for gnc-fq-helper.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
39c4a175108c42e85f7a282ee108da89bedee14c.1735912713.git.~@wolfsden.cz
The file does not exist since 2022, and date-manip is not required for its
replacement (finance-quote-wrapper).

* gnu/packages/gnucash.scm (gnucash)[arguments]<#:phases>{'wrap-programs}:
Remove special case for gnc-fq-helper.
[inputs]: Remove perl-date-manip.

Change-Id: Id88906df2bda08ae90a9aebb5deef8e4cbae6c76
---
gnu/packages/gnucash.scm | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 7ac7cb0d8f..12a168d6fd 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -146,20 +146,12 @@ (define-public gnucash
,(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 (package-inputs this-package)))
- '("perl-finance-quote"
- "perl-date-manip"))))
- (list
- #$@(transitive-input-references
- 'inputs
- (map (lambda (l)
- (assoc l (package-inputs this-package)))
- '("perl-finance-quote")))))))))
+ (list
+ #$@(transitive-input-references
+ 'inputs
+ (map (lambda (l)
+ (assoc l (package-inputs this-package)))
+ '("perl-finance-quote"))))))))
'("gnucash"))))
(add-after 'install 'glib-or-gtk-compile-schemas
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
@@ -192,7 +184,6 @@ (define-public gnucash
libofx
libxml2
libxslt
- perl-date-manip
perl-finance-quote
perl-json
perl-json-parse
--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 1/6] gnu: gnucash: Fix locating perl binary.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
88e287c3695ef74837fbf106b49019ce75b73e11.1735912713.git.~@wolfsden.cz
It tried to search in the $PATH, that does not really work for Guix.

* gnu/packages/gnucash.scm (gnucash)[arguments]<#:phases>: Add set-perl-path.

Change-Id: I93468c201de8af3ad76cce945483b76f28ea2749
---
gnu/packages/gnucash.scm | 5 +++++
1 file changed, 5 insertions(+)

Toggle diff (18 lines)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 71a49b75d6..6df2b76505 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -102,6 +102,11 @@ (define-public gnucash
(substitute* "CMakeLists.txt"
(("set\\(SHELL /bin/bash\\)")
(string-append "set(SHELL " (which "bash") ")")))))
+ (add-after 'unpack 'set-perl-path
+ (lambda _
+ (substitute* "libgnucash/app-utils/gnc-quotes.cpp"
+ (("c_cmd\\{bp::search_path\\(\"perl\"\\)\\}")
+ (format #f "c_cmd{~s}" #$(file-append perl "/bin/perl"))))))
;; The qof test requires the en_US, en_GB, and fr_FR locales.
(add-before 'check 'install-locales
(lambda _
--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 4/6] gnu: gnucash: Do not wrap finance-quote-wrapper.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
b37c4c05d8df86ae94098e033249cd3ef10038a1.1735912713.git.~@wolfsden.cz
The file needs no special wrapping. Even before, it was wrapped just by
accident (via the glib-or-gtk-wrap phase). Wrapping changes it from perl
script to shell script and gnucash cannot deal with that. So stop wrapping
it.

* gnu/packages/gnucash.scm (gnucash)[arguments]<#:phases>: Add 'unwrap-some.
Wrap gnucash-cli in 'wrap-programs.

Change-Id: I60e7ac5cf40fb00f9620b9ee9d725770009721d2
---
gnu/packages/gnucash.scm | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 12a168d6fd..3f4967b2ef 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -151,8 +151,10 @@ (define-public gnucash
'inputs
(map (lambda (l)
(assoc l (package-inputs this-package)))
- '("perl-finance-quote"))))))))
- '("gnucash"))))
+ '("perl-json-parse"
+ "perl-finance-quote"))))))))
+ '("gnucash"
+ "gnucash-cli"))))
(add-after 'install 'glib-or-gtk-compile-schemas
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
(add-after 'install 'glib-or-gtk-wrap
@@ -161,7 +163,18 @@ (define-public gnucash
(lambda _
;; We are not updating Finance::Quote from CPAN. There is no
;; reason to install this binary.
- (delete-file (string-append #$output "/bin/gnc-fq-update")))))))
+ (delete-file (string-append #$output "/bin/gnc-fq-update"))))
+ (add-after 'glib-or-gtk-wrap 'unwrap-some
+ (lambda _
+ (for-each
+ (lambda (prog)
+ (delete-file (string-append #$output "/bin/" prog))
+ (rename-file (string-append #$output "/bin/." prog "-real")
+ (string-append #$output "/bin/" prog)))
+ ;; Sadly glib-or-gtk-wrap does not allow excluding individual
+ ;; files. Being wrapped breaks the finance-quote-wrapper (it
+ ;; is expected to be a perl script, not a shell one).
+ '("finance-quote-wrapper")))))))
(native-inputs
(list gmp
`(,glib "bin") ;glib-compile-schemas, etc.
--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 2/6] gnu: gnucash: Do not install gnc-fq-update.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
fed9e669d1b9bdce7bb8d55307de4c9bb6893029.1735912713.git.~@wolfsden.cz
This binary is used only for updating Finance::Quote from CPAN. That does not
make sense on Guix, so do not install it.

* gnu/packages/gnucash.scm (gnucash)[arguments]<#:phases>: Add
delete-gnc-fq-update.

Change-Id: I93cf6d67166cce5970d48eea42de0ee5a5a9a8f8
---
gnu/packages/gnucash.scm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 6df2b76505..7ac7cb0d8f 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -160,12 +160,16 @@ (define-public gnucash
(map (lambda (l)
(assoc l (package-inputs this-package)))
'("perl-finance-quote")))))))))
- '("gnucash"
- "gnc-fq-update"))))
+ '("gnucash"))))
(add-after 'install 'glib-or-gtk-compile-schemas
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
(add-after 'install 'glib-or-gtk-wrap
- (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+ (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
+ (add-before 'glib-or-gtk-wrap 'delete-gnc-fq-update
+ (lambda _
+ ;; We are not updating Finance::Quote from CPAN. There is no
+ ;; reason to install this binary.
+ (delete-file (string-append #$output "/bin/gnc-fq-update")))))))
(native-inputs
(list gmp
`(,glib "bin") ;glib-compile-schemas, etc.
--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 6/6] gnu: gnucash: Update to 5.10.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
bf985ffadaaddba4488e5abbc5ac796db9b09ffd.1735912713.git.~@wolfsden.cz
* gnu/packages/gnucash.scm (gnucash): Update to 5.10.
(gnucash-docs): Update hash.

Change-Id: Ic0211b560f9326b40fcec42505fb74ecc61bf32c
---
gnu/packages/gnucash.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 3f4967b2ef..db6a872224 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -66,14 +66,14 @@ (define-public gnucash
;; directory.
(package
(name "gnucash")
- (version "5.9")
+ (version "5.10")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
version "/gnucash-" version ".tar.bz2"))
(sha256
- (base32 "1l1g4acangbf4r27vsvavds0yqqa8smy4s676by68r639wvfbqjv"))))
+ (base32 "14xd0w2afbyk0dzsw9f528722i3p1vhs78vr09r8cnzfk0v9z7bq"))))
(outputs '("out" "doc" "debug" "python"))
(build-system cmake-build-system)
(arguments
@@ -233,7 +233,7 @@ (define gnucash-docs
"mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
version "/gnucash-docs-" version revision ".tar.gz"))
(sha256
- (base32 "1jclya8p005dfwhkx4yqbcml631y4xngl8v08kg33d0ws4mkmi4v"))))
+ (base32 "0hx8gd5xbypbgw1hfnjiyxhkjxpid1qpmvihwlpb803lx9v8jkk0"))))
(build-system cmake-build-system)
;; These are native-inputs because they are only required for building the
;; documentation.
--
2.46.0
Tomas Volf wrote 2 months ago
[PATCH 5/6] gnu: perl-finance-quote: Update to 1.64.
(address . 75317@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
f949e6d9dbcdc42c2af5cf0bf1c2fbc5d3826d78.1735912713.git.~@wolfsden.cz
* gnu/packages/web.scm (perl-finance-quote): Update to 1.64.

Change-Id: Ia7befbfb23a0c2de36cf32ea808b3f83c71349da
---
gnu/packages/web.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 8f816acfd9..7f0d6701f9 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -3546,14 +3546,14 @@ (define-public perl-file-listing
(define-public perl-finance-quote
(package
(name "perl-finance-quote")
- (version "1.59")
+ (version "1.64")
(source
(origin
(method url-fetch)
(uri (string-append "https://cpan.metacpan.org/authors/id/B/BP/BPSCHUCK/"
"Finance-Quote-" version ".tar.gz"))
(sha256
- (base32 "0a19y5bj2pvdlfi747ihgz5khjlfkhjakv712r0gz0n6miwjiscs"))))
+ (base32 "06swiq3c8cdv73nq53wshdvcxzwf2cbiay12dvjjr4as86a7r005"))))
(build-system perl-build-system)
(native-inputs
(list perl-test-harness
--
2.46.0
Ludovic Courtès wrote 2 months ago
Re: [bug#75317] [PATCH 0/6] gnu: gnucash: Fix getting quotes
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 75317-done@debbugs.gnu.org)
87msfmo1f7.fsf@gnu.org
Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (11 lines)
> It seems the ability to fetch quotes for stocks and currencies from the
> internet has bit-rotten a bit. This series fixed that.
>
> Tomas Volf (6):
> gnu: gnucash: Fix locating perl binary.
> gnu: gnucash: Do not install gnc-fq-update.
> gnu: gnucash: Drop special case for gnc-fq-helper.
> gnu: gnucash: Do not wrap finance-quote-wrapper.
> gnu: perl-finance-quote: Update to 1.64.
> gnu: gnucash: Update to 5.10.

Applied, thanks!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 75317@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75317
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help