summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-06-11 18:27:27 +0100
committerSam James <sam@gentoo.org>2024-06-11 18:55:18 +0100
commitd40d73bad5ecd2f4d92b76e4ba5e83bf29a2b74b (patch)
tree73a88c58ed78d54416f15967072b38cf85df3351 /sci-libs
parentdev-libs/tree-sitter-query: update DESCRIPTION (diff)
downloadgentoo-d40d73bad5ecd2f4d92b76e4ba5e83bf29a2b74b.tar.gz
gentoo-d40d73bad5ecd2f4d92b76e4ba5e83bf29a2b74b.tar.bz2
gentoo-d40d73bad5ecd2f4d92b76e4ba5e83bf29a2b74b.zip
sci-libs/libsigrokdecode: enable py3.13
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/libsigrokdecode/files/libsigrokdecode-0.5.3-py3.13.patch37
-rw-r--r--sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild58
-rw-r--r--sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild4
3 files changed, 97 insertions, 2 deletions
diff --git a/sci-libs/libsigrokdecode/files/libsigrokdecode-0.5.3-py3.13.patch b/sci-libs/libsigrokdecode/files/libsigrokdecode-0.5.3-py3.13.patch
new file mode 100644
index 000000000000..89078b3ba70e
--- /dev/null
+++ b/sci-libs/libsigrokdecode/files/libsigrokdecode-0.5.3-py3.13.patch
@@ -0,0 +1,37 @@
+http://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff;h=0c35c5c5845d05e5f624c99d58af992d2f004446
+
+From: Sascha Silbe <redacted>
+Date: Mon, 23 Oct 2023 20:21:38 +0000 (+0200)
+Subject: srd: drop deprecated PyEval_InitThreads() on Python 3.9+
+X-Git-Url: http://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=0c35c5c5845d05e5f624c99d58af992d2f004446
+
+srd: drop deprecated PyEval_InitThreads() on Python 3.9+
+
+`PyEval_InitThreads()` is called implicitly during `Py_InitializeEx()`
+since Python 3.7. It has been deprecated since 3.9 and dropped in
+3.13.
+
+[ gsi: touch up comment style ]
+---
+
+diff --git a/srd.c b/srd.c
+index 35ec5f2..10dfaf6 100644
+--- a/srd.c
++++ b/srd.c
+@@ -302,8 +302,14 @@ SRD_API int srd_init(const char *path)
+ g_strfreev(dir_list);
+ }
+
+- /* Initialize the Python GIL (this also happens to acquire it). */
++#if PY_VERSION_HEX < 0x03090000
++ /*
++ * Initialize and acquire the Python GIL. In Python 3.7+ this
++ * will be done implicitly as part of the Py_InitializeEx()
++ * call above. PyEval_InitThreads() was deprecated in 3.9.
++ */
+ PyEval_InitThreads();
++#endif
+
+ /* Release the GIL (ignore return value, we don't need it here). */
+ (void)PyEval_SaveThread();
+
diff --git a/sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild b/sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild
new file mode 100644
index 000000000000..0e58fddc4fb2
--- /dev/null
+++ b/sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{10..13} )
+inherit autotools python-single-r1
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="git://sigrok.org/${PN}"
+ inherit git-r3
+else
+ SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Provide (streaming) protocol decoding functionality"
+HOMEPAGE="https://sigrok.org/wiki/Libsigrokdecode"
+
+LICENSE="GPL-3"
+SLOT="0/4"
+IUSE="static-libs"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ >=dev-libs/glib-2.34.0
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-py3.13.patch
+)
+
+src_prepare() {
+ default
+
+ # bug #794592
+ sed -i -e "s/\[SRD_PKGLIBS\],\$/& [python-${EPYTHON#python}-embed], [python-${EPYTHON#python}],/" configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static) PYTHON3="${PYTHON}"
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+ python_optimize "${D}"/usr/share/libsigrokdecode/decoders
+ find "${D}" -name '*.la' -type f -delete || die
+}
diff --git a/sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild b/sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild
index 384f455def9b..193ac833026d 100644
--- a/sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild
+++ b/sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild
@@ -3,7 +3,7 @@
EAPI="8"
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
inherit autotools python-single-r1
if [[ ${PV} == *9999* ]]; then
@@ -18,7 +18,7 @@ DESCRIPTION="Provide (streaming) protocol decoding functionality"
HOMEPAGE="https://sigrok.org/wiki/Libsigrokdecode"
LICENSE="GPL-3"
-SLOT="0/9999"
+SLOT="0/4"
IUSE="static-libs"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"