commit: df33613b0afd21d2f31da90f7094f72c06c39579 Author: Joe Kappus <joe <AT> wt <DOT> gd> AuthorDate: Mon Jan 19 08:45:19 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Jan 20 07:32:02 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df33613b
app-office/gnucash: add 5.14 Closes: https://bugs.gentoo.org/968960 Signed-off-by: Joe Kappus <joe <AT> wt.gd> Part-of: https://github.com/gentoo/gentoo/pull/45439 Signed-off-by: Sam James <sam <AT> gentoo.org> app-office/gnucash/Manifest | 1 + .../files/gnucash-5.14-guile-load-path.patch | 97 ++++++++ app-office/gnucash/gnucash-5.14.ebuild | 247 +++++++++++++++++++++ 3 files changed, 345 insertions(+) diff --git a/app-office/gnucash/Manifest b/app-office/gnucash/Manifest index a29b626995fe..6c4e37553c7e 100644 --- a/app-office/gnucash/Manifest +++ b/app-office/gnucash/Manifest @@ -1,3 +1,4 @@ DIST gnucash-5.10.tar.bz2 15075046 BLAKE2B 343d4a2fee0cdafc42a58d1bcb4e809b7f5fada24eddf210805d81075d6461626b2cbf37c5d0c4d5d758f0ff46ff3812d849b9d177fd34c4f5e890bbebe848b8 SHA512 2ea31ea9dc6d399f168e47fed4b4641207b2a4b9a5e9eac493477a067e8b8a2817e509cb8ea422480c62336fe87cfe6e3e795e5a8b630e8a3d7635adfc64514d DIST gnucash-5.11.tar.bz2 15165344 BLAKE2B e16f7a4f398abb66bf67c56bd046157a58fcc8c0f68231d7a9c3568747dde605f185888a002f4de3773b18737fdc217ca3eae739e705c1c4d73e2d3132899583 SHA512 72e1bdc446a42db004b517bbf775d80f41b28c908691d823312575041f8524978f51b2bb36d026668b3d095b862db26ea9217339a80acc9deed33de22ba98d80 DIST gnucash-5.12.tar.bz2 15209384 BLAKE2B bf873f3cc8755ab9db9bd2b62ace8162c77a42b1ea9749895822d753c36cbdf0c121085cf87fd1e8695f2bcda55cf38d18ddef4c939a22cc180a990c921fd185 SHA512 0984c086a57d1e40c83366025e4cc2c327977f61176c45816e9d42a861869603f11d5284c0ea7ec6876aa283dd1272ea5a9cd8f67804e49cb75e4546ef96e84a +DIST gnucash-5.14.tar.bz2 16406297 BLAKE2B e35ab5872ba8e86f4eafc49144fdd28929f110e810f048133bf94f830de1dcf235c5de3f012d227f1d21de1255156884ac19b4e75e51748ff0c4f1c5e5654092 SHA512 b66fecb47168ae269a0ef03c22d0ebd048b0a249d8e8e61e0dbe60a8d0baf89d203df178452de6ffb7ba588e1b0cff98a2e5bb867915d89ee9b7a33bc64a4082 diff --git a/app-office/gnucash/files/gnucash-5.14-guile-load-path.patch b/app-office/gnucash/files/gnucash-5.14-guile-load-path.patch new file mode 100644 index 000000000000..d733c76967c1 --- /dev/null +++ b/app-office/gnucash/files/gnucash-5.14-guile-load-path.patch @@ -0,0 +1,97 @@ +Updated Sam's patch to patch cleanly for gnucash-5.14, otherwise same logic. + +Signed-off-by: Joe Kappus <[email protected]> + +From 59c0a848aeab5a600f40962b359395e4dca57537 Mon Sep 17 00:00:00 2001 +From: Sam James <[email protected]> +Date: Thu, 26 Dec 2024 09:55:15 +0000 +Subject: [PATCH] Don't use installed copy of gnucash for build or tests + +Per https://www.gnu.org/software/guile/manual/html_node/Foreign-Libraries.html, +newer guile (>= 3.0.6) will respect GUILE_EXTENSIONS_PATH when looking up paths for +`dlopen` for `load-extension` -> `load-foreign-library`. Older guiles will use +`LTDL_LIBRARY_PATH` instead. + +Without this set, the system paths are checked instead (maybe falling back +to another variable if not found on the system, unclear), and we end up +with build failures when we try to mix system and just-built gnucash (this +is also obviously a problem for testing as well). + +For tests, we additionally have to do a "fake install" in ${BUILD_DIR}/whatever +and we set the path to that in the ebuild with GENTOO_TEMPORARY_TEST_INSTALLDIR. + +https://www.gnu.org/software/guile/manual/html_node/Load-Paths.html and +https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html were +also a lot of help. + +(When testing w/ guile-2.2 briefly, it didn't seem that we needed +to set LTDL_LIBRARY_PATH, but someone can add that if it turns out to be +needed, or I may later.) + +(With regard to GUILE_AUTO_COMPILE=0, dropped that as it doesn't seem +necessary. Plan is to also add GUILE_AUTO_COMPILE=fresh to the eclass, +am discussing it w/ Arsen.) + +Bug: https://bugs.gnucash.org/show_bug.cgi?id=799159 +Bug: https://bugs.gentoo.org/359033 +Bug: https://bugs.gentoo.org/371264 +Bug: https://bugs.gentoo.org/734286 +Bug: https://bugs.gentoo.org/946927 +Closes: https://bugs.gentoo.org/941426 +Signed-off-by: Sam James <[email protected]> +--- + common/cmake_modules/GncAddSchemeTargets.cmake | 2 ++ + common/cmake_modules/GncAddTest.cmake | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/common/cmake_modules/GncAddSchemeTargets.cmake b/common/cmake_modules/GncAddSchemeTargets.cmake +index 8e1e361548..c4d977d1d5 100644 +--- a/common/cmake_modules/GncAddSchemeTargets.cmake ++++ b/common/cmake_modules/GncAddSchemeTargets.cmake +@@ -253,6 +253,7 @@ function(gnc_add_scheme_targets _TARGET) + make_win32_path_list(LIBRARY_PATH) + else() + set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{LD_LIBRARY_PATH}") ++ set (GUILE_EXTENSIONS_PATH "GUILE_EXTENSIONS_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{GUILE_EXTENSIONS_PATH}") + endif() + if (APPLE) + set (LIBRARY_PATH "DYLD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{DYLD_LIBRARY_PATH}") +@@ -281,6 +282,7 @@ function(gnc_add_scheme_targets _TARGET) + #We quote the arguments to stop CMake stripping the path separators. + set (GUILE_ENV + "${LIBRARY_PATH}" ++ "${GUILE_EXTENSIONS_PATH}" + "GNC_UNINSTALLED=YES" + "GNC_BUILDDIR=${CMAKE_BINARY_DIR}" + "GUILE_LOAD_PATH=${_GUILE_LOAD_PATH}" +diff --git a/common/cmake_modules/GncAddTest.cmake b/common/cmake_modules/GncAddTest.cmake +index 707e46deeb..1e219b1fbb 100644 +--- a/common/cmake_modules/GncAddTest.cmake ++++ b/common/cmake_modules/GncAddTest.cmake +@@ -26,6 +26,8 @@ function(get_guile_env) + + set(guile_load_paths "$ENV{GUILE_LOAD_PATH}") + list(APPEND guile_load_paths ++ "$ENV{GENTOO_TEMPORARY_TEST_INSTALLDIR}/${GUILE_REL_SITEDIR}" ++ "$ENV{GENTOO_TEMPORARY_TEST_INSTALLDIR}/${GUILE_REL_SITEDIR}/gnucash/deprecated" + "${_relative_site_dir}" + "${_relative_site_dir}/gnucash/deprecated" + ) +@@ -44,6 +46,9 @@ function(get_guile_env) + + set(guile_load_compiled_paths "$ENV{GUILE_LOAD_COMPILED_PATH}") + list(APPEND guile_load_compiled_paths ++ "$ENV{GENTOO_TEMPORARY_TEST_INSTALLDIR}/${GUILE_REL_SITECCACHEDIR}" ++ "$ENV{GENTOO_TEMPORARY_TEST_INSTALLDIR}/${GUILE_REL_SITECCACHEDIR}/gnucash/deprecated" ++ "$ENV{GENTOO_TEMPORARY_TEST_INSTALLDIR}/${GUILE_REL_SITECCACHEDIR}/tests" + "${_relative_cache_dir}" + "${_relative_cache_dir}/gnucash/deprecated" + "${_relative_cache_dir}/tests" +@@ -87,6 +92,7 @@ function(get_guile_env) + list(APPEND _guile_env "DYLD_LIBRARY_PATH=${_gnc_module_path}:$ENV{DYLD_LIBRARY_PATH}") + elseif (UNIX) + list(APPEND _guile_env "LD_LIBRARY_PATH=${_gnc_module_path}:$ENV{LD_LIBRARY_PATH}") ++ list(APPEND env "GUILE_EXTENSIONS_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{GUILE_EXTENSIONS_PATH}") + endif() + set(GUILE_ENV "${_guile_env}" PARENT_SCOPE) + endfunction() diff --git a/app-office/gnucash/gnucash-5.14.ebuild b/app-office/gnucash/gnucash-5.14.ebuild new file mode 100644 index 000000000000..e945fe618925 --- /dev/null +++ b/app-office/gnucash/gnucash-5.14.ebuild @@ -0,0 +1,247 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +GUILE_REQ_USE="regex" +GUILE_COMPAT=( 2-2 3-0 ) +PYTHON_COMPAT=( python3_{11..14} ) + +inherit cmake flag-o-matic gnome2 guile-single python-single-r1 xdg + +# Please bump with app-doc/gnucash-docs +DESCRIPTION="Personal finance manager" +HOMEPAGE="https://www.gnucash.org/" +SRC_URI="https://github.com/Gnucash/gnucash/releases/download/${PV}/${P}.tar.bz2" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv ~x86" +IUSE="aqbanking debug doc examples +gui keyring mysql nls ofx postgres python quotes smartcard sqlite test" +# Tests were previously restricted because guile would try to use installed, +# not just-built modules. See https://bugs.gnucash.org/show_bug.cgi?id=799159#c1. +# TODO: as of 5.10, the ebuild should handle this OK. If no issues come up, +# need to forward those findings (and tidy up the patch for) upstream. +RESTRICT="!test? ( test )" + +# Examples doesn't build unless GUI is also built +REQUIRED_USE=" + ${GUILE_REQUIRED_USE} + examples? ( gui ) + python? ( ${PYTHON_REQUIRED_USE} ) + smartcard? ( aqbanking ) +" + +# dev-libs/boost must always be built with nls enabled. +# net-libs/aqbanking dropped gtk with v6. So, to simplify the +# dependency, we just rely on that. +RDEPEND=" + ${GUILE_DEPS} + >=dev-libs/glib-2.68.1:2 + >=virtual/zlib-1.1.4:= + dev-libs/boost:=[icu,nls] + >=dev-libs/icu-54.0:= + dev-libs/libxml2:2= + dev-libs/libxslt + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/pango + aqbanking? ( + >=net-libs/aqbanking-6[ofx?] + >=sys-libs/gwenhywfar-5.6.0:= + smartcard? ( sys-libs/libchipcard ) + ) + gui? ( + >=x11-libs/gtk+-3.22.30:3 + gnome-base/dconf + net-libs/webkit-gtk:4.1= + aqbanking? ( sys-libs/gwenhywfar:=[gtk] ) + ) + keyring? ( + >=app-crypt/libsecret-0.18 + ) + mysql? ( + dev-db/libdbi + dev-db/libdbi-drivers[mysql] + ) + ofx? ( >=dev-libs/libofx-0.9.12:= ) + postgres? ( + dev-db/libdbi + dev-db/libdbi-drivers[postgres] + ) + python? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/pygobject:3[${PYTHON_USEDEP}] + ') + ) + quotes? ( + >=dev-perl/Finance-Quote-1.11 + dev-perl/JSON-Parse + dev-perl/HTML-TableExtract + ) + sqlite? ( + dev-db/libdbi + dev-db/libdbi-drivers[sqlite] + ) +" + +# gtest is a required dep +# see https://bugs.gnucash.org/show_bug.cgi?id=795250 +DEPEND=" + ${RDEPEND} + >=sys-devel/gettext-0.20 + dev-lang/perl + dev-build/libtool + >=dev-cpp/gtest-1.8.0 +" +# distutils is not available in python3.12, but it is still in setuptools +BDEPEND=" + dev-lang/swig + >=dev-build/cmake-3.10 + dev-libs/libxslt + virtual/pkgconfig + python? ( + $(python_gen_cond_dep ' + dev-python/setuptools[${PYTHON_USEDEP}] + ') + ) +" + +PDEPEND=" + doc? ( + ~app-doc/gnucash-docs-${PV} + gnome-extra/yelp + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-5.0-exclude-license.patch" + "${FILESDIR}/${PN}-5.6-no-werror.patch" + # This is only to prevent webkit2gtk-4 from being selected. + # https://bugs.gentoo.org/893676 + "${FILESDIR}/${PN}-5.0-webkit2gtk-4.1.patch" + "${FILESDIR}/${PN}-5.14-guile-load-path.patch" + "${FILESDIR}/${PN}-5.12-libsecret-build-option.patch" +) + +pkg_setup() { + guile-single_pkg_setup + use python && python-single-r1_pkg_setup +} + +src_prepare() { + cmake_src_prepare + guile_bump_sources + + # ODR violation in libgnucash/engine/test/utest-Account.cpp and libgnucash/engine/test/utest-Split.cpp + # with Fixture struct + use test && filter-lto + + # Fix tests writing to /tmp + local fixtestfiles=( + bindings/python/example_scripts/simple_session.py + bindings/python/sqlite3test.c + bindings/python/example_scripts/simple_test.py + gnucash/report/test/test-report-html.scm + gnucash/report/test/test-report-extras.scm + libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp + ) + local x + for x in "${fixtestfiles[@]}"; do + sed -i -e "s|\"/tmp/|\"${T}/|g" "${S}/${x}" || die "sed of ${S}/${x} failed" + done + + # Skip test that appears to be fickle in the ebuild env + sed -e '/add_core_utils_test(test-userdata-dir-invalid-home test-userdata-dir-invalid-home.c)/d' \ + -i libgnucash/core-utils/test/CMakeLists.txt || die +} + +src_configure() { + # Used in src_test but the value has to be available at `cmake` + # generation time. + export GENTOO_TEMPORARY_TEST_INSTALLDIR="${BUILD_DIR}/test_install" + + local sql_on_off="OFF" + if use mysql || use postgres || use sqlite ; then + sql_on_off="ON" + fi + + local mycmakeargs=( + -DCOMPILE_GSCHEMAS=OFF + -DDISABLE_NLS=$(usex !nls) + -DWITH_AQBANKING=$(usex aqbanking) + -DWITH_GNUCASH=$(usex gui) + -DWITH_OFX=$(usex ofx) + -DWITH_PYTHON=$(usex python) + -DWITH_SQL=${sql_on_off} + -DWITH_LIBSECRET=$(usex keyring) + ) + + cmake_src_configure +} + +src_test() { + LOCALE_TESTS= + if type locale >/dev/null 2>&1; then + MY_LOCALES="$(locale -a)" + if [[ "${MY_LOCALES}" != *en_US* || + "${MY_LOCALES}" != *en_GB* || + "${MY_LOCALES}" != *fr_FR* ]] ; then + ewarn "Missing one or more of en_US, en_GB, or fr_FR locales." + else + LOCALE_TESTS=true + fi + else + ewarn "'locale' not found." + fi + + if [[ ! "${LOCALE_TESTS}" ]]; then + ewarn "Disabling test-qof and test-gnc-numeric." + echo 'set(CTEST_CUSTOM_TESTS_IGNORE test-qof test-gnc-numeric)' \ + > "${BUILD_DIR}"/CTestCustom.cmake || die "Failed to disable test-qof and test-gnc-numeric!" + fi + + cd "${BUILD_DIR}" || die "Failed to enter ${BUILD_DIR}" + + # We need e.g. `options.scm` to be available for loading by tests + # and the compiled `options.go` isn't enough. Do a temporary install + # for the benefit of the testsuite. + DESTDIR="${GENTOO_TEMPORARY_TEST_INSTALLDIR}" cmake_build install + # This is needed for `load-path` to be correct, as it lacks `/usr` in there. + local dir + for dir in bin include "$(get_libdir)" share ; do + ln -s "${GENTOO_TEMPORARY_TEST_INSTALLDIR}/usr/${dir}" "${GENTOO_TEMPORARY_TEST_INSTALLDIR}/${dir}" || die + done + + # Avoid cmake_src_test as we don't get the test binaries built first + # and get various failures as a result. Copy what upstream do in CI. + eninja check +} + +src_install() { + cmake_src_install + guile_unstrip_ccache + + use examples && docompress -x /usr/share/doc/${PF}/examples + + if use python ; then + python_optimize + python_optimize "${ED}"/usr/share/gnucash/python + fi +} + +pkg_preinst() { + gnome2_pkg_preinst + xdg_pkg_preinst +} + +pkg_postinst() { + gnome2_pkg_postinst + xdg_pkg_postinst +} + +pkg_postrm() { + gnome2_pkg_postrm + xdg_pkg_postrm +}
