[arch-commits] Commit in python-wxpython/trunk (2 files)
Antonio Rojas
arojas at gemini.archlinux.org
Thu Jul 14 19:20:32 UTC 2022
Date: Thursday, July 14, 2022 @ 19:20:32
Author: arojas
Revision: 1252658
Backport some fixes
Added:
python-wxpython/trunk/192109386d58066b7c8ede5d1178a4b719c5f00c.patch
Modified:
python-wxpython/trunk/PKGBUILD
------------------------------------------------+
192109386d58066b7c8ede5d1178a4b719c5f00c.patch | 67 +++++++++++++++++++++++
PKGBUILD | 10 +++
2 files changed, 76 insertions(+), 1 deletion(-)
Added: 192109386d58066b7c8ede5d1178a4b719c5f00c.patch
===================================================================
--- 192109386d58066b7c8ede5d1178a4b719c5f00c.patch (rev 0)
+++ 192109386d58066b7c8ede5d1178a4b719c5f00c.patch 2022-07-14 19:20:32 UTC (rev 1252658)
@@ -0,0 +1,67 @@
+From 192109386d58066b7c8ede5d1178a4b719c5f00c Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Mon, 16 May 2022 15:27:16 -0700
+Subject: [PATCH] Add convertFromPyObject code for wxBitmapBundle so we can
+ autoconvert wxBitmaps from Python
+
+---
+ etg/bmpbndl.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+diff --git a/etg/bmpbndl.py b/etg/bmpbndl.py
+index a166b576c..a1fab8269 100644
+--- a/etg/bmpbndl.py
++++ b/etg/bmpbndl.py
+@@ -40,6 +40,52 @@ def run():
+
+ c.find('FromSVG').findOverload('char *data, const wxSize &sizeDef').ignore()
+
++ # Allow on-the-fly creation of a wx.BitmapBundle from a wx.Bitmap, wx.Icon
++ # or a wx.Image
++ c.convertFromPyObject = """\
++ // Check for type compatibility
++ if (!sipIsErr) {
++ if (sipCanConvertToType(sipPy, sipType_wxBitmap, SIP_NO_CONVERTORS))
++ return 1;
++ if (sipCanConvertToType(sipPy, sipType_wxIcon, SIP_NO_CONVERTORS))
++ return 1;
++ if (sipCanConvertToType(sipPy, sipType_wxImage, SIP_NO_CONVERTORS))
++ return 1;
++ if (sipCanConvertToType(sipPy, sipType_wxBitmapBundle, SIP_NO_CONVERTORS))
++ return 1;
++ return 0;
++ }
++
++ // Otherwise, a conversion is needed
++ int state = 0;
++ if (sipCanConvertToType(sipPy, sipType_wxBitmap, SIP_NO_CONVERTORS)) {
++ wxBitmap* obj = reinterpret_cast<wxBitmap*>(
++ sipConvertToType(sipPy, sipType_wxBitmap, sipTransferObj, SIP_NO_CONVERTORS, &state, sipIsErr));
++ *sipCppPtr = new wxBitmapBundle(*obj);
++ sipReleaseType(obj, sipType_wxBitmap, state);
++ return sipGetState(sipTransferObj);
++ }
++ if (sipCanConvertToType(sipPy, sipType_wxIcon, SIP_NO_CONVERTORS)) {
++ wxIcon* obj = reinterpret_cast<wxIcon*>(
++ sipConvertToType(sipPy, sipType_wxIcon, sipTransferObj, SIP_NO_CONVERTORS, &state, sipIsErr));
++ *sipCppPtr = new wxBitmapBundle(*obj);
++ sipReleaseType(obj, sipType_wxIcon, state);
++ return sipGetState(sipTransferObj);
++ }
++ if (sipCanConvertToType(sipPy, sipType_wxImage, SIP_NO_CONVERTORS)) {
++ wxImage* obj = reinterpret_cast<wxImage*>(
++ sipConvertToType(sipPy, sipType_wxImage, sipTransferObj, SIP_NO_CONVERTORS, &state, sipIsErr));
++ *sipCppPtr = new wxBitmapBundle(*obj);
++ sipReleaseType(obj, sipType_wxImage, state);
++ return sipGetState(sipTransferObj);
++ }
++
++ // The final option is that it is already a wxBitmapBundle, so just fetch the pointer and return
++ *sipCppPtr = reinterpret_cast<wxBitmapBundle*>(
++ sipConvertToType(sipPy, sipType_wxBitmapBundle, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
++ return 0; // not a new instance
++ """
++
+
+ c = module.find('wxBitmapBundleImpl')
+ assert isinstance(c, etgtools.ClassDef)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-07-14 16:49:26 UTC (rev 1252657)
+++ PKGBUILD 2022-07-14 19:20:32 UTC (rev 1252658)
@@ -8,7 +8,7 @@
_wxver=3.2.0
_pkgver="${pkgver%.*}"
_post="${pkgver##*.}"
-pkgrel=2
+pkgrel=3
epoch=1
pkgdesc='Cross-platform GUI toolkit'
arch=('x86_64')
@@ -20,6 +20,8 @@
checkdepends=('xorg-server-xvfb' 'python-pytest-forked' 'python-numpy')
source=("https://files.pythonhosted.org/packages/source/w/wxPython/wxPython-$pkgver.tar.gz"
https://github.com/wxWidgets/wxWidgets/releases/download/v$_wxver/wxWidgets-$_wxver.tar.bz2
+ 173d0796810bb65de9bdfdc6941d24a04628f6c2.patch
+ 192109386d58066b7c8ede5d1178a4b719c5f00c.patch
sip-5.patch
sip-6.patch
wxwidgets-3.1.5.patch
@@ -28,6 +30,8 @@
wxwidgets-3.2.patch)
sha512sums=('00924008b97bbecb824c3fffd46fc76a5a3115d9346eb95baccc6cca99c080aa80b586af42fece8a3b4d234f2d07ffa8b66b50a164c41cbd95abc9b139c32809'
'e55e7c5ac7abcacf2ecff7c22e367db17ff5a077d3d5d2aa7589e8ba7cc6695cfa48c0f00bcfdffeda8dc4f974f97a857fb61b4b300a724f7687d710fbb23967'
+ '5ef772cb14f619b14506de51f58b062729ff7f23f789970ba078ced040fa35ba88994c3331b471c78c8c6186d8c0e432cf7c346e26b0a71f9f08b39f03021adc'
+ 'a75b8ecf69013abe621d5e8f181beac914985e210b4f43a31f7129092d44dfe71539ab75355b32aa0d623125a2866349648f106107330827c2af135305539a1d'
'f619d9b405299558b84646f457a3bddcfffbd0eb90d23f329e107ebb9e3b6e1c6550cbb7a6c775dd65a08d679abcc7b4a6353d5d78ab263213789998b7c24346'
'25a260238ee91b920cce184af6a24cf534ef1eb6a0e1148e52279b0b4990cc34b3cd81ea49ba71e2a9f437891d438b16cc4037bc787e7b44187f8f356a3982b9'
'b324821f3423c5c9d5f7ff055704f7b88a87fa77ade31dfa563b1b35b0ab858a28e9c32a9607cfabafeff1a46177f413665623b254b69d512d7bb4ebdb63089b'
@@ -45,6 +49,10 @@
patch -p1 -i ../wxwidgets-3.1.6.patch
patch -p1 -i ../wxwidgets-3.1.7.patch
patch -p1 -i ../wxwidgets-3.2.patch
+ # Fix Python 3.10 issues
+ patch -p1 -i ../173d0796810bb65de9bdfdc6941d24a04628f6c2.patch
+ # Fix wxBitmapBundle
+ patch -p1 -i ../192109386d58066b7c8ede5d1178a4b719c5f00c.patch
rm -r ext/wxWidgets
mv "$srcdir"/wxWidgets-$_wxver ext/wxWidgets
}
More information about the arch-commits
mailing list