public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/gnucash/files/, app-office/gnucash/
Date: Thu, 14 Dec 2023 08:12:41 +0000 (UTC)	[thread overview]
Message-ID: <1702540524.d1e624948a832c4c6518a90ed33d9b5ba4be44f1.sam@gentoo> (raw)

commit:     d1e624948a832c4c6518a90ed33d9b5ba4be44f1
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Dec 14 07:40:14 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 14 07:55:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1e62494

app-office/gnucash: fix python finding

* Also require dev-python/setuptools with python3.12 due to distutils
  getting removed.

Closes: https://bugs.gentoo.org/919859
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34282
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gnucash-5.4-fix-python-finding.patch     | 49 ++++++++++++++++++++++
 .../{gnucash-5.4.ebuild => gnucash-5.4-r1.ebuild}  |  9 ++++
 2 files changed, 58 insertions(+)

diff --git a/app-office/gnucash/files/gnucash-5.4-fix-python-finding.patch b/app-office/gnucash/files/gnucash-5.4-fix-python-finding.patch
new file mode 100644
index 000000000000..26de7a7ad154
--- /dev/null
+++ b/app-office/gnucash/files/gnucash-5.4-fix-python-finding.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/919859
+https://github.com/Gnucash/gnucash/commit/3782eed56785adaca02cf2bd4766d3825a6f6ca7
+
+From 3782eed56785adaca02cf2bd4766d3825a6f6ca7 Mon Sep 17 00:00:00 2001
+From: Simon Arlott <sa.me.uk>
+Date: Wed, 4 Oct 2023 21:15:11 +0100
+Subject: [PATCH] Use the default version of Python 3
+
+Python scripts that run with the default version of Python 3 by executing
+with /usr/bin/python3 that try to import gnucash can't find it if it has
+been built for a different version.
+
+Instead of using other installed versions of Python 3 that happen to be
+present, default to using the default "unversioned" version.
+
+It doesn't look like CMake are going to fix the default behaviour, so every
+project has to do this:
+https://gitlab.kitware.com/cmake/cmake/-/issues/24878
+https://gitlab.kitware.com/cmake/cmake/-/issues/24126
+https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8287
+
+This is only supported on CMake 3.20 or newer, so users of older versions
+will still get the broken behaviour.
+
+Use the newer default Python3_FIND_STRATEGY=LOCATION (CMP0094).
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,6 +2,11 @@
+ 
+ cmake_minimum_required (VERSION 3.14.5)
+ 
++# CMake 3.15+ Python3_FIND_STRATEGY=LOCATION
++if (POLICY CMP0094)
++  cmake_policy(SET CMP0094 NEW)
++endif()
++
+ project (gnucash
+     VERSION 5.4
+ )
+@@ -492,6 +497,9 @@ endif()
+ 
+ if (WITH_PYTHON)
+   set (PYTHON_MIN_VERSION 3.6.0)
++  if (NOT DEFINED Python3_FIND_UNVERSIONED_NAMES)
++    set (Python3_FIND_UNVERSIONED_NAMES FIRST)
++  endif()
+   find_package (Python3 ${PYTHON_MIN_VERSION} COMPONENTS Interpreter Development)
+   if (NOT Python3_FOUND)
+     message(SEND_ERROR "Python support enabled, but Python3 interpreter and/or libaries not found.")

diff --git a/app-office/gnucash/gnucash-5.4.ebuild b/app-office/gnucash/gnucash-5.4-r1.ebuild
similarity index 95%
rename from app-office/gnucash/gnucash-5.4.ebuild
rename to app-office/gnucash/gnucash-5.4-r1.ebuild
index af69f8b7f715..f3e77efe5302 100644
--- a/app-office/gnucash/gnucash-5.4.ebuild
+++ b/app-office/gnucash/gnucash-5.4-r1.ebuild
@@ -90,10 +90,16 @@ DEPEND="
 	sys-devel/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-util/cmake-3.10
 	virtual/pkgconfig
+	python? (
+		$(python_gen_cond_dep '
+			dev-python/setuptools[${PYTHON_USEDEP}]
+		')
+	)
 "
 
 PDEPEND="
@@ -111,6 +117,9 @@ PATCHES=(
 	# This is only to prevent webkit2gtk-4 from being selected.
 	# https://bugs.gentoo.org/893676
 	"${FILESDIR}/${PN}-5.0-webkit2gtk-4.1.patch"
+
+	# bug #919859
+	"${FILESDIR}/${PN}-5.4-fix-python-finding.patch"
 )
 
 # guile generates ELF files without use of C or machine code


             reply	other threads:[~2023-12-14  8:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14  8:12 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-03 18:54 [gentoo-commits] repo/gentoo:master commit in: app-office/gnucash/files/, app-office/gnucash/ David Seifert
2024-11-01 19:13 Andreas K. Hüttel
2023-09-23 21:08 Aaron W. Swenson
2023-03-17 16:03 Sam James
2023-03-16 12:47 Aaron W. Swenson
2022-12-06 12:02 Sam James
2022-12-06 12:02 Sam James
2020-03-28 21:46 Aaron W. Swenson
2019-01-09 13:06 Aaron W. Swenson
2018-02-23 11:26 Aaron Swenson
2018-02-22 11:45 Thomas Deutschmann
2018-01-15 10:37 Aaron Swenson
2016-07-02 10:43 Pacho Ramos
2015-11-11 13:04 Gilles Dartiguelongue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1702540524.d1e624948a832c4c6518a90ed33d9b5ba4be44f1.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox