[arch-commits] Commit in (8 files)

Balló György bgyorgy at archlinux.org
Sat Apr 7 14:39:44 UTC 2018


    Date: Saturday, April 7, 2018 @ 14:39:43
  Author: bgyorgy
Revision: 314848

Replace wxpython with new packages (FS#47448)

- python2-wxpython3: it provides the classic wxPython 3 for a long time 
for the existing applications.

- python-wxpython: it provides the new wxPython 4 for applications which 
want to port to Python 3.

Added:
  python-wxpython/
  python-wxpython/trunk/
  python-wxpython/trunk/PKGBUILD
  python-wxpython/trunk/unbundle-sip.patch
  python2-wxpython3/
  python2-wxpython3/trunk/
  python2-wxpython3/trunk/PKGBUILD
  python2-wxpython3/trunk/fix-plot.patch

------------------------------------------+
 python-wxpython/trunk/PKGBUILD           |   35 +++++++
 python-wxpython/trunk/unbundle-sip.patch |   58 ++++++++++++
 python2-wxpython3/trunk/PKGBUILD         |   55 ++++++++++++
 python2-wxpython3/trunk/fix-plot.patch   |  131 +++++++++++++++++++++++++++++
 4 files changed, 279 insertions(+)

Added: python-wxpython/trunk/PKGBUILD
===================================================================
--- python-wxpython/trunk/PKGBUILD	                        (rev 0)
+++ python-wxpython/trunk/PKGBUILD	2018-04-07 14:39:43 UTC (rev 314848)
@@ -0,0 +1,35 @@
+# $Id$
+# Maintainer: Eric Bélanger <eric at archlinux.org>
+
+pkgname=python-wxpython
+pkgver=4.0.1
+pkgrel=1
+pkgdesc="Phoenix wxWidgets GUI toolkit for Python"
+arch=('x86_64')
+license=('custom:wxWindows')
+url="https://www.wxpython.org"
+depends=('wxgtk3' 'python-setuptools' 'python-sip' 'python-six')
+makedepends=('mesa' 'glu')
+source=("https://github.com/wxWidgets/Phoenix/releases/download/wxPython-${pkgver}/wxPython-${pkgver}.tar.gz"
+        "unbundle-sip.patch")
+sha256sums=('f8f2ac1a75368b9b103259addc77f4e3dfe729c6d70aa1fd0b7e9c5b6075c710'
+            '060badc5667993cd4120c8779f812d892d9a46816287b622af02756bb330cc9f')
+
+prepare() {
+    cd wxPython-${pkgver}
+    patch -Np1 -i ../unbundle-sip.patch
+    find -name '*.py' | xargs sed -i 's/wx.siplib/sip/'
+    rm -rf sip
+}
+
+build() {
+    cd wxPython-${pkgver}
+    python3 setup.py build
+}
+
+package() {
+    cd wxPython-${pkgver}
+    python3 setup.py install --root="${pkgdir}" --optimize=1
+    install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.txt
+    find "$pkgdir/usr/lib" -type f | xargs chmod 644
+}


Property changes on: python-wxpython/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: python-wxpython/trunk/unbundle-sip.patch
===================================================================
--- python-wxpython/trunk/unbundle-sip.patch	                        (rev 0)
+++ python-wxpython/trunk/unbundle-sip.patch	2018-04-07 14:39:43 UTC (rev 314848)
@@ -0,0 +1,58 @@
+diff --git a/wscript b/wscript
+--- a/wscript
++++ b/wscript
+@@ -95,8 +95,8 @@
+     conf.env.debug = conf.options.debug
+     conf.env.msvc_relwithdebug = conf.options.msvc_relwithdebug
+ 
+-    # Ensure that the headers in siplib and Phoenix's src dir can be found
+-    conf.env.INCLUDES_WXPY = ['sip/siplib', 'src']
++    # Ensure that the headers in Phoenix's src dir can be found
++    conf.env.INCLUDES_WXPY = ['src']
+ 
+     if isWindows:
+         # Windows/MSVC specific stuff
+@@ -505,26 +505,6 @@
+         copy_file(name, cfg.PKGDIR, update=1, verbose=1)
+ 
+ 
+-    # Create the build tasks for each of our extension modules.
+-    addRelwithdebugFlags(bld, 'siplib')
+-    siplib = bld(
+-        features = 'c cxx cshlib cxxshlib pyext',
+-        target   = makeTargetName(bld, 'siplib'),
+-        source   = ['sip/siplib/apiversions.c',
+-                    'sip/siplib/array.c',
+-                    'sip/siplib/bool.cpp',
+-                    'sip/siplib/descriptors.c',
+-                    'sip/siplib/int_convertors.c',
+-                    'sip/siplib/objmap.c',
+-                    'sip/siplib/qtlib.c',
+-                    'sip/siplib/siplib.c',
+-                    'sip/siplib/threads.c',
+-                    'sip/siplib/voidptr.c',
+-                    ],
+-        uselib   = 'siplib WX WXPY',
+-    )
+-    makeExtCopyRule(bld, 'siplib')
+-
+     # Add build rules for each of our ETG generated extension modules
+     makeETGRule(bld, 'etg/_core.py',       '_core',      'WX')
+     makeETGRule(bld, 'etg/_adv.py',        '_adv',       'WXADV')
+@@ -613,14 +593,14 @@
+ 
+ # Make extension module build rules using info gleaned from an ETG script
+ def makeETGRule(bld, etgScript, moduleName, libFlags):
+-    from buildtools.config   import loadETG, getEtgSipCppFiles
++    from buildtools.config   import loadETG
+ 
+     addRelwithdebugFlags(bld, moduleName)
+     rc = ['src/wxc.rc'] if isWindows else []
+     etg = loadETG(etgScript)
+     bld(features='c cxx cxxshlib pyext',
+         target=makeTargetName(bld, moduleName),
+-        source=getEtgSipCppFiles(etg) + rc,
++        source=rc,
+         uselib='{} {} WXPY'.format(moduleName, libFlags),
+         )
+     makeExtCopyRule(bld, moduleName)

Added: python2-wxpython3/trunk/PKGBUILD
===================================================================
--- python2-wxpython3/trunk/PKGBUILD	                        (rev 0)
+++ python2-wxpython3/trunk/PKGBUILD	2018-04-07 14:39:43 UTC (rev 314848)
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Eric Bélanger <eric at archlinux.org>
+
+pkgname=python2-wxpython3
+pkgver=3.0.2.0
+pkgrel=1
+pkgdesc="Classic wxWidgets GUI toolkit for Python"
+arch=('x86_64')
+license=('custom:wxWindows')
+url="https://www.wxpython.org"
+depends=('wxgtk3' 'python2')
+makedepends=('mesa' 'glu')
+conflicts=(wxpython)
+replaces=(wxpython)
+provides=(wxpython=$pkgver)
+source=("https://downloads.sourceforge.net/wxpython/wxPython-src-${pkgver}.tar.bz2"
+        "fix-plot.patch")
+sha256sums=('d54129e5fbea4fb8091c87b2980760b72c22a386cb3b9dd2eebc928ef5e8df61'
+            '2d8b2bdbf55172738c7bf93955e552aac61842800c3b8b0a2e1f07f4314abc65')
+
+prepare() {
+    find . -type f -exec sed -i 's/env python/env python2/' {} \;
+
+    cd wxPython-src-${pkgver}/wxPython
+    # Fix plot library (FS#42807)
+    patch -Np1 -i ../../fix-plot.patch
+}
+
+build() {
+    cd wxPython-src-${pkgver}
+    ./configure \
+        --prefix=/usr \
+        --libdir=/usr/lib \
+        --includedir=/usr/include \
+        --with-gtk=3 \
+        --with-opengl \
+        --enable-unicode \
+        --enable-graphics_ctx \
+        --disable-precomp-headers \
+        --with-regex=sys \
+        --with-libpng=sys \
+        --with-libxpm=sys \
+        --with-libjpeg=sys \
+        --with-libtiff=sys \
+        --with-wx-config=/usr/bin/wx-config-gtk3
+    cd wxPython
+    python2 setup.py WX_CONFIG=/usr/bin/wx-config-gtk3 WXPORT=gtk3 UNICODE=1 build
+}
+
+package() {
+    cd wxPython-src-${pkgver}/wxPython
+    python2 setup.py WX_CONFIG=/usr/bin/wx-config-gtk3 WXPORT=gtk3 UNICODE=1 install --root="${pkgdir}" --optimize=1
+    for file in "${pkgdir}"/usr/bin/*; do mv "${file}" "${file}2"; done
+    install -Dm644 ../docs/licence.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}


Property changes on: python2-wxpython3/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: python2-wxpython3/trunk/fix-plot.patch
===================================================================
--- python2-wxpython3/trunk/fix-plot.patch	                        (rev 0)
+++ python2-wxpython3/trunk/fix-plot.patch	2018-04-07 14:39:43 UTC (rev 314848)
@@ -0,0 +1,131 @@
+From 25bcbf15615b64e095da75e934ea4d254998ec24 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Wed, 11 Mar 2015 14:37:20 -0700
+Subject: [PATCH] We need to use wx.CursorFromImage on Classic
+
+---
+ wx/lib/plot.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/wx/lib/plot.py b/wx/lib/plot.py
+index 94696c56b7..e166645863 100644
+--- a/wx/lib/plot.py
++++ b/wx/lib/plot.py
+@@ -595,9 +595,9 @@ def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
+ 
+         # set curser as cross-hairs
+         self.canvas.SetCursor(wx.CROSS_CURSOR)
+-        self.HandCursor = wx.Cursor(Hand.GetImage())
+-        self.GrabHandCursor = wx.Cursor(GrabHand.GetImage())
+-        self.MagCursor = wx.Cursor(MagPlus.GetImage())
++        self.HandCursor = wx.CursorFromImage(Hand.GetImage())
++        self.GrabHandCursor = wx.CursorFromImage(GrabHand.GetImage())
++        self.MagCursor = wx.CursorFromImage(MagPlus.GetImage())
+ 
+         # Things for printing
+         self._print_data = None
+From 30bc07d80ae1c81d70b4de2daac62ecd7996d703 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Wed, 25 Mar 2015 15:34:49 -0700
+Subject: [PATCH] Revert some more Phoenix-only changes.
+
+---
+ wx/lib/plot.py | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/wx/lib/plot.py b/wx/lib/plot.py
+index e166645863..102c35cc84 100644
+--- a/wx/lib/plot.py
++++ b/wx/lib/plot.py
+@@ -237,7 +237,7 @@ def __init__(self, points, **attr):
+         :keyword `attr`: keyword attributes, default to:
+ 
+          ==========================  ================================
+-         'colour'= 'black'           wx.Pen Colour any wx.Colour
++         'colour'= 'black'           wx.Pen Colour any wx.NamedColour
+          'width'= 1                  Pen width
+          'style'= wx.PENSTYLE_SOLID  wx.Pen style
+          'legend'= ''                Line Legend to display
+@@ -251,7 +251,7 @@ def draw(self, dc, printerScale, coord=None):
+         width = self.attributes['width'] * printerScale * self._pointSize[0]
+         style = self.attributes['style']
+         if not isinstance(colour, wx.Colour):
+-            colour = wx.Colour(colour)
++            colour = wx.NamedColour(colour)
+         pen = wx.Pen(colour, width, style)
+         pen.SetCap(wx.CAP_BUTT)
+         dc.SetPen(pen)
+@@ -287,7 +287,7 @@ def __init__(self, points, **attr):
+         :keyword `attr`: keyword attributes, default to:
+ 
+          ==========================  ================================
+-         'colour'= 'black'           wx.Pen Colour any wx.Colour
++         'colour'= 'black'           wx.Pen Colour any wx.NamedColour
+          'width'= 1                  Pen width
+          'style'= wx.PENSTYLE_SOLID  wx.Pen style
+          'legend'= ''                Line Legend to display
+@@ -301,7 +301,7 @@ def draw(self, dc, printerScale, coord=None):
+         width = self.attributes['width'] * printerScale * self._pointSize[0]
+         style = self.attributes['style']
+         if not isinstance(colour, wx.Colour):
+-            colour = wx.Colour(colour)
++            colour = wx.NamedColour(colour)
+         pen = wx.Pen(colour, width, style)
+         pen.SetCap(wx.CAP_ROUND)
+         dc.SetPen(pen)
+@@ -334,10 +334,10 @@ def __init__(self, points, **attr):
+         :keyword `attr`: keyword attributes, default to:
+ 
+          ================================ ================================
+-         'colour'= 'black'                wx.Pen Colour any wx.Colour
++         'colour'= 'black'                wx.Pen Colour any wx.NamedColour
+          'width'= 1                       Pen width
+          'size'= 2                        Marker size
+-         'fillcolour'= same as colour     wx.Brush Colour any wx.Colour
++         'fillcolour'= same as colour     wx.Brush Colour any wx.NamedColour
+          'fillstyle'= wx.BRUSHSTYLE_SOLID wx.Brush fill style (use wx.BRUSHSTYLE_TRANSPARENT for no fill)
+          'style'= wx.FONTFAMILY_SOLID     wx.Pen style
+          'marker'= 'circle'               Marker shape
+@@ -365,10 +365,10 @@ def draw(self, dc, printerScale, coord=None):
+         marker = self.attributes['marker']
+ 
+         if colour and not isinstance(colour, wx.Colour):
+-            colour = wx.Colour(colour)
++            colour = wx.NamedColour(colour)
+         if fillcolour and not isinstance(fillcolour, wx.Colour):
+-            fillcolour = wx.Colour(fillcolour)
+-
++            fillcolour = wx.NamedColour(fillcolour)
++            
+         dc.SetPen(wx.Pen(colour, width))
+         if fillcolour:
+             dc.SetBrush(wx.Brush(fillcolour, fillstyle))
+@@ -681,8 +681,9 @@ def SetGridColour(self, colour):
+         if isinstance(colour, wx.Colour):
+             self._gridColour = colour
+         else:
+-            self._gridColour = wx.Colour(colour)
++            self._gridColour = wx.NamedColour(colour)
+ 
++        
+     # SaveFile
+     def SaveFile(self, fileName=''):
+         """Saves the file to the type specified in the extension. If no file
+@@ -1513,7 +1514,7 @@ def OnSize(self, event):
+         # Make new offscreen bitmap: this bitmap will always have the
+         # current drawing in it, so it can be used to save the image to
+         # a file, or whatever.
+-        self._Buffer = wx.Bitmap(Size.width, Size.height)
++        self._Buffer = wx.EmptyBitmap(Size.width, Size.height)
+         self._setSize()
+ 
+         self.last_PointLabel = None  # reset pointLabel
+@@ -1578,7 +1579,7 @@ def _drawPointLabel(self, mDataDict):
+         width = self._Buffer.GetWidth()
+         height = self._Buffer.GetHeight()
+         if sys.platform != "darwin":
+-            tmp_Buffer = wx.Bitmap(width, height)
++            tmp_Buffer = wx.EmptyBitmap(width,height)
+             dcs = wx.MemoryDC()
+             dcs.SelectObject(tmp_Buffer)
+             dcs.Clear()



More information about the arch-commits mailing list