diff options
author | psykose <alice@ayaya.dev> | 2022-11-23 08:45:53 +0000 |
---|---|---|
committer | psykose <alice@ayaya.dev> | 2022-11-23 09:45:53 +0100 |
commit | 0c5ec621aba277dd92e14863013a86689b47057f (patch) | |
tree | 5149b1e1f7c14e918ce14b1b71b4099eb4b66a09 | |
parent | 3972202e0485054e3951217d4f29da731aff4288 (diff) |
community/py3-pyside2: upgrade to 5.15.7
-rw-r--r-- | community/py3-pyside2/APKBUILD | 8 | ||||
-rw-r--r-- | community/py3-pyside2/py3.11.patch | 161 |
2 files changed, 166 insertions, 3 deletions
diff --git a/community/py3-pyside2/APKBUILD b/community/py3-pyside2/APKBUILD index 77e89892105..165cbb9a9e5 100644 --- a/community/py3-pyside2/APKBUILD +++ b/community/py3-pyside2/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Luca Weiss <luca@z3ntu.xyz> pkgname=py3-pyside2 -pkgver=5.15.6 -pkgrel=1 +pkgver=5.15.7 +pkgrel=0 pkgdesc="Enables the use of Qt5 APIs in Python applications" url="https://doc.qt.io/qtforpython-5/" # armhf blocked by shiboken2 @@ -48,6 +48,7 @@ source=" http://mirrors.ukfast.co.uk/sites/qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/pyside-setup-opensource-src-$pkgver.tar.xz machinery.patch arm-gles2.patch + py3.11.patch " builddir="$srcdir/pyside-setup-opensource-src-$pkgver" options="!check" # Tests fail @@ -74,7 +75,8 @@ package() { } sha512sums=" -99a0c1a05e722cbf33128cf25742e61b92e151fdc05b79db9bafe778e024a0c6fc2886ee3d0b923ff681c55916f5c0eea4197f174432587fd662fba4390b26f4 pyside-setup-opensource-src-5.15.6.tar.xz +9c551b47581e4f2671c4378f1a2c0d9e565b08edee74244a7704a2c94eef1e1041d23f0e388c07bdd61067e986340907cf80f4527257a9a706f7f07c497834c6 pyside-setup-opensource-src-5.15.7.tar.xz 5d45068accc785dc5b2476b68cd8f5de5557ff1c57bfcfc3441545a4d80f98d0c6a38169573060b76a5f9a9b18df5751c565f192af16adbd0c08a89c77006063 machinery.patch 0d00032e463485adb0377c07d3e47d04f0e5618cc9028a60a989709c3221c1e16681f8252515909eb2b7086fbcc65dd8e642a82f749ff0f9643a7f5e966824d5 arm-gles2.patch +bda0bbf74ed639f4af40322883c65ede03cc0cde46382e9237215e0250ee1a858642e721112fb4ba92bbfb54aed8a2b97dc6dc71734665bbc52e8002ac915bfd py3.11.patch " diff --git a/community/py3-pyside2/py3.11.patch b/community/py3-pyside2/py3.11.patch new file mode 100644 index 00000000000..6469ea74d73 --- /dev/null +++ b/community/py3-pyside2/py3.11.patch @@ -0,0 +1,161 @@ +From b64ad27d8dfeeecaaa8a98051252a32c9d998df4 Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint <Friedemann.Kleint@qt.io> +Date: Thu, 9 Jun 2022 16:50:41 +0200 +Subject: [PATCH] libshiboken: Fix a crash in Shiboken::Object::isValid() for + Python 3.11 + +The function is passed type objects for class methods, which caused +it to crash. + +The first clause did not catch this, and so it was cast to SbkObject +below. + +Add a type check to prevent this. + +Pick-to: 6.3 6.2 5.15 +Task-number: PYSIDE-1960 +Change-Id: Icfdd6fefb7156ac5961444bd5395109849a1d66e +Reviewed-by: Christian Tismer <tismer@stackless.com> +Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> +--- + sources/shiboken2/libshiboken/basewrapper.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/build_scripts/config.py b/build_scripts/config.py +index 00cbd3f..63e52a2 100644 +--- a/build_scripts/config.py ++++ b/build_scripts/config.py +@@ -94,6 +94,7 @@ class Config(object): + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ++ 'Programming Language :: Python :: 3.11', + ] + + self.setup_script_dir = None +diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp +index 8b224f2..784082a 100644 +--- a/sources/pyside2/libpyside/pysideqflags.cpp ++++ b/sources/pyside2/libpyside/pysideqflags.cpp +@@ -192,7 +192,7 @@ namespace QFlags + } + newspec.slots = SbkNewQFlagsType_spec.slots; + PyTypeObject *type = (PyTypeObject *)SbkType_FromSpec(&newspec); +- Py_TYPE(type) = &PyType_Type; ++ Py_SET_TYPE(type, &PyType_Type); + + PySideQFlagsType *flagsType = reinterpret_cast<PySideQFlagsType *>(type); + PepType_PFTP(flagsType)->converterPtr = &PepType_PFTP(flagsType)->converter; +diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp +index b5069a0..ce89a9d 100644 +--- a/sources/pyside2/libpyside/pysidesignal.cpp ++++ b/sources/pyside2/libpyside/pysidesignal.cpp +@@ -162,7 +162,7 @@ PyTypeObject *PySideSignalTypeF(void) + if (!type) { + type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpec(&PySideSignalType_spec)); + PyTypeObject *hold = Py_TYPE(type); +- Py_TYPE(type) = PySideMetaSignalTypeF(); ++ Py_SET_TYPE(type, PySideMetaSignalTypeF()); + Py_INCREF(Py_TYPE(type)); + Py_DECREF(hold); + } +diff --git a/sources/pyside2/libpyside/pysideweakref.cpp b/sources/pyside2/libpyside/pysideweakref.cpp +index cd90634..730990f 100644 +--- a/sources/pyside2/libpyside/pysideweakref.cpp ++++ b/sources/pyside2/libpyside/pysideweakref.cpp +@@ -90,7 +90,7 @@ PyObject *create(PyObject *obj, PySideWeakRefFunction func, void *userData) + + if (Py_TYPE(PySideCallableObjectTypeF()) == 0) + { +- Py_TYPE(PySideCallableObjectTypeF()) = &PyType_Type; ++ Py_SET_TYPE(PySideCallableObjectTypeF(), &PyType_Type); + PyType_Ready(PySideCallableObjectTypeF()); + } + +diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp +index 7ac7fad..e2eccd0 100644 +--- a/sources/shiboken2/libshiboken/basewrapper.cpp ++++ b/sources/shiboken2/libshiboken/basewrapper.cpp +@@ -377,7 +377,7 @@ SbkObjectType *SbkObject_TypeF(void) + static PyTypeObject *type = nullptr; + if (!type) { + type = reinterpret_cast<PyTypeObject *>(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); +@@ -1160,7 +1160,7 @@ introduceWrapperType(PyObject *enclosingObject, + typeSpec->slots[0].pfunc = reinterpret_cast<void *>(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<SbkObjectType *>(heaptype); + #if PY_VERSION_HEX < 0x03000000 +@@ -1525,6 +1525,7 @@ bool setCppPointer(SbkObject *sbkObj, PyTypeObject *desiredType, void *cptr) + bool isValid(PyObject *pyObj) + { + if (!pyObj || pyObj == Py_None ++ || PyType_Check(pyObj) != 0 + || Py_TYPE(Py_TYPE(pyObj)) != SbkObjectType_TypeF()) { + return true; + } +diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp +index 7dc73df..9459e42 100644 +--- a/sources/shiboken2/libshiboken/sbkenum.cpp ++++ b/sources/shiboken2/libshiboken/sbkenum.cpp +@@ -754,7 +754,7 @@ newTypeWithName(const char *name, + PyTuple_SetItem(bases, 0, reinterpret_cast<PyObject *>(basetype)); + auto *type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpecWithBases(&newspec, bases)); + PyErr_Print(); +- Py_TYPE(type) = SbkEnumType_TypeF(); ++ Py_SET_TYPE(type, SbkEnumType_TypeF()); + + auto *enumType = reinterpret_cast<SbkEnumType *>(type); + PepType_SETP(enumType)->cppName = cppName; +diff --git a/sources/shiboken2/libshiboken/sbkstring.cpp b/sources/shiboken2/libshiboken/sbkstring.cpp +index 077fb53..a9d451c 100644 +--- a/sources/shiboken2/libshiboken/sbkstring.cpp ++++ b/sources/shiboken2/libshiboken/sbkstring.cpp +@@ -41,8 +41,14 @@ + #include "sbkstaticstrings_p.h" + #include "autodecref.h" + +-#include <vector> +-#include <unordered_set> ++#if PY_VERSION_HEX >= 0x030B0000 || defined(Py_LIMITED_API) ++# define USE_INTERN_STRINGS ++#endif ++ ++#ifndef USE_INTERN_STRINGS ++# include <vector> ++# include <unordered_set> ++#endif + + namespace Shiboken + { +@@ -233,6 +239,13 @@ Py_ssize_t len(PyObject *str) + // PyObject *attr = PyObject_GetAttr(obj, name()); + // + ++#ifdef USE_INTERN_STRINGS ++PyObject *createStaticString(const char *str) ++{ ++ return PyUnicode_InternFromString(str); ++} ++#else ++ + using StaticStrings = std::unordered_set<PyObject *>; + + static void finalizeStaticStrings(); // forward +@@ -283,6 +296,8 @@ PyObject *createStaticString(const char *str) + return result; + } + ++#endif // !USE_INTERN_STRINGS ++ + /////////////////////////////////////////////////////////////////////// + // + // PYSIDE-1019: Helper function for snake_case vs. camelCase names |