commit: 91db5c1fa9240759da23fcc19e6a3956c2078bb3 Author: Alfred Wingate <parona <AT> protonmail <DOT> com> AuthorDate: Thu Jul 3 14:01:13 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Jul 4 18:34:58 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91db5c1f
app-office/gnucash: add 5.12 Readd optional keyring use flag. This time with a proper build time switch. See-Also: bc732d0714c3b85133338420bf0c7e85c9b6b4e0 Signed-off-by: Alfred Wingate <parona <AT> protonmail.com> Part-of: https://github.com/gentoo/gentoo/pull/42863 Closes: https://github.com/gentoo/gentoo/pull/42863 Signed-off-by: Sam James <sam <AT> gentoo.org> app-office/gnucash/Manifest | 1 + .../gnucash-5.12-libsecret-build-option.patch | 35 +++ app-office/gnucash/gnucash-5.12.ebuild | 247 +++++++++++++++++++++ 3 files changed, 283 insertions(+) diff --git a/app-office/gnucash/Manifest b/app-office/gnucash/Manifest index f447dc72d830..a29b626995fe 100644 --- a/app-office/gnucash/Manifest +++ b/app-office/gnucash/Manifest @@ -1,2 +1,3 @@ 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 diff --git a/app-office/gnucash/files/gnucash-5.12-libsecret-build-option.patch b/app-office/gnucash/files/gnucash-5.12-libsecret-build-option.patch new file mode 100644 index 000000000000..37bfbde45971 --- /dev/null +++ b/app-office/gnucash/files/gnucash-5.12-libsecret-build-option.patch @@ -0,0 +1,35 @@ +From 42ecd0fb3228f1256c2a84e0c3aaefcae61a8b21 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <[email protected]> +Date: Thu, 3 Jul 2025 17:07:30 +0300 +Subject: [PATCH] Add buildtime switch to control libsecret support + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,6 +61,7 @@ option (WITH_AQBANKING "Build this project with aqbanking (online banking and a + option (WITH_GNUCASH "Build all of GnuCash, not just the library" ON) + option (WITH_OFX "compile with ofx support (needs LibOFX)" ON) + option (WITH_PYTHON "enable python plugin and bindings" OFF) ++option (WITH_LIBSECRET "enable support for libsecret" OFF) + option (ENABLE_BINRELOC "compile with binary relocation support" ON) + option (DISABLE_NLS "do not use Native Language Support" OFF) + option (COVERAGE "Instrument a Debug or Asan build for coverage reporting" OFF) +@@ -564,10 +565,13 @@ find_program(POD2MAN_EXECUTABLE pod2man HINTS ${PERL_DIR}) + #ICU + find_package(ICU 54.0 REQUIRED COMPONENTS uc i18n) + +-pkg_check_modules (LIBSECRET libsecret-1>=0.18) +-IF (LIBSECRET_FOUND) ++IF (WITH_LIBSECRET) ++ pkg_check_modules (LIBSECRET libsecret-1>=0.18) ++ IF (NOT LIBSECRET_FOUND) ++ message(SEND_ERROR "libsecret support enabled, but libsecret not found.") ++ ENDIF (LIBSECRET_FOUND) + SET (HAVE_LIBSECRET ON) +-ENDIF (LIBSECRET_FOUND) ++ENDIF (WITH_LIBSECRET) + + #BOOST + set (Boost_USE_MULTITHREADED ON) +-- +2.50.0 + diff --git a/app-office/gnucash/gnucash-5.12.ebuild b/app-office/gnucash/gnucash-5.12.ebuild new file mode 100644 index 000000000000..444f8a97b0ad --- /dev/null +++ b/app-office/gnucash/gnucash-5.12.ebuild @@ -0,0 +1,247 @@ +# Copyright 1999-2025 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.56.1:2 + >=sys-libs/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.8-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 +}
