1 |
commit: a4beea7769ceee4da95127da60dfbae27a127617 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 3 21:29:36 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 3 21:29:36 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4beea77 |
7 |
|
8 |
dev-python/kiwisolver: add Python 3.11 patch |
9 |
|
10 |
Closes: https://bugs.gentoo.org/849563 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../files/kiwisolver-1.4.2-python311.patch | 31 ++++++++++++++++++++++ |
14 |
dev-python/kiwisolver/kiwisolver-1.4.2.ebuild | 4 +++ |
15 |
2 files changed, 35 insertions(+) |
16 |
|
17 |
diff --git a/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch b/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..a03af53a0280 |
20 |
--- /dev/null |
21 |
+++ b/dev-python/kiwisolver/files/kiwisolver-1.4.2-python311.patch |
22 |
@@ -0,0 +1,31 @@ |
23 |
+https://github.com/nucleic/kiwi/commit/f14059f532d6b5c6b505d9803b36a77b75546b18.patch |
24 |
+https://bugs.gentoo.org/849563 |
25 |
+ |
26 |
+From f14059f532d6b5c6b505d9803b36a77b75546b18 Mon Sep 17 00:00:00 2001 |
27 |
+From: Matthieu Dartiailh <m.dartiailh@×××××.com> |
28 |
+Date: Fri, 3 Jun 2022 09:11:18 +0200 |
29 |
+Subject: [PATCH] py: use nullptr instead of 0 in PyTuple_SET_ITEM |
30 |
+ |
31 |
+--- a/py/src/symbolics.h |
32 |
++++ b/py/src/symbolics.h |
33 |
+@@ -123,7 +123,7 @@ PyObject* BinaryMul::operator()( Expression* first, double second ) |
34 |
+ return 0; |
35 |
+ Py_ssize_t end = PyTuple_GET_SIZE( first->terms ); |
36 |
+ for( Py_ssize_t i = 0; i < end; ++i ) // memset 0 for safe error return |
37 |
+- PyTuple_SET_ITEM( terms.get(), i, 0 ); |
38 |
++ PyTuple_SET_ITEM( terms.get(), i, nullptr ); |
39 |
+ for( Py_ssize_t i = 0; i < end; ++i ) |
40 |
+ { |
41 |
+ PyObject* item = PyTuple_GET_ITEM( first->terms, i ); |
42 |
+--- a/py/src/util.h |
43 |
++++ b/py/src/util.h |
44 |
+@@ -117,7 +117,7 @@ make_terms( const std::map<PyObject*, double>& coeffs ) |
45 |
+ return 0; |
46 |
+ Py_ssize_t size = PyTuple_GET_SIZE( terms.get() ); |
47 |
+ for( Py_ssize_t i = 0; i < size; ++i ) // zero tuple for safe early return |
48 |
+- PyTuple_SET_ITEM( terms.get(), i, 0 ); |
49 |
++ PyTuple_SET_ITEM( terms.get(), i, nullptr ); |
50 |
+ Py_ssize_t i = 0; |
51 |
+ iter_t it = coeffs.begin(); |
52 |
+ iter_t end = coeffs.end(); |
53 |
+ |
54 |
|
55 |
diff --git a/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild b/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild |
56 |
index 2f943c1f7e14..e29fa7eee534 100644 |
57 |
--- a/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild |
58 |
+++ b/dev-python/kiwisolver/kiwisolver-1.4.2.ebuild |
59 |
@@ -32,6 +32,10 @@ BDEPEND=" |
60 |
>=dev-python/setuptools_scm-3.4.3[${PYTHON_USEDEP}] |
61 |
" |
62 |
|
63 |
+PATCHES=( |
64 |
+ "${FILESDIR}"/${PN}-1.4.2-python311.patch |
65 |
+) |
66 |
+ |
67 |
distutils_enable_tests pytest |
68 |
|
69 |
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV} |