author | Antonio Rojas
<arojas@archlinux.org> 2023-10-06 17:25:20 UTC |
committer | Antonio Rojas
<arojas@archlinux.org> 2023-10-06 17:25:20 UTC |
parent | 385ce2c49cdaf7e123183fd9ae6cc7e7567a0cc2 |
.SRCINFO | +80 | -0 |
PKGBUILD | +4 | -11 |
python3.11.patch | +0 | -161 |
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..6685f9c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,80 @@ +pkgbase = pyside2 + pkgver = 5.15.11 + pkgrel = 1 + url = https://www.qt.io + arch = x86_64 + license = LGPL + makedepends = cmake + makedepends = python-setuptools + makedepends = llvm + makedepends = clang=16.0.6 + makedepends = qt5-multimedia + makedepends = qt5-tools + makedepends = qt5-sensors + makedepends = qt5-charts + makedepends = qt5-webengine + makedepends = qt5-datavis3d + makedepends = qt5-websockets + makedepends = qt5-speech + makedepends = qt5-3d + makedepends = qt5-svg + makedepends = qt5-script + makedepends = qt5-scxml + makedepends = qt5-x11extras + makedepends = qt5-quickcontrols2 + makedepends = qt5-serialport + makedepends = qt5-remoteobjects + makedepends = qt5-xmlpatterns + optdepends = qt5-svg: QtSvg bindings + optdepends = qt5-script: QtScript bindings + optdepends = qt5-speech: QtTextToSpeech bindings + optdepends = qt5-websockets: QtWebSockets bindings + optdepends = qt5-webengine: QtWebEngine bindings + optdepends = qt5-datavis3d: QtDataVisualization bindings + optdepends = qt5-scxml: QtScxml bindings + optdepends = qt5-sensors: QtSensors bindings + optdepends = qt5-3d: Qt3D bindings + optdepends = qt5-x11extras: QtX11Extras bindings + optdepends = qt5-charts: QtCharts bindings + optdepends = qt5-tools: QtHelp bindings + optdepends = qt5-remoteobjects: QtRemoteObjects bindings + optdepends = qt5-serialport: QtSerialPort bindings + optdepends = qt5-quickcontrols2: QtQuickControls2 bindings + source = https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.11-src/pyside-setup-opensource-src-5.15.11.tar.xz + sha256sums = da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29 + +pkgname = shiboken2 + pkgdesc = Generates bindings for C++ libraries using CPython source code + depends = clang=16.0.6 + depends = llvm + depends = libxslt + depends = qt5-xmlpatterns + +pkgname = python-shiboken2 + pkgdesc = Python bindings for shiboken2 + depends = python + +pkgname = pyside2 + pkgdesc = Enables the use of Qt5 APIs in Python applications + depends = python-shiboken2 + depends = qt5-declarative + optdepends = qt5-svg: QtSvg bindings + optdepends = qt5-script: QtScript bindings + optdepends = qt5-speech: QtTextToSpeech bindings + optdepends = qt5-websockets: QtWebSockets bindings + optdepends = qt5-webengine: QtWebEngine bindings + optdepends = qt5-datavis3d: QtDataVisualization bindings + optdepends = qt5-scxml: QtScxml bindings + optdepends = qt5-sensors: QtSensors bindings + optdepends = qt5-3d: Qt3D bindings + optdepends = qt5-x11extras: QtX11Extras bindings + optdepends = qt5-charts: QtCharts bindings + optdepends = qt5-tools: QtHelp bindings + optdepends = qt5-remoteobjects: QtRemoteObjects bindings + optdepends = qt5-serialport: QtSerialPort bindings + optdepends = qt5-quickcontrols2: QtQuickControls2 bindings + provides = qt5-python-bindings + +pkgname = pyside2-tools + pkgdesc = Tools for PySide2 + depends = pyside2 diff --git a/PKGBUILD b/PKGBUILD index 26d4872..b19f86c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,10 +3,10 @@ pkgbase=pyside2 pkgname=(shiboken2 python-shiboken2 pyside2 pyside2-tools) -_qtver=5.15.10 +_qtver=5.15.11 _clangver=16.0.6 pkgver=${_qtver/-/} -pkgrel=2 +pkgrel=1 arch=(x86_64) url='https://www.qt.io' license=(LGPL) @@ -30,15 +30,8 @@ optdepends=('qt5-svg: QtSvg bindings' 'qt5-serialport: QtSerialPort bindings' 'qt5-quickcontrols2: QtQuickControls2 bindings') _pkgfqn=pyside-setup-opensource-src-$_qtver -source=(https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}.tar.xz - python3.11.patch) -sha256sums=('2af691d3613a41f83a60439b46568fc2c696dbfae42f7cd7b07152d115ead33a' - 'e91549f7d3da412e864af26f604d0023b80233a7165f50fa21e53cbe861db886') - -prepare() { - patch -d $_pkgfqn -p1 < python3.11.patch # Fix build with Python 3.11 - sed -e 's|0x030AFFFF|0x030BFFFF|' -i $_pkgfqn/sources/shiboken2/libshiboken/pep384impl.h -} +source=(https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}.tar.xz) +sha256sums=('da567cd3b7854d27a0b4afe3e89de8b2f98b7a6d57393be56f1fc13f770faf29') build() { cmake -B build -S $_pkgfqn \ diff --git a/python3.11.patch b/python3.11.patch deleted file mode 100644 index 311a240..0000000 --- a/python3.11.patch +++ /dev/null @@ -1,161 +0,0 @@ -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(+) - -Index: pyside-setup-opensource-src-5.15.7/sources/shiboken2/libshiboken/basewrapper.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/shiboken2/libshiboken/basewrapper.cpp -+++ pyside-setup-opensource-src-5.15.7/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 *enclosing - 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, Py - bool isValid(PyObject *pyObj) - { - if (!pyObj || pyObj == Py_None -+ || PyType_Check(pyObj) != 0 - || Py_TYPE(Py_TYPE(pyObj)) != SbkObjectType_TypeF()) { - return true; - } -Index: pyside-setup-opensource-src-5.15.7/sources/pyside2/libpyside/pysideqflags.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/pyside2/libpyside/pysideqflags.cpp -+++ pyside-setup-opensource-src-5.15.7/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; -Index: pyside-setup-opensource-src-5.15.7/sources/pyside2/libpyside/pysidesignal.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/pyside2/libpyside/pysidesignal.cpp -+++ pyside-setup-opensource-src-5.15.7/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); - } -Index: pyside-setup-opensource-src-5.15.7/sources/pyside2/libpyside/pysideweakref.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/pyside2/libpyside/pysideweakref.cpp -+++ pyside-setup-opensource-src-5.15.7/sources/pyside2/libpyside/pysideweakref.cpp -@@ -90,7 +90,7 @@ PyObject *create(PyObject *obj, PySideWe - - if (Py_TYPE(PySideCallableObjectTypeF()) == 0) - { -- Py_TYPE(PySideCallableObjectTypeF()) = &PyType_Type; -+ Py_SET_TYPE(PySideCallableObjectTypeF(), &PyType_Type); - PyType_Ready(PySideCallableObjectTypeF()); - } - -Index: pyside-setup-opensource-src-5.15.7/sources/shiboken2/libshiboken/sbkenum.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/shiboken2/libshiboken/sbkenum.cpp -+++ pyside-setup-opensource-src-5.15.7/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; -Index: pyside-setup-opensource-src-5.15.7/sources/shiboken2/libshiboken/sbkstring.cpp -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/sources/shiboken2/libshiboken/sbkstring.cpp -+++ pyside-setup-opensource-src-5.15.7/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 - return result; - } - -+#endif // !USE_INTERN_STRINGS -+ - /////////////////////////////////////////////////////////////////////// - // - // PYSIDE-1019: Helper function for snake_case vs. camelCase names -Index: pyside-setup-opensource-src-5.15.7/build_scripts/config.py -=================================================================== ---- pyside-setup-opensource-src-5.15.7.orig/build_scripts/config.py -+++ pyside-setup-opensource-src-5.15.7/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