From 138fd32a01786c0dafa99f9291753282cf7bd8ed Mon Sep 17 00:00:00 2001 From: Yongun Seong Date: Tue, 1 Oct 2024 00:01:05 +0900 Subject: [PATCH] gnucash: 5.8 -> 5.9 - Diff: https://github.com/Gnucash/gnucash/compare/5.8...5.9 - Update exec-fq-wrapper patch to apply cleanly - Remove test-lots patch, fixed upstream - Add patch to fix gnucash-cli -Q dump, remove on next release --- .../gn/gnucash/0004-exec-fq-wrapper.patch | 35 +++++++------------ .../gn/gnucash/0005-disable-test-lots.patch | 11 ------ pkgs/by-name/gn/gnucash/package.nix | 16 +++++---- 3 files changed, 23 insertions(+), 39 deletions(-) delete mode 100644 pkgs/by-name/gn/gnucash/0005-disable-test-lots.patch diff --git a/pkgs/by-name/gn/gnucash/0004-exec-fq-wrapper.patch b/pkgs/by-name/gn/gnucash/0004-exec-fq-wrapper.patch index 8b00b275e59c..fdd856644bad 100644 --- a/pkgs/by-name/gn/gnucash/0004-exec-fq-wrapper.patch +++ b/pkgs/by-name/gn/gnucash/0004-exec-fq-wrapper.patch @@ -1,6 +1,6 @@ ---- a/libgnucash/app-utils/gnc-quotes.cpp 2023-09-23 07:04:21.000000000 +0900 -+++ b/libgnucash/app-utils/gnc-quotes.cpp 2023-09-25 11:58:46.482696433 +0900 -@@ -125,7 +125,6 @@ +--- a/libgnucash/app-utils/gnc-quotes.cpp 2023-09-23 07:04:21.000000000 +0900 ++++ b/libgnucash/app-utils/gnc-quotes.cpp 2023-09-25 11:58:46.482696433 +0900 +@@ -129,7 +129,6 @@ class GncFQQuoteSource final : public GncQuoteSource { @@ -8,12 +8,12 @@ std::string c_fq_wrapper; std::string m_version; StrVec m_sources; -@@ -148,13 +147,12 @@ +@@ -152,13 +151,12 @@ static const std::string empty_string{}; GncFQQuoteSource::GncFQQuoteSource() : -c_cmd{bp::search_path("perl")}, - m_version{}, m_sources{}, m_api_key{} + m_version{}, m_sources{}, m_env{boost::this_process::environment()} { char *bindir = gnc_path_get_bindir(); c_fq_wrapper = std::string(bindir) + "/finance-quote-wrapper"; @@ -23,7 +23,7 @@ auto [rv, sources, errors] = run_cmd(args, empty_string); if (rv) { -@@ -200,7 +198,7 @@ +@@ -192,7 +190,7 @@ QuoteResult GncFQQuoteSource::get_quotes(const std::string& json_str) const { @@ -32,21 +32,12 @@ return run_cmd(args, json_str); } -@@ -218,7 +216,7 @@ +@@ -209,7 +207,7 @@ + auto input_buf = bp::buffer (json_string); bp::child process; - if (m_api_key.empty()) -- process = bp::child(c_cmd, args, -+ process = bp::child(c_fq_wrapper, args, - bp::std_out > out_buf, - bp::std_err > err_buf, - bp::std_in < input_buf, -@@ -227,7 +225,7 @@ - #endif - svc); - else -- process = bp::child(c_cmd, args, -+ process = bp::child(c_fq_wrapper, args, - bp::std_out > out_buf, - bp::std_err > err_buf, - bp::std_in < input_buf, +- process = bp::child(c_cmd, args, ++ process = bp::child(c_fq_wrapper, args, + bp::std_out > out_buf, + bp::std_err > err_buf, + bp::std_in < input_buf, diff --git a/pkgs/by-name/gn/gnucash/0005-disable-test-lots.patch b/pkgs/by-name/gn/gnucash/0005-disable-test-lots.patch deleted file mode 100644 index c7418b7b88b9..000000000000 --- a/pkgs/by-name/gn/gnucash/0005-disable-test-lots.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgnucash/engine/test/CMakeLists.txt 2024-02-23 09:05:19.000000000 +0900 -+++ b/libgnucash/engine/test/CMakeLists.txt 2024-05-08 22:08:04.572060359 +0900 -@@ -57,7 +57,6 @@ - - add_engine_test(test-account-object test-account-object.cpp) - add_engine_test(test-group-vs-book test-group-vs-book.cpp) --add_engine_test(test-lots test-lots.cpp) - add_engine_test(test-querynew test-querynew.c) - add_engine_test(test-query test-query.cpp) - add_engine_test(test-split-vs-account test-split-vs-account.cpp) - diff --git a/pkgs/by-name/gn/gnucash/package.nix b/pkgs/by-name/gn/gnucash/package.nix index c51fe700573f..9f7ca7364604 100644 --- a/pkgs/by-name/gn/gnucash/package.nix +++ b/pkgs/by-name/gn/gnucash/package.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , fetchurl +, fetchpatch2 , aqbanking , boost , cmake @@ -27,12 +28,12 @@ stdenv.mkDerivation rec { pname = "gnucash"; - version = "5.8"; + version = "5.9"; # raw source code doesn't work out of box; fetchFromGitHub not usable src = fetchurl { url = "https://github.com/Gnucash/gnucash/releases/download/${version}/gnucash-${version}.tar.bz2"; - hash = "sha256-osgj+3ALnUWYaS7IE5SVm944jY7xke/k6iwCQmu1JZM="; + hash = "sha256-W+LlNk/DZGT8Msdo4qtGCmMPdNtq631EJm49q5giL9A="; }; nativeBuildInputs = [ @@ -75,9 +76,12 @@ stdenv.mkDerivation rec { ./0003-remove-valgrind.patch # this patch makes gnucash exec the Finance::Quote wrapper directly ./0004-exec-fq-wrapper.patch - # this patch disables a flaky test - # see https://bugs.gnucash.org/show_bug.cgi?id=799289 - ./0005-disable-test-lots.patch + # this patch fixes gnucah-cli -Q dump, remove on next release + (fetchpatch2 { + name = "0005-fix-quote-report.patch"; + url = "https://github.com/Gnucash/gnucash/commit/711554ecd5505004aee4808519d9d8e4e4ed7c9a.patch?full_index=1"; + hash = "sha256-uRaUdSJu2LnYVp/3DqrK0rTnCpr7oZRtrgTPbKAHThk="; + }) ]; # this needs to be an environment variable and not a cmake flag to suppress @@ -101,7 +105,7 @@ stdenv.mkDerivation rec { owner = "Gnucash"; repo = "gnucash-docs"; rev = version; - hash = "sha256-3b1Nue3eEefDi4WI+o3ATfrsQ+H/I+QwTr4Nuc9J7Zg="; + hash = "sha256-uXpIAsucVUaAlqYTKfrfBg04Kb5Mza67l0ZU6fxkSUY="; }; nativeBuildInputs = [ cmake ];