commit: d40d73bad5ecd2f4d92b76e4ba5e83bf29a2b74b Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Tue Jun 11 17:27:27 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Jun 11 17:55:18 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d40d73ba
sci-libs/libsigrokdecode: enable py3.13 Signed-off-by: Sam James <sam <AT> gentoo.org> .../files/libsigrokdecode-0.5.3-py3.13.patch | 37 ++++++++++++++++++++++ ...9999.ebuild => libsigrokdecode-0.5.3-r3.ebuild} | 8 +++-- .../libsigrokdecode/libsigrokdecode-9999.ebuild | 4 +-- 3 files changed, 45 insertions(+), 4 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-9999.ebuild b/sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild similarity index 91% copy from sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild copy to sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.ebuild index 384f455def9b..0e58fddc4fb2 100644 --- a/sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild +++ b/sci-libs/libsigrokdecode/libsigrokdecode-0.5.3-r3.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}" @@ -30,6 +30,10 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + "${FILESDIR}"/${P}-py3.13.patch +) + src_prepare() { default 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}"
