From af338f8ea2ed3d9c1603128ad9c56630d8937077 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 19 Sep 2022 21:08:03 -0400 Subject: [PATCH] shiboken2: rebuild for Python 3.11 --- srcpkgs/shiboken2/patches/python-3.11.patch | 56 --------------------- srcpkgs/shiboken2/patches/python3.11.patch | 1 + srcpkgs/shiboken2/template | 2 +- 3 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 srcpkgs/shiboken2/patches/python-3.11.patch create mode 120000 srcpkgs/shiboken2/patches/python3.11.patch diff --git a/srcpkgs/shiboken2/patches/python-3.11.patch b/srcpkgs/shiboken2/patches/python-3.11.patch deleted file mode 100644 index 2520f17a0c5..00000000000 --- a/srcpkgs/shiboken2/patches/python-3.11.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/sources/shiboken2/libshiboken/basewrapper.cpp -+++ b/sources/shiboken2/libshiboken/basewrapper.cpp -@@ -64,6 +64,12 @@ - #include - #endif - -+#if PY_VERSION_HEX < 0x03090000 -+void Py_SET_TYPE(PyObject *o, PyTypeObject *type) { -+ Py_TYPE(o) = type; -+} -+#endif -+ - namespace { - void _destroyParentInfo(SbkObject *obj, bool keepReference); - } -@@ -377,7 +383,7 @@ SbkObjectType *SbkObject_TypeF(void) - static PyTypeObject *type = nullptr; - if (!type) { - type = reinterpret_cast(SbkType_FromSpec(&SbkObject_Type_spec)); -- Py_TYPE(type) = SbkObjectType_TypeF(); -+ Py_SET_TYPE(type, SbkObjectType_TypeF()); - Py_INCREF(Py_TYPE(type)); - type->tp_weaklistoffset = offsetof(SbkObject, weakreflist); - type->tp_dictoffset = offsetof(SbkObject, ob_dict); -@@ -1152,7 +1158,7 @@ introduceWrapperType(PyObject *enclosing - typeSpec->slots[0].pfunc = reinterpret_cast(baseType ? baseType : SbkObject_TypeF()); - - PyObject *heaptype = SbkType_FromSpecWithBases(typeSpec, baseTypes); -- Py_TYPE(heaptype) = SbkObjectType_TypeF(); -+ Py_SET_TYPE(heaptype, SbkObjectType_TypeF()); - Py_INCREF(Py_TYPE(heaptype)); - auto *type = reinterpret_cast(heaptype); - #if PY_VERSION_HEX < 0x03000000 ---- a/sources/shiboken2/libshiboken/sbkenum.cpp -+++ b/sources/shiboken2/libshiboken/sbkenum.cpp -@@ -55,6 +55,11 @@ - #define SbkEnumType_Check(o) (Py_TYPE(Py_TYPE(o)) == SbkEnumType_TypeF()) - typedef PyObject *(*enum_func)(PyObject *, PyObject *); - -+#if PY_VERSION_HEX < 0x03090000 -+void Py_SET_TYPE(PyObject *o, PyTypeObject *type) { -+ Py_TYPE(o) = type; -+} -+#endif - extern "C" - { - -@@ -753,7 +758,7 @@ newTypeWithName(const char *name, - PyTuple_SetItem(bases, 0, reinterpret_cast(basetype)); - auto *type = reinterpret_cast(SbkType_FromSpecWithBases(&newspec, bases)); - PyErr_Print(); -- Py_TYPE(type) = SbkEnumType_TypeF(); -+ Py_SET_TYPE(type, SbkEnumType_TypeF()); - - auto *enumType = reinterpret_cast(type); - PepType_SETP(enumType)->cppName = cppName; diff --git a/srcpkgs/shiboken2/patches/python3.11.patch b/srcpkgs/shiboken2/patches/python3.11.patch new file mode 120000 index 00000000000..6861da6ece5 --- /dev/null +++ b/srcpkgs/shiboken2/patches/python3.11.patch @@ -0,0 +1 @@ +../../python3-pyside2/patches/python3.11.patch \ No newline at end of file diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template index d0335b22bf5..1205266c5a7 100644 --- a/srcpkgs/shiboken2/template +++ b/srcpkgs/shiboken2/template @@ -1,7 +1,7 @@ # Template file for 'shiboken2' pkgname=shiboken2 version=5.15.5 -revision=1 +revision=2 _pkgname="pyside-setup-opensource-src-${version}" wrksrc="${_pkgname/%5.14.2.1/5.14.2}" build_wrksrc="sources/shiboken2"