gnucash: 4.12 -> 5.1

- https://github.com/Gnucash/gnucash/releases/tag/5.0
- https://github.com/Gnucash/gnucash/releases/tag/5.1

Co-authored-by: Anderson Torres <torres.anderson.85@protonmail.com>

authored by Yongun Seong Anderson Torres and committed by Anderson Torres dd3c0085 9df3f0b7

+98 -148
+5 -5
pkgs/applications/office/gnucash/0002-disable-gnc-fq-update.patch
··· 1 diff --git a/libgnucash/quotes/CMakeLists.txt b/libgnucash/quotes/CMakeLists.txt 2 - index b33569d39..fdbfa10a9 100644 3 --- a/libgnucash/quotes/CMakeLists.txt 4 +++ b/libgnucash/quotes/CMakeLists.txt 5 @@ -1,6 +1,6 @@ 6 7 set(_BIN_FILES "") 8 - -foreach(file gnc-fq-check.in gnc-fq-helper.in gnc-fq-update.in gnc-fq-dump.in) 9 - +foreach(file gnc-fq-check.in gnc-fq-helper.in gnc-fq-dump.in) 10 string(REPLACE ".in" "" _OUTPUT_FILE_NAME ${file}) 11 set(_ABS_OUTPUT_FILE ${BINDIR_BUILD}/${_OUTPUT_FILE_NAME}) 12 configure_file( ${file} ${_ABS_OUTPUT_FILE} @ONLY) ··· 14 install(FILES ${_MAN_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 15 install(PROGRAMS ${_BIN_FILES} DESTINATION ${CMAKE_INSTALL_BINDIR}) 16 17 - -set_dist_list(quotes_DIST CMakeLists.txt gnc-fq-check.in gnc-fq-dump.in gnc-fq-helper.in gnc-fq-update.in Quote_example.pl README) 18 - +set_dist_list(quotes_DIST CMakeLists.txt gnc-fq-check.in gnc-fq-dump.in gnc-fq-helper.in Quote_example.pl README)
··· 1 diff --git a/libgnucash/quotes/CMakeLists.txt b/libgnucash/quotes/CMakeLists.txt 2 + index 7e42016629..7211663408 100644 3 --- a/libgnucash/quotes/CMakeLists.txt 4 +++ b/libgnucash/quotes/CMakeLists.txt 5 @@ -1,6 +1,6 @@ 6 7 set(_BIN_FILES "") 8 + -foreach(file gnc-fq-update.in finance-quote-wrapper.in) 9 + +foreach(file finance-quote-wrapper.in) 10 string(REPLACE ".in" "" _OUTPUT_FILE_NAME ${file}) 11 set(_ABS_OUTPUT_FILE ${BINDIR_BUILD}/${_OUTPUT_FILE_NAME}) 12 configure_file( ${file} ${_ABS_OUTPUT_FILE} @ONLY) ··· 14 install(FILES ${_MAN_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 15 install(PROGRAMS ${_BIN_FILES} DESTINATION ${CMAKE_INSTALL_BINDIR}) 16 17 + -set_dist_list(quotes_DIST CMakeLists.txt gnc-fq-update.in finance-quote-wrapper.in README) 18 + +set_dist_list(quotes_DIST CMakeLists.txt finance-quote-wrapper.in README)
+4 -5
pkgs/applications/office/gnucash/0003-remove-valgrind.patch
··· 1 diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt 2 - index 8e6e339d1..3936a8cb6 100644 3 --- a/gnucash/CMakeLists.txt 4 +++ b/gnucash/CMakeLists.txt 5 - @@ -163,13 +163,6 @@ set(GNUCASH_BIN_INSTALL_NAME "gnucash") 6 7 set(VALGRIND_OUTDIR ${BINDIR_BUILD}) 8 ··· 16 ## Create the environment file 17 18 file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/environment.in ENV_STRINGS_IN) 19 - @@ -253,7 +246,6 @@ file(COPY ${ENV_FILE_OUT} 20 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE 21 ) 22 ··· 24 install(FILES ${ENVIRONMENT_FILE_DIR}/environment DESTINATION 25 ${CMAKE_INSTALL_FULL_SYSCONFDIR}/gnucash) 26 27 - @@ -274,7 +266,7 @@ gnc_add_scheme_targets(price-quotes 28 29 set_local_dist(gnucash_DIST_local CMakeLists.txt environment.in generate-gnc-script 30 gnucash.cpp gnucash-commands.cpp gnucash-cli.cpp gnucash-core-app.cpp 31 - gnucash-locale-macos.mm gnucash-locale-windows.c gnucash.rc.in gnucash-valgrind.in 32 + gnucash-locale-macos.mm gnucash-locale-windows.c gnucash.rc.in 33 - gnucash-gresources.xml ${gresource_files} price-quotes.scm 34 ${gnucash_noinst_HEADERS} ${gnucash_EXTRA_DIST}) 35
··· 1 diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt 2 + index 95ff42cd8f..1c1944a811 100644 3 --- a/gnucash/CMakeLists.txt 4 +++ b/gnucash/CMakeLists.txt 5 + @@ -169,13 +169,6 @@ set(GNUCASH_BIN_INSTALL_NAME "gnucash") 6 7 set(VALGRIND_OUTDIR ${BINDIR_BUILD}) 8 ··· 16 ## Create the environment file 17 18 file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/environment.in ENV_STRINGS_IN) 19 + @@ -259,14 +252,13 @@ file(COPY ${ENV_FILE_OUT} 20 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE 21 ) 22 ··· 24 install(FILES ${ENVIRONMENT_FILE_DIR}/environment DESTINATION 25 ${CMAKE_INSTALL_FULL_SYSCONFDIR}/gnucash) 26 27 28 set_local_dist(gnucash_DIST_local CMakeLists.txt environment.in generate-gnc-script 29 gnucash.cpp gnucash-commands.cpp gnucash-cli.cpp gnucash-core-app.cpp 30 - gnucash-locale-macos.mm gnucash-locale-windows.c gnucash.rc.in gnucash-valgrind.in 31 + gnucash-locale-macos.mm gnucash-locale-windows.c gnucash.rc.in 32 + ${gnucash_GRESOURCES} 33 ${gnucash_noinst_HEADERS} ${gnucash_EXTRA_DIST}) 34
-23
pkgs/applications/office/gnucash/0004-exec-fq-helpers.patch
··· 1 - diff --git a/gnucash/price-quotes.scm b/gnucash/price-quotes.scm 2 - index 8e3ff255f..a6b805fa5 100644 3 - --- a/gnucash/price-quotes.scm 4 - +++ b/gnucash/price-quotes.scm 5 - @@ -44,7 +44,7 @@ 6 - (define (start-program) 7 - (set! program 8 - (gnc-spawn-process-async 9 - - (list "perl" "-w" gnc:*finance-quote-check*) #t))) 10 - + (list gnc:*finance-quote-check*) #t))) 11 - 12 - (define (get-sources) 13 - (when program 14 - @@ -119,7 +119,7 @@ 15 - 16 - (define (start-quoter) 17 - (set! quoter 18 - - (gnc-spawn-process-async (list "perl" "-w" gnc:*finance-quote-helper*) #t))) 19 - + (gnc-spawn-process-async (list gnc:*finance-quote-helper*) #t))) 20 - 21 - (define (get-quotes) 22 - (when quoter 23 -
···
+46
pkgs/applications/office/gnucash/0004-exec-fq-wrapper.patch
···
··· 1 + diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp 2 + index 3003fca71f..e01cb10b50 100644 3 + --- a/libgnucash/app-utils/gnc-quotes.cpp 4 + +++ b/libgnucash/app-utils/gnc-quotes.cpp 5 + @@ -122,7 +122,6 @@ private: 6 + 7 + class GncFQQuoteSource final : public GncQuoteSource 8 + { 9 + - const bfs::path c_cmd; 10 + std::string c_fq_wrapper; 11 + std::string m_version; 12 + StrVec m_sources; 13 + @@ -145,7 +144,6 @@ static std::string parse_quotesource_error(const std::string& line); 14 + static const std::string empty_string{}; 15 + 16 + GncFQQuoteSource::GncFQQuoteSource() : 17 + -c_cmd{bp::search_path("perl")}, 18 + m_version{}, m_sources{}, m_api_key{} 19 + { 20 + char *bindir = gnc_path_get_bindir(); 21 + @@ -197,7 +195,7 @@ m_version{}, m_sources{}, m_api_key{} 22 + QuoteResult 23 + GncFQQuoteSource::get_quotes(const std::string& json_str) const 24 + { 25 + - StrVec args{"-w", c_fq_wrapper, "-f" }; 26 + + StrVec args{"-f" }; 27 + return run_cmd(args, json_str); 28 + } 29 + 30 + @@ -215,13 +213,13 @@ GncFQQuoteSource::run_cmd (const StrVec& args, const std::string& json_string) c 31 + auto input_buf = bp::buffer (json_string); 32 + bp::child process; 33 + if (m_api_key.empty()) 34 + - process = bp::child(c_cmd, args, 35 + + process = bp::child(c_fq_wrapper, args, 36 + bp::std_out > out_buf, 37 + bp::std_err > err_buf, 38 + bp::std_in < input_buf, 39 + svc); 40 + else 41 + - process = bp::child(c_cmd, args, 42 + + process = bp::child(c_fq_wrapper, args, 43 + bp::std_out > out_buf, 44 + bp::std_err > err_buf, 45 + bp::std_in < input_buf, 46 +
+31
pkgs/applications/office/gnucash/0005-remove-gncquotes-online-wiggle.patch
···
··· 1 + diff --git a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp 2 + index 8a5221d19d..d14e96cb66 100644 3 + --- a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp 4 + +++ b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp 5 + @@ -153,25 +153,6 @@ TEST_F(GncQuotesTest, quotable_commodities) 6 + EXPECT_EQ(4u, commodities.size()); 7 + } 8 + 9 + -#ifdef HAVE_F_Q 10 + -TEST_F(GncQuotesTest, online_wiggle) 11 + -{ 12 + - GncQuotes quotes; 13 + - quotes.fetch(m_book); 14 + - auto pricedb{gnc_pricedb_get_db(m_book)}; 15 + - auto failures{quotes.failures()}; 16 + - ASSERT_EQ(1u, failures.size()); 17 + - EXPECT_EQ(GncQuoteError::QUOTE_FAILED, std::get<2>(failures[0])); 18 + -// EXPECT_EQ(GncQuoteError::QUOTE_FAILED, std::get<2>(failures[1])); 19 + - EXPECT_EQ(3u, gnc_pricedb_get_num_prices(pricedb)); 20 + -} 21 + -#else 22 + -TEST_F(GncQuotesTest, fq_failure) 23 + -{ 24 + - EXPECT_THROW(GncQuotes quotes;, GncQuoteException); 25 + -} 26 + -#endif 27 + - 28 + TEST_F(GncQuotesTest, offline_wiggle) 29 + { 30 + StrVec quote_vec{ 31 +
+12 -115
pkgs/applications/office/gnucash/default.nix
··· 1 { lib 2 , stdenv 3 - , fetchpatch2 4 , fetchurl 5 , aqbanking 6 , boost ··· 27 28 stdenv.mkDerivation rec { 29 pname = "gnucash"; 30 - version = "4.12"; 31 32 # raw source code doesn't work out of box; fetchFromGitHub not usable 33 src = fetchurl { 34 url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2"; 35 - hash = "sha256-zIwFGla4u0M1ZtbiiQ31nz2JWjlcjPUkbBtygQLOEK4="; 36 }; 37 38 nativeBuildInputs = [ ··· 61 webkitgtk 62 ] 63 ++ (with perlPackages; [ 64 - DateManip 65 FinanceQuote 66 perl 67 ]); ··· 73 ./0002-disable-gnc-fq-update.patch 74 # this patch prevents the building of gnucash-valgrind 75 ./0003-remove-valgrind.patch 76 - # this patch makes gnucash exec the Finance::Quote helpers directly 77 - ./0004-exec-fq-helpers.patch 78 - # the following patches fix compilation with gcc 13 and glib > 2.76 79 - # "Build fails with gcc 13 and glib > 2.76" 80 - (fetchpatch2 { 81 - url = "https://github.com/Gnucash/gnucash/commit/184669f517744ac7be6e420e5e1f359384f676d5.patch"; 82 - sha256 = "sha256-X5HCK//n+V5k/pEUNL6xwZY5NTeGnBt+7GhooqOXQ2I="; 83 - }) 84 - # "Build fails with gcc 13 and glib > 2.76, bis" 85 - (fetchpatch2 { 86 - url = "https://github.com/Gnucash/gnucash/commit/abcce5000ca72bf943ca8951867729942388848e.patch"; 87 - sha256 = "sha256-WiMkozqMAYl5wrRhAQMNVDY77aRBa3E5/a0gvYyc9Zk="; 88 - }) 89 - # "Build fails with gcc 13 and glib > 2.76, ter" 90 - (fetchpatch2 { 91 - url = "https://github.com/Gnucash/gnucash/commit/89e63ef67235d231d242f018894295a6cb38cfc3.patch"; 92 - sha256 = "sha256-xCkY8RlZPVDaRLbVn+QT28s4qIUgtMgjmuB0axSrNpw="; 93 - }) 94 - # "Build fails with gcc 13" 95 - # "Protect against passing an lseek failure rv to read()." 96 - (fetchpatch2 { 97 - url = "https://github.com/Gnucash/gnucash/commit/ce3447e6ea8b2f734b24a2502e865ebbbc21aaaa.patch"; 98 - sha256 = "sha256-mfPs/5rkCamihE0z1SRoX0tV4FNPkKUGd1T6iaCwy7E="; 99 - }) 100 - # "Fix crashes in test-engine on Arch Linux." 101 - # Also fixes the same crashes in nixpkgs. 102 - (fetchpatch2 { 103 - url = "https://github.com/Gnucash/gnucash/commit/1020bde89c77f70cee6cc8181ead96e8fade47aa.patch"; 104 - sha256 = "sha256-JCWm3M8hdgAwjuhLbFRN4Vk3BQqpn0FUwHk6Kg5Qa7Q="; 105 - }) 106 ]; 107 108 # this needs to be an environment variable and not a cmake flag to suppress 109 # guile warning 110 - GUILE_AUTO_COMPILE="0"; 111 112 env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ 113 # Needed with GCC 12 but breaks on darwin (with clang) or older gcc 114 "-Wno-error=use-after-free" 115 ]); 116 117 - # `make check` target does not define its prerequisites but expects them to 118 - # have already been built. The list of targets below was built through trial 119 - # and error based on failing tests. 120 doCheck = true; 121 - preCheck = '' 122 - make \ 123 - test-account-object \ 124 - test-address \ 125 - test-agedver \ 126 - test-app-utils \ 127 - test-aqb \ 128 - test-autoclear \ 129 - test-backend-dbi \ 130 - test-business \ 131 - test-column-types \ 132 - test-commodities \ 133 - test-customer \ 134 - test-dom-converters1 \ 135 - test-dynload \ 136 - test-employee \ 137 - test-engine \ 138 - test-exp-parser \ 139 - test-gnc-glib-utils \ 140 - test-gnc-guid \ 141 - test-gnc-int128 \ 142 - test-gnc-numeric \ 143 - test-gnc-path-util \ 144 - test-gnc-rational \ 145 - test-group-vs-book \ 146 - test-guid \ 147 - test-import-account-matcher \ 148 - test-import-backend \ 149 - test-import-map \ 150 - test-import-parse \ 151 - test-import-pending-matches \ 152 - test-incompatdep \ 153 - test-job \ 154 - test-kvp-frames \ 155 - test-kvp-value \ 156 - test-link-module-tax-us \ 157 - test-link-ofx \ 158 - test-load-backend \ 159 - test-load-c \ 160 - test-load-engine \ 161 - test-load-example-account \ 162 - test-load-xml2 \ 163 - test-lots \ 164 - test-modsysver \ 165 - test-numeric \ 166 - test-object \ 167 - test-print-parse-amount \ 168 - test-qof \ 169 - test-qofquerycore \ 170 - test-qofsession \ 171 - test-query \ 172 - test-querynew \ 173 - test-recurrence \ 174 - test-resolve-file-path \ 175 - test-scm-query \ 176 - test-scm-query-string \ 177 - test-split-register-copy-ops \ 178 - test-split-vs-account \ 179 - test-sqlbe \ 180 - test-string-converters \ 181 - test-sx \ 182 - test-tokenizer \ 183 - test-transaction-reversal \ 184 - test-transaction-voiding \ 185 - test-userdata-dir \ 186 - test-userdata-dir-invalid-home \ 187 - test-vendor \ 188 - test-xml-account \ 189 - test-xml-commodity \ 190 - test-xml-pricedb \ 191 - test-xml-transaction \ 192 - test-xml2-is-file 193 - ''; 194 195 preFixup = '' 196 gappsWrapperArgs+=( ··· 210 postFixup = '' 211 wrapProgram $out/bin/gnucash "''${gappsWrapperArgs[@]}" 212 213 - for file in $out/bin/gnc-fq-check $out/bin/gnc-fq-dump $out/bin/gnc-fq-helper; do 214 - wrapProgram $file \ 215 - --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ DateManip FinanceQuote ]}" 216 - done 217 ''; 218 219 meta = with lib; {
··· 1 { lib 2 , stdenv 3 , fetchurl 4 , aqbanking 5 , boost ··· 26 27 stdenv.mkDerivation rec { 28 pname = "gnucash"; 29 + version = "5.1"; 30 31 # raw source code doesn't work out of box; fetchFromGitHub not usable 32 src = fetchurl { 33 url = "https://github.com/Gnucash/gnucash/releases/download/${version}/${pname}-${version}.tar.bz2"; 34 + hash = "sha256-imWB3ffHQJ22NlEGATUa9yTto2OrWbHV2o2YEDPyb3I="; 35 }; 36 37 nativeBuildInputs = [ ··· 60 webkitgtk 61 ] 62 ++ (with perlPackages; [ 63 + JSONParse 64 FinanceQuote 65 perl 66 ]); ··· 72 ./0002-disable-gnc-fq-update.patch 73 # this patch prevents the building of gnucash-valgrind 74 ./0003-remove-valgrind.patch 75 + # this patch makes gnucash exec the Finance::Quote wrapper directly 76 + ./0004-exec-fq-wrapper.patch 77 + # this patch removes the online_wiggle GncQuotes test 78 + ./0005-remove-gncquotes-online-wiggle.patch 79 ]; 80 81 # this needs to be an environment variable and not a cmake flag to suppress 82 # guile warning 83 + env.GUILE_AUTO_COMPILE = "0"; 84 85 env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ 86 # Needed with GCC 12 but breaks on darwin (with clang) or older gcc 87 "-Wno-error=use-after-free" 88 ]); 89 90 doCheck = true; 91 + enableParallelChecking = true; 92 + checkTarget = "check"; 93 94 preFixup = '' 95 gappsWrapperArgs+=( ··· 109 postFixup = '' 110 wrapProgram $out/bin/gnucash "''${gappsWrapperArgs[@]}" 111 112 + wrapProgram $out/bin/finance-quote-wrapper \ 113 + --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ JSONParse FinanceQuote ]}" 114 ''; 115 116 meta = with lib; {