[arch-commits] Commit in shiboken2/trunk (PKGBUILD shiboken-fix-falkon.patch)

Antonio Rojas arojas at archlinux.org
Thu Dec 19 21:39:23 UTC 2019


    Date: Thursday, December 19, 2019 @ 21:39:22
  Author: arojas
Revision: 371942

Fix plugin loading in Falkon

Added:
  shiboken2/trunk/shiboken-fix-falkon.patch
Modified:
  shiboken2/trunk/PKGBUILD

---------------------------+
 PKGBUILD                  |   11 +++++++---
 shiboken-fix-falkon.patch |   46 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-12-19 20:51:54 UTC (rev 371941)
+++ PKGBUILD	2019-12-19 21:39:22 UTC (rev 371942)
@@ -6,7 +6,7 @@
 _qtver=5.14.0
 _clangver=9.0.0
 pkgver=${_qtver/-/}
-pkgrel=1
+pkgrel=2
 arch=(x86_64)
 url='https://www.qt.io'
 license=(GPL2 LGPL)
@@ -13,11 +13,16 @@
 pkgdesc='Generates bindings for C++ libraries using CPython source code'
 makedepends=(clang llvm cmake libxslt qt5-xmlpatterns python-sphinx)
 _pkgfqn=pyside-setup-opensource-src-${_qtver}
-source=("https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}.tar.xz")
-sha256sums=('8c2ad1901a99165ed7bac8f522ee351ae3ebadd580024248f5a1db52e4a94b30')
+source=("https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}.tar.xz"
+         shiboken-fix-falkon.patch)
+sha256sums=('8c2ad1901a99165ed7bac8f522ee351ae3ebadd580024248f5a1db52e4a94b30'
+            '3093d8d9e76bffce4e9fc16a620f9401749efff8b4d7e26c57d09f5342040627')
 
 prepare() {
   mkdir -p build
+
+  cd $_pkgfqn
+  patch -p1 -i ../shiboken-fix-falkon.patch # Fix loading Falkon plugins
 }
 
 build() {

Added: shiboken-fix-falkon.patch
===================================================================
--- shiboken-fix-falkon.patch	                        (rev 0)
+++ shiboken-fix-falkon.patch	2019-12-19 21:39:22 UTC (rev 371942)
@@ -0,0 +1,46 @@
+From 92944434452d185ef0b023abd5eec224aea7eeb2 Mon Sep 17 00:00:00 2001
+From: Christian Tismer <tismer at stackless.com>
+Date: Wed, 13 Nov 2019 19:12:16 +0100
+Subject: [PATCH] WIP: qApp: Ensure QtCore import when embedded QApplication subclass is used
+
+The qApp machinery works great with Python.
+When using embedding, things are different because there
+is no longer a wrapper layer.
+
+Unfortunately, many extension modules use C++ to derive a
+QApplication class.
+
+This has the side effect that when a foreign C++ module gets
+imported, the qApp machinery does not see it as it would
+in Python.
+
+Instead of a complex analysis, we always make sure that QtCore
+is imported. It will report the right instance, anyway.
+
+XXX make sure that this assumption is really true...
+
+Change-Id: Ie9c56ac75e6c0ae3ace615dfc26c6d218ff4efea
+Fixes: PYSIDE-1135
+---
+
+diff --git a/sources/shiboken2/libshiboken/qapp_macro.cpp b/sources/shiboken2/libshiboken/qapp_macro.cpp
+index 306f53b..c2018bd 100644
+--- a/sources/shiboken2/libshiboken/qapp_macro.cpp
++++ b/sources/shiboken2/libshiboken/qapp_macro.cpp
+@@ -246,7 +246,14 @@
+      * qApp_contents variable and assigns the instance, instead of vice-versa.
+      */
+     PyObject *coreDict = qApp_moduledicts[1];
+-    if (qApp != nullptr && coreDict != nullptr) {
++    if (coreDict == nullptr) {
++        // PYSIDE-1135: Make sure that at least QtCore gets imported.
++        // That problem exists when a derived instance is created in C++.
++        qApp_moduledicts[1] = Py_None; // anything != nullptr during import
++        coreDict = PyImport_ImportModule("PySide2.QtCore");
++        qApp_moduledicts[1] = coreDict;
++    }
++    if (qApp != nullptr && coreDict != nullptr && coreDict != Py_None) {
+         PyObject *coreApp = PyDict_GetItemString(coreDict, "QCoreApplication");
+         if (coreApp != nullptr) {
+             qApp_content = PyObject_CallMethod(coreApp, "instance", "");
+



More information about the arch-commits mailing list