summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-06-03 22:29:36 +0100
committerSam James <sam@gentoo.org>2022-06-03 22:29:36 +0100
commita4beea7769ceee4da95127da60dfbae27a127617 (patch)
treecea9ee9a7c553d02cbdc2fc0ee4066a9d749af46 /dev-python/kiwisolver
parentapp-portage/g-sorcery: drop 0.2.1-r1 (diff)
downloadgentoo-a4beea7769ceee4da95127da60dfbae27a127617.tar.gz
gentoo-a4beea7769ceee4da95127da60dfbae27a127617.tar.bz2
gentoo-a4beea7769ceee4da95127da60dfbae27a127617.zip
dev-python/kiwisolver: add Python 3.11 patch
Closes: https://bugs.gentoo.org/849563 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/kiwisolver')
-rw-r--r--dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch31
-rw-r--r--dev-python/kiwisolver/kiwisolver-1.4.2.ebuild4
2 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch b/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch
new file mode 100644
index 000000000000..a03af53a0280
--- /dev/null
+++ b/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch
@@ -0,0 +1,31 @@
+https://github.com/nucleic/kiwi/commit/f14059f532d6b5c6b505d9803b36a77b75546b18.patch
+https://bugs.gentoo.org/849563
+
+From f14059f532d6b5c6b505d9803b36a77b75546b18 Mon Sep 17 00:00:00 2001
+From: Matthieu Dartiailh <m.dartiailh@gmail.com>
+Date: Fri, 3 Jun 2022 09:11:18 +0200
+Subject: [PATCH] py: use nullptr instead of 0 in PyTuple_SET_ITEM
+
+--- a/py/src/symbolics.h
++++ b/py/src/symbolics.h
+@@ -123,7 +123,7 @@ PyObject* BinaryMul::operator()( Expression* first, double second )
+ return 0;
+ Py_ssize_t end = PyTuple_GET_SIZE( first->terms );
+ for( Py_ssize_t i = 0; i < end; ++i ) // memset 0 for safe error return
+- PyTuple_SET_ITEM( terms.get(), i, 0 );
++ PyTuple_SET_ITEM( terms.get(), i, nullptr );
+ for( Py_ssize_t i = 0; i < end; ++i )
+ {
+ PyObject* item = PyTuple_GET_ITEM( first->terms, i );
+--- a/py/src/util.h
++++ b/py/src/util.h
+@@ -117,7 +117,7 @@ make_terms( const std::map<PyObject*, double>& coeffs )
+ return 0;
+ Py_ssize_t size = PyTuple_GET_SIZE( terms.get() );
+ for( Py_ssize_t i = 0; i < size; ++i ) // zero tuple for safe early return
+- PyTuple_SET_ITEM( terms.get(), i, 0 );
++ PyTuple_SET_ITEM( terms.get(), i, nullptr );
+ Py_ssize_t i = 0;
+ iter_t it = coeffs.begin();
+ iter_t end = coeffs.end();
+
diff --git a/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild b/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild
index 2f943c1f7e14..e29fa7eee534 100644
--- a/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild
+++ b/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild
@@ -32,6 +32,10 @@ BDEPEND="
>=dev-python/setuptools_scm-3.4.3[${PYTHON_USEDEP}]
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.2-python311.patch
+)
+
distutils_enable_tests pytest
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}