dev-libs/Ice: enable py3.13, py3.14

Closes: https://bugs.gentoo.org/952300
Signed-off-by: Robert Förster <Dessa@gmake.de>
Part-of: https://github.com/gentoo/gentoo/pull/43081
Closes: https://github.com/gentoo/gentoo/pull/43081
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Robert Förster 2025-07-20 16:48:00 +02:00 committed by Sam James
parent 61d9fec9f5
commit 4e606a23bd
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
3 changed files with 106 additions and 8 deletions

View File

@ -3,7 +3,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
PYTHON_COMPAT=( python3_{11..14} )
RUBY_OPTIONAL="yes"
USE_RUBY="ruby32"
@ -14,14 +14,15 @@ PHP_EXT_ZENDEXT="no"
PHP_EXT_OPTIONAL_USE=php
USE_PHP="php8-2 php8-3"
USE_PHP="php8-2 php8-3 php8-4"
inherit php-ext-source-r3 python-r1 ruby-ng toolchain-funcs
DESCRIPTION="ICE middleware C++ library and generator tools"
HOMEPAGE="https://zeroc.com/products/ice"
HOMEPAGE="https://zeroc.com/ice"
SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
doc? ( https://download.zeroc.com/Ice/$(ver_cut 1-2)/${PN}-3.7.1.pdf )"
S="${WORKDIR}/${P,}"
LICENSE="GPL-2"
SLOT="0/37"
KEYWORDS="amd64 ~arm ~arm64 x86"
@ -47,11 +48,11 @@ DEPEND="${RDEPEND}
# Maintainer notes:
# TODO: java bindings
S="${WORKDIR}/${P,}"
PHP_EXT_S="${S}/php"
PATCHES=(
"${FILESDIR}/${PN}-3.7.8-fix-musl-build.patch"
"${FILESDIR}/${PN}-3.7.8-python3.13.patch"
)
pkg_setup() {

View File

@ -3,7 +3,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
PYTHON_COMPAT=( python3_{11..14} )
RUBY_OPTIONAL="yes"
USE_RUBY="ruby33"
@ -14,14 +14,15 @@ PHP_EXT_ZENDEXT="no"
PHP_EXT_OPTIONAL_USE=php
USE_PHP="php8-2 php8-3"
USE_PHP="php8-2 php8-3 php8-4"
inherit php-ext-source-r3 python-r1 ruby-ng toolchain-funcs
DESCRIPTION="ICE middleware C++ library and generator tools"
HOMEPAGE="https://zeroc.com/products/ice"
HOMEPAGE="https://zeroc.com/ice"
SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
doc? ( https://download.zeroc.com/Ice/$(ver_cut 1-2)/${PN}-3.7.1.pdf )"
S="${WORKDIR}/${P,}"
LICENSE="GPL-2"
SLOT="0/37"
KEYWORDS="amd64 ~arm ~arm64 x86"
@ -47,11 +48,11 @@ DEPEND="${RDEPEND}
# Maintainer notes:
# TODO: java bindings
S="${WORKDIR}/${P,}"
PHP_EXT_S="${S}/php"
PATCHES=(
"${FILESDIR}/${PN}-3.7.8-fix-musl-build.patch"
"${FILESDIR}/${PN}-3.7.8-python3.13.patch"
)
pkg_setup() {

View File

@ -0,0 +1,96 @@
Description: Python 3.13 build fixes
Author: Jose <jose@zeroc.com>
Origin: backport
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092441
Applied-Upstream: https://github.com/zeroc-ice/ice/commit/019976e2db4899a5ac30f497aa45b51335b024ec
Reviewed-by: Simon Quigley <tsimonq2@debian.org>
Last-Update: 2025-02-24
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/python/modules/IcePy/Types.cpp
+++ b/python/modules/IcePy/Types.cpp
@@ -455,14 +455,7 @@ IcePy::StreamUtil::setSlicedDataMember(P
assert(_sliceInfoType);
}
- IcePy::PyObjectHandle args = PyTuple_New(0);
- if(!args.get())
- {
- assert(PyErr_Occurred());
- throw AbortMarshaling();
- }
-
- PyObjectHandle sd = PyEval_CallObject(_slicedDataType, args.get());
+ PyObjectHandle sd{PyObject_CallObject(_slicedDataType, nullptr)};
if(!sd.get())
{
assert(PyErr_Occurred());
@@ -488,7 +481,7 @@ IcePy::StreamUtil::setSlicedDataMember(P
int i = 0;
for(vector<Ice::SliceInfoPtr>::const_iterator p = slicedData->slices.begin(); p != slicedData->slices.end(); ++p)
{
- PyObjectHandle slice = PyEval_CallObject(_sliceInfoType, args.get());
+ PyObjectHandle slice{PyObject_CallObject(_sliceInfoType, nullptr)};
if(!slice.get())
{
assert(PyErr_Occurred());
@@ -1669,18 +1662,17 @@ IcePy::SequenceInfo::marshal(PyObject* p
Py_ssize_t sz = 0;
if(p != Py_None)
{
- const void* buf = 0;
- if(PyObject_AsReadBuffer(p, &buf, &sz) == 0)
+ Py_buffer pybuf;
+ if (pi && PyObject_GetBuffer(p, &pybuf, PyBUF_SIMPLE | PyBUF_FORMAT) == 0)
{
- if(pi->kind == PrimitiveInfo::KindString)
- {
- PyErr_Format(PyExc_ValueError, STRCAST("expected sequence value"));
- throw AbortMarshaling();
- }
+ // Strings are handled as variable length types above.
+ assert(pi->kind != PrimitiveInfo::KindString);
+ sz = pybuf.len;
+ PyBuffer_Release(&pybuf);
}
else
{
- PyErr_Clear(); // PyObject_AsReadBuffer sets an exception on failure.
+ PyErr_Clear(); // PyObject_GetBuffer sets an exception on failure.
PyObjectHandle fs;
if(pi)
@@ -1906,7 +1898,7 @@ IcePy::SequenceInfo::marshalPrimitiveSeq
if(pi->kind != PrimitiveInfo::KindString)
{
//
- // With Python 3 and greater we marshal sequences of pritive types using the new
+ // With Python 3 and greater we marshal sequences of primitive types using the new
// buffer protocol when possible, for older versions we use the old buffer protocol.
//
#if PY_VERSION_HEX >= 0x03000000
@@ -2030,7 +2022,7 @@ IcePy::SequenceInfo::marshalPrimitiveSeq
}
else
{
- PyErr_Clear(); // PyObject_GetBuffer/PyObject_AsReadBuffer sets an exception on failure.
+ PyErr_Clear(); // PyObject_GetBuffer sets an exception on failure.
}
}
--- a/python/modules/IcePy/Util.cpp
+++ b/python/modules/IcePy/Util.cpp
@@ -729,12 +729,7 @@ PyObject*
IcePy::createExceptionInstance(PyObject* type)
{
assert(PyExceptionClass_Check(type));
- IcePy::PyObjectHandle args = PyTuple_New(0);
- if(!args.get())
- {
- return 0;
- }
- return PyEval_CallObject(type, args.get());
+ return PyObject_CallObject(type, nullptr);
}
static void