diff --git a/srcpkgs/python3-sip-PyQt5/patches/00.python3.12.patch b/srcpkgs/python3-sip-PyQt5/patches/00.python3.12.patch new file mode 100644 index 00000000000..f4f48c495b6 --- /dev/null +++ b/srcpkgs/python3-sip-PyQt5/patches/00.python3.12.patch @@ -0,0 +1,32 @@ +https://src.fedoraproject.org/rpms/python-pyqt5-sip/raw/0a67d370b56645efc3f756d89e5a46f7a5927633 + +# HG changeset patch +# User Phil Thompson +# Date 1686925181 -3600 +# Node ID 312476401030130daed2eecfd1c93413f49e4458 +# Parent 88452293f4e4cdc9d22cb5dfca02ba83216f662b +sipMalloc() and sipFree() are now implemented using PyMem_RawMalloc() and +PyMem_RawFree() so that they should be safe to call from functions registered +with Py_AtExit(). + +diff -r 88452293f4e4 -r 312476401030 sipbuild/module/source/12/siplib.c +--- a/siplib.c Thu Jun 08 14:30:02 2023 +0100 ++++ b/siplib.c Fri Jun 16 15:19:41 2023 +0100 +@@ -2147,7 +2147,7 @@ + { + void *mem; + +- if ((mem = PyMem_Malloc(nbytes)) == NULL) ++ if ((mem = PyMem_RawMalloc(nbytes)) == NULL) + PyErr_NoMemory(); + + return mem; +@@ -2159,7 +2159,7 @@ + */ + void sip_api_free(void *mem) + { +- PyMem_Free(mem); ++ PyMem_RawFree(mem); + } + + diff --git a/srcpkgs/python3-sip-PyQt5/patches/01.python3.12.patch b/srcpkgs/python3-sip-PyQt5/patches/01.python3.12.patch new file mode 100644 index 00000000000..9d774ee6104 --- /dev/null +++ b/srcpkgs/python3-sip-PyQt5/patches/01.python3.12.patch @@ -0,0 +1,22 @@ +https://src.fedoraproject.org/rpms/python-pyqt5-sip/raw/5db48dad9dc59835593ff2bfaf06dca2b8a291b6/f/fix-py3.12-subclass-crash.patch + +# HG changeset patch +# User Phil Thompson +# Date 1686926134 -3600 +# Node ID d36867e54192b02ebe5743b48774abf75bd9bb57 +# Parent 312476401030130daed2eecfd1c93413f49e4458 +For Python v3.12 implement sipPyTypeDict() using PyType_GetDict(). + +diff -r 312476401030 -r d36867e54192 sipbuild/siplib.c +--- a/siplib.c Fri Jun 16 15:19:41 2023 +0100 ++++ b/siplib.c Fri Jun 16 15:35:34 2023 +0100 +@@ -12597,7 +12597,11 @@ + */ + static PyObject *sip_api_py_type_dict(const PyTypeObject *py_type) + { ++#if PY_VERSION_HEX >= 0x030c0000 ++ return PyType_GetDict(py_type); ++#else + return py_type->tp_dict; ++#endif + } diff --git a/srcpkgs/python3-sip-PyQt5/template b/srcpkgs/python3-sip-PyQt5/template index 418b0f0a9e0..780096cb803 100644 --- a/srcpkgs/python3-sip-PyQt5/template +++ b/srcpkgs/python3-sip-PyQt5/template @@ -1,7 +1,7 @@ # Template file for 'python3-sip-PyQt5' pkgname=python3-sip-PyQt5 version=12.12.1 -revision=1 +revision=2 build_style=python3-module hostmakedepends="python3-devel python3-setuptools sip" makedepends="python3-devel"