diff --git a/mingw-w64-wxPython/0001-wxWidgets-win-from-cygwin.patch b/mingw-w64-wxPython/0001-wxWidgets-win-from-cygwin.patch new file mode 100644 index 0000000000..af08275a14 --- /dev/null +++ b/mingw-w64-wxPython/0001-wxWidgets-win-from-cygwin.patch @@ -0,0 +1,28 @@ +--- wxPython-4.1.1/wscript.ORIG 2021-06-12 13:34:52.919243800 -0700 ++++ wxPython-4.1.1/wscript 2021-06-12 13:41:18.778905500 -0700 +@@ -26,6 +26,7 @@ + VERSION = cfg.VERSION + + isWindows = sys.platform.startswith('win') ++isWindowsLike = isWindows or sys.platform == 'cygwin' + isDarwin = sys.platform == "darwin" + + top = '.' +@@ -302,7 +303,7 @@ + # above) and not darwin then we must be using the GTK2 or GTK3 port of + # wxWidgets. If we ever support other ports then this code will need + # to be adjusted. +- if not isDarwin: ++ if not isDarwin and not isWindowsLike: + if conf.options.gtk2: + conf.options.gtk3 = False + if conf.options.gtk2: +@@ -621,7 +622,7 @@ + # Modules that are platform-specific + if isDarwin: + makeETGRule(bld, 'etg/_webkit.py', '_webkit', 'WXWEBKIT') +- if isWindows: ++ if isWindowsLike: + makeETGRule(bld, 'etg/_msw.py', '_msw', 'WX') + + # ** Add code for new modules here diff --git a/mingw-w64-wxPython/0002-handle-cast.patch b/mingw-w64-wxPython/0002-handle-cast.patch new file mode 100644 index 0000000000..a9d795e233 --- /dev/null +++ b/mingw-w64-wxPython/0002-handle-cast.patch @@ -0,0 +1,140 @@ +From 31e6c8ed34dc71b6690c71107d2693c40448335f Mon Sep 17 00:00:00 2001 +From: Jeremy Drake +Date: Mon, 14 Jun 2021 11:43:29 -0700 +Subject: [PATCH] WXMSW: use HandleToLong/LongToHandle functions. + +On Clang++, casting from a pointer to an integer of a smaller size is +considered an error. In cases where Windows HANDLEs are converted +to/from longs, use the Windows-provided conversion functions +HandleToLong and LongToHandle. + +In a couple of cases, a pointer is being cast to long in a __hash__ +function. These don't seem Windows-specific so it is not safe to assume +the Windows conversion functions are present. In those cases, fall back +to the (ugly) double-casting that the Windows functions contain. +--- + etg/bitmap.py | 4 ++-- + etg/cursor.py | 4 ++-- + etg/dataview.py | 2 +- + etg/dc.py | 2 +- + etg/icon.py | 6 +++--- + etg/treelist.py | 2 +- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/etg/bitmap.py b/etg/bitmap.py +index cb349fc9..7b901921 100644 +--- a/etg/bitmap.py ++++ b/etg/bitmap.py +@@ -106,7 +106,7 @@ def run(): + doc='MSW-only method to fetch the windows handle for the bitmap.', + body="""\ + #ifdef __WXMSW__ +- return (long)self->GetHandle(); ++ return HandleToLong(self->GetHandle()); + #else + return 0; + #endif +@@ -116,7 +116,7 @@ def run(): + doc='MSW-only method to set the windows handle for the bitmap.', + body="""\ + #ifdef __WXMSW__ +- self->SetHandle((WXHANDLE)handle); ++ self->SetHandle((WXHANDLE)LongToHandle(handle)); + #endif + """) + +diff --git a/etg/cursor.py b/etg/cursor.py +index 67338561..5e221fe9 100644 +--- a/etg/cursor.py ++++ b/etg/cursor.py +@@ -51,7 +51,7 @@ def run(): + + c.addCppMethod('long', 'GetHandle', '()', """\ + #ifdef __WXMSW__ +- return (long)self->GetHandle(); ++ return HandleToLong(self->GetHandle()); + #else + return 0; + #endif""", +@@ -59,7 +59,7 @@ def run(): + + c.addCppMethod('void', 'SetHandle', '(long handle)', """\ + #ifdef __WXMSW__ +- self->SetHandle((WXHANDLE)handle); ++ self->SetHandle((WXHANDLE)LongToHandle(handle)); + #endif""", + briefDoc="Set the handle to use for this Cursor. Windows only.") + +diff --git a/etg/dataview.py b/etg/dataview.py +index c00f736d..80eade26 100644 +--- a/etg/dataview.py ++++ b/etg/dataview.py +@@ -82,7 +82,7 @@ def run(): + + c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();") + c.addCppMethod('int', '__bool__', '()', "return self->IsOk();") +- c.addCppMethod('long', '__hash__', '()', "return (long)self->GetID();") ++ c.addCppMethod('long', '__hash__', '()', "return (long)(intptr_t)self->GetID();") + + c.addCppMethod('bool', '__eq__', '(wxDataViewItem* other)', + "return other ? (self->GetID() == other->GetID()) : false;") +diff --git a/etg/dc.py b/etg/dc.py +index 94e3ab44..0fd9514f 100644 +--- a/etg/dc.py ++++ b/etg/dc.py +@@ -257,7 +257,7 @@ def run(): + + c.addCppMethod('long', 'GetHDC', '()', """\ + #ifdef __WXMSW__ +- return (long)self->GetHandle(); ++ return HandleToLong(self->GetHandle()); + #else + wxPyRaiseNotImplemented(); + return 0; +diff --git a/etg/icon.py b/etg/icon.py +index 9bd18bca..2733ddd6 100644 +--- a/etg/icon.py ++++ b/etg/icon.py +@@ -56,7 +56,7 @@ def run(): + + c.addCppMethod('long', 'GetHandle', '()', """\ + #ifdef __WXMSW__ +- return (long)self->GetHandle(); ++ return HandleToLong(self->GetHandle()); + #else + return 0; + #endif +@@ -64,7 +64,7 @@ def run(): + + c.addCppMethod('void', 'SetHandle', '(long handle)', """\ + #ifdef __WXMSW__ +- self->SetHandle((WXHANDLE)handle); ++ self->SetHandle((WXHANDLE)LongToHandle(handle)); + #endif + """) + +@@ -73,7 +73,7 @@ def run(): + doc='MSW-only method to create a wx.Icon from a native icon handle.', + body="""\ + #ifdef __WXMSW__ +- return self->CreateFromHICON((WXHICON)hicon); ++ return self->CreateFromHICON((WXHICON)LongToHandle(hicon)); + #else + return false; + #endif +diff --git a/etg/treelist.py b/etg/treelist.py +index 34f22017..ca57ad65 100644 +--- a/etg/treelist.py ++++ b/etg/treelist.py +@@ -47,7 +47,7 @@ def run(): + c.addCppMethod('int', '__bool__', '()', "return self->IsOk();") + + c.addCppMethod('long', '__hash__', '()', """\ +- return (long)self->GetID(); ++ return (long)(intptr_t)self->GetID(); + """) + + c.addCppMethod('bool', '__eq__', '(wxTreeListItem* other)', +-- +2.32.0.windows.1 + diff --git a/mingw-w64-wxPython/0003-wxWidgets.Doxyfile.patch b/mingw-w64-wxPython/0003-wxWidgets.Doxyfile.patch new file mode 100644 index 0000000000..4e0a8fc661 --- /dev/null +++ b/mingw-w64-wxPython/0003-wxWidgets.Doxyfile.patch @@ -0,0 +1,53 @@ +diff --git "a/docs/doxygen/Doxyfile" "b/docs/doxygen/Doxyfile" +index 030a80bc3c..fec52a0af0 100644 +--- "a/ext/wxWidgets/docs/doxygen/Doxyfile" ++++ "b/ext/wxWidgets/docs/doxygen/Doxyfile" +@@ -29,7 +29,6 @@ MULTILINE_CPP_IS_BRIEF = NO + INHERIT_DOCS = YES + SEPARATE_MEMBER_PAGES = NO + TAB_SIZE = 4 +-TCL_SUBST = + OPTIMIZE_OUTPUT_FOR_C = NO + OPTIMIZE_OUTPUT_JAVA = NO + OPTIMIZE_FOR_FORTRAN = NO +@@ -92,12 +91,12 @@ ALIASES += endFlagTable="\n" + # creates appearance section: this should be used for all main GUI controls + # that look different in different ports. genericAppearance can be used for the + # controls that always look the same. +-ALIASES += appearance{1}="\htmlonly
Appearance:
\endhtmlonly\n\image html appear-\1-msw.png \"wxMSW Appearance\"\n\htmlonly\endhtmlonly\n\image html appear-\1-gtk.png \"wxGTK Appearance\"\n\htmlonly\endhtmlonly\n\image html appear-\1-mac.png \"wxOSX Appearance\"\n\htmlonly
\endhtmlonly" +-ALIASES += genericAppearance{1}="\htmlonly
Appearance:
\endhtmlonly\n\image html generic/\1.png \"Generic Appearance\"\n\htmlonly
\endhtmlonly" ++ALIASES += appearance{1}="\htmlonly
Appearance:
\endhtmlonly\n\image html appear-\1-msw.png \"wxMSW Appearance\"\n\htmlonly\endhtmlonly\n\image html appear-\1-gtk.png \"wxGTK Appearance\"\n\htmlonly\endhtmlonly\n\image html appear-\1-mac.png \"wxOSX Appearance\"\n\htmlonly
\endhtmlonly" ++ALIASES += genericAppearance{1}="\htmlonly
Appearance:
\endhtmlonly\n\image html generic/\1.png \"Generic Appearance\"\n\htmlonly
\endhtmlonly" + + # these compact versions are only used on the screenshots page +-ALIASES += appearance_brief{2}="\htmlonly
\endhtmlonly\n\1\htmlonly\endhtmlonly\n\image html appear-\2-msw.png\n\htmlonly\endhtmlonly\n\image html appear-\2-gtk.png\n\htmlonly\endhtmlonly\n\image html appear-\2-mac.png\n\htmlonly
\endhtmlonly" +-ALIASES += genericAppearance_brief{2}="\htmlonly
\endhtmlonly\n\1\htmlonly\endhtmlonly\n\image html generic/\2.png\n\htmlonly
\endhtmlonly" ++ALIASES += appearance_brief{2}="\htmlonly
\endhtmlonly\n\1\htmlonly\endhtmlonly\n\image html appear-\2-msw.png\n\htmlonly\endhtmlonly\n\image html appear-\2-gtk.png\n\htmlonly\endhtmlonly\n\image html appear-\2-mac.png\n\htmlonly
\endhtmlonly" ++ALIASES += genericAppearance_brief{2}="\htmlonly
\endhtmlonly\n\1\htmlonly\endhtmlonly\n\image html generic/\2.png\n\htmlonly
\endhtmlonly" + + # aliases for the creation of "named member groups" + # USAGE: the first argument must not contain spaces and be a unique identifier +@@ -338,7 +337,6 @@ VERBATIM_HEADERS = NO # Default: YES + #--------------------------------------------------------------------------- + + ALPHABETICAL_INDEX = YES +-COLS_IN_ALPHA_INDEX = 5 + IGNORE_PREFIX = wx + + +@@ -539,15 +537,12 @@ GENERATE_TAGFILE = $(GENERATE_TAGFILE) + ALLEXTERNALS = NO + EXTERNAL_GROUPS = YES + EXTERNAL_PAGES = YES +-PERL_PATH = /usr/bin/perl +- + + #--------------------------------------------------------------------------- + # dot Tool Options + #--------------------------------------------------------------------------- + + CLASS_DIAGRAMS = YES +-MSCGEN_PATH = + DIA_PATH = + HIDE_UNDOC_RELATIONS = YES + HAVE_DOT = YES # Default: NO diff --git a/mingw-w64-wxPython/0006-grid_h.patch b/mingw-w64-wxPython/0006-grid_h.patch new file mode 100644 index 0000000000..70df7f22cd --- /dev/null +++ b/mingw-w64-wxPython/0006-grid_h.patch @@ -0,0 +1,22 @@ +diff --git "a/interface/wx/grid.h" "b/interface/wx/grid.h" +index 9584fe43..673164da 100644 +--- "a/ext\\wxWidgets\\interface\\wx\\grid.h" ++++ "b/ext\\wxWidgets\\interface\\wx\\grid.h" +@@ -6234,7 +6234,7 @@ public: + column of the newly selected cell while the previously selected cell + can be retrieved using wxGrid::GetGridCursorCol(). + */ +- virtual int GetCol(); ++ int GetCol() const; + + /** + Position in pixels at which the event occurred. +@@ -6248,7 +6248,7 @@ public: + of the newly selected cell while the previously selected cell can be + retrieved using wxGrid::GetGridCursorRow(). + */ +- virtual int GetRow(); ++ int GetRow() const; + + /** + Returns @true if the Meta key was down at the time of the event. diff --git a/mingw-w64-wxPython/001-mingw-python.patch b/mingw-w64-wxPython/001-mingw-python.patch deleted file mode 100644 index 7c039a92ed..0000000000 --- a/mingw-w64-wxPython/001-mingw-python.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- wxPython-src-3.0.2.0/wxPython/config.py.orig 2016-09-24 11:14:37.082854400 +0300 -+++ wxPython-src-3.0.2.0/wxPython/config.py 2016-09-24 11:44:18.791290600 +0300 -@@ -23,6 +23,7 @@ - import sys, os, glob, fnmatch, tempfile - import subprocess - import re -+from sysconfig import _POSIX_BUILD - - EGGing = 'bdist_egg' in sys.argv or 'egg_info' in sys.argv - if not EGGing: -@@ -311,10 +312,15 @@ - flags += ' --version=%s.%s' % (VER_MAJOR, VER_MINOR) - - searchpath = os.environ["PATH"] -- for p in searchpath.split(':'): -+ if sys.platform == 'win32': -+ psplit = ';' -+ else: -+ psplit = ':' -+ for p in searchpath.split(psplit): - fp = os.path.join(p, 'wx-config') - if os.path.exists(fp) and os.access(fp, os.X_OK): - # success -+ fp = fp.replace("\\", "/") - msg("Found wx-config: " + fp) - msg(" Using flags: " + flags) - WX_CONFIG = fp + flags -@@ -330,7 +336,7 @@ - - - def getWxConfigValue(flag): -- cmd = "%s --version=%s.%s %s" % (WX_CONFIG, VER_MAJOR, VER_MINOR, flag) -+ cmd = "%s \"%s --version=%s.%s %s\"" % ("sh -c", WX_CONFIG, VER_MAJOR, VER_MINOR, flag) - value = os.popen(cmd, 'r').read()[:-1] - return value - -@@ -506,21 +512,24 @@ - distutils.command.install_headers.install_headers.finalize_options(self) - - def run(self): -- if os.name == 'nt': -+ if os.name == 'nt' and not "MSYSTEM" in os.environ: - return - headers = self.distribution.headers - if not headers: - return - - root = self.root -+ inst_prefix = WXPREFIX -+ if _POSIX_BUILD and "MSYSTEM" in os.environ: -+ inst_prefix = os.popen(' '.join(['cygpath', '--unix', inst_prefix])).readline().strip() - #print "WXPREFIX is %s, root is %s" % (WXPREFIX, root) - # hack for universal builds, which append i386/ppc - # to the root -- if root is None or WXPREFIX.startswith(os.path.dirname(root)): -+ if root is None or inst_prefix.startswith(os.path.dirname(root)): - root = '' - for header, location in headers: - install_dir = os.path.normpath(root + -- WXPREFIX + -+ inst_prefix + - '/include/wx-%d.%d/wx' % (VER_MAJOR, VER_MINOR) + - location) - self.mkpath(install_dir) -@@ -597,7 +606,7 @@ - def findLib(name, libdirs): - name = makeLibName(name)[0] - if os.name == 'posix' or COMPILER == 'mingw32': -- lflags = getWxConfigValue('--libs') -+ lflags = getWxConfigValue('--libs all') - lflags = lflags.split() - - # if wx-config --libs output does not start with -L, wx is -@@ -658,9 +667,11 @@ - newLFLAGS = [] - for flag in lflags: - if flag[:2] == '-L': -- libdirs.append(flag[2:]) -+ libdirs.append(os.popen(' '.join(['cygpath', '-am', flag[2:]])).readline().strip()) - elif flag[:2] == '-l': - libs.append(flag[2:]) -+ elif flag[:1] == '/': -+ libs.append(os.popen(' '.join(['cygpath', '-am', flag])).readline().strip()) - else: - newLFLAGS.append(flag) - return removeDuplicates(newLFLAGS) -@@ -856,14 +867,16 @@ - # gcc needs '.res' and '.rc' compiled to object files !!! - try: - #self.spawn(["windres", "-i", src, "-o", obj]) -- self.spawn(["windres", "-i", src, "-o", obj] + -- [arg for arg in cc_args if arg.startswith("-I")] ) -+ windresflags = getWxConfigValue('--rescomp') -+ windresflags = windresflags.split() -+ self.spawn(['sh', '-c', ' '.join(windresflags + ["-i", src, "-o", obj] + -+ [arg for arg in cc_args if arg.startswith("-I")]).replace("\\", "/")]) - except DistutilsExecError, msg: - raise CompileError, msg - else: # for other files use the C-compiler - try: -- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -- extra_postargs) -+ self.spawn(['sh', '-c', ' '.join(self.compiler_so + cc_args + [src, '-o', obj] + -+ extra_postargs).replace("\\", "/")]) - except DistutilsExecError, msg: - raise CompileError, msg - -@@ -1039,7 +1052,7 @@ - else: - cflags.append('-O3') - -- lflags = getWxConfigValue('--libs') -+ lflags = getWxConfigValue('--libs all') - MONOLITHIC = (lflags.find("_xrc") == -1) - lflags = lflags.split() - diff --git a/mingw-w64-wxPython/002-system-includes.patch b/mingw-w64-wxPython/002-system-includes.patch deleted file mode 100644 index a06239b3e0..0000000000 --- a/mingw-w64-wxPython/002-system-includes.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/wxPython/src/wxc.rc.orig 2014-09-30 13:50:42.005946900 +0400 -+++ b/wxPython/src/wxc.rc 2014-09-30 13:51:10.565847000 +0400 -@@ -1,4 +1,4 @@ --#include "wx/msw/wx.rc" -+#include - - - diff --git a/mingw-w64-wxPython/003-fix-cast-error.patch b/mingw-w64-wxPython/003-fix-cast-error.patch deleted file mode 100644 index 6ad434f9fe..0000000000 --- a/mingw-w64-wxPython/003-fix-cast-error.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- wxPython-src-3.0.1.1/wxPython/src/helpers.cpp.orig 2014-09-30 15:35:54.001641700 +0400 -+++ wxPython-src-3.0.1.1/wxPython/src/helpers.cpp 2014-09-30 15:40:54.393928800 +0400 -@@ -2152,7 +2152,7 @@ - long wxPyGetWinHandle(wxWindow* win) { - - #ifdef __WXMSW__ -- return (long)win->GetHandle(); -+ return (intptr_t)win->GetHandle(); - #endif - - #if defined(__WXGTK__) || defined(__WXX11__) diff --git a/mingw-w64-wxPython/004-plot-fix.patch b/mingw-w64-wxPython/004-plot-fix.patch deleted file mode 100644 index d812d66e74..0000000000 --- a/mingw-w64-wxPython/004-plot-fix.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 25bcbf15615b64e095da75e934ea4d254998ec24 Mon Sep 17 00:00:00 2001 -From: Robin Dunn -Date: Wed, 11 Mar 2015 14:37:20 -0700 -Subject: [PATCH] We need to use wx.CursorFromImage on Classic - ---- - wxPython/wx/lib/plot.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/wxPython/wx/lib/plot.py b/wxPython/wx/lib/plot.py -index 94696c56b7..e166645863 100644 ---- a/wxPython/wx/lib/plot.py -+++ b/wxPython/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 -Date: Wed, 25 Mar 2015 15:34:49 -0700 -Subject: [PATCH] Revert some more Phoenix-only changes. - ---- - wxPython/wx/lib/plot.py | 25 +++++++++++++------------ - 1 file changed, 13 insertions(+), 12 deletions(-) - -diff --git a/wxPython/wx/lib/plot.py b/wxPython/wx/lib/plot.py -index e166645863..102c35cc84 100644 ---- a/wxPython/wx/lib/plot.py -+++ b/wxPython/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() diff --git a/mingw-w64-wxPython/0100-wxPython-wxHandleFatalExceptions.patch b/mingw-w64-wxPython/0100-wxPython-wxHandleFatalExceptions.patch new file mode 100644 index 0000000000..8b1eea3aff --- /dev/null +++ b/mingw-w64-wxPython/0100-wxPython-wxHandleFatalExceptions.patch @@ -0,0 +1,61 @@ +From 3197c46797a3e98bed5f4e6a22c765a2b7b6421d Mon Sep 17 00:00:00 2001 +From: Robin Dunn +Date: Mon, 18 Jan 2021 14:15:57 -0800 +Subject: [PATCH 1/2] Add support for using setCppCode on function objects + +--- + etgtools/sip_generator.py | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/etgtools/sip_generator.py b/etgtools/sip_generator.py +index 1621fdd43..38db80b1d 100644 +--- a/etgtools/sip_generator.py ++++ b/etgtools/sip_generator.py +@@ -206,7 +206,14 @@ def generateFunction(self, function, stream, _needDocstring=True): + stream.write(nci(code, 4)) + stream.write('%End\n') + elif codeType == 'function': +- raise NotImplementedError() # TODO: See generateMethod for an example, refactor to share code... ++ ## raise NotImplementedError() # TODO: See generateMethod for an example, refactor to share code... ++ cm = extractors.CppMethodDef.FromMethod(function) ++ cm.body = code ++ self.generateCppMethod(cm, stream, "", skipDeclaration=True) ++ # generateCppMethod will have already done the overloads ++ # and virtual catcher code, so we can just return from ++ # here. ++ return + for f in function.overloads: + self.generateFunction(f, stream, _needDocstring) + stream.write('\n') + +From 91a205fb172d4a7979fce7941195103b86328223 Mon Sep 17 00:00:00 2001 +From: Robin Dunn +Date: Mon, 18 Jan 2021 14:16:59 -0800 +Subject: [PATCH 2/2] Provide a stubbed version of wxHandleFatalExceptions + based on wxUSE_ON_FATAL_EXCEPTION + +--- + etg/app.py | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/etg/app.py b/etg/app.py +index 9416d9a58..cbdf11913 100644 +--- a/etg/app.py ++++ b/etg/app.py +@@ -209,6 +209,16 @@ def run(): + + #------------------------------------------------------- + ++ module.find('wxHandleFatalExceptions').setCppCode("""\ ++ #if wxUSE_ON_FATAL_EXCEPTION ++ return wxHandleFatalExceptions(doIt); ++ #else ++ wxLogInfo("This build of wxWidgets does not support wxHandleFatalExceptions."); ++ return false; ++ #endif ++ """) ++ ++ #------------------------------------------------------- + + module.addHeaderCode("""\ + enum wxAppAssertMode { diff --git a/mingw-w64-wxPython/PKGBUILD b/mingw-w64-wxPython/PKGBUILD index f5d8628fcc..227186b5a3 100644 --- a/mingw-w64-wxPython/PKGBUILD +++ b/mingw-w64-wxPython/PKGBUILD @@ -3,85 +3,94 @@ _realname=wxPython pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=3.0.2.0 -_editraver=0.7.20 -pkgrel=10 +pkgver=4.1.1 +pkgrel=1 pkgdesc="A wxWidgets GUI toolkit for Python (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') license=("custom:wxWindows") url="https://www.wxpython.org/" -depends=("${MINGW_PACKAGE_PREFIX}-python2" - "${MINGW_PACKAGE_PREFIX}-wxWidgets") -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc") +depends=("${MINGW_PACKAGE_PREFIX}-python" + $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo \ + "${MINGW_PACKAGE_PREFIX}-python-numpy" ) + "${MINGW_PACKAGE_PREFIX}-python-pillow" + "${MINGW_PACKAGE_PREFIX}-python-six" + "${MINGW_PACKAGE_PREFIX}-wxWidgets3.1") +makedepends=("${MINGW_PACKAGE_PREFIX}-doxygen" + "${MINGW_PACKAGE_PREFIX}-python-requests" + "${MINGW_PACKAGE_PREFIX}-sip4" + "${MINGW_PACKAGE_PREFIX}-waf" + # for waf + "python" "python-setuptools") options=('strip' 'staticlibs' 'buildflags') -source=(https://downloads.sourceforge.net/wxpython/${_realname}-src-${pkgver}.tar.bz2 - #https://editra.googlecode.com/files/Editra-${_editraver}.tar.gz - 001-mingw-python.patch - 002-system-includes.patch - 003-fix-cast-error.patch - 004-plot-fix.patch) -sha256sums=('d54129e5fbea4fb8091c87b2980760b72c22a386cb3b9dd2eebc928ef5e8df61' - '61ca97f814b85b1274e751c694f9e3adc31ce1e22c56c9ca9c59e0337a36fef5' - 'bea571dfdade2c7b15e1feaf260834d571f49c36101a420104b933c3597f7ebf' - 'd7c4de5594149d2bba4a0ceb95d6a6a0c3c0e43ab9e876dce22440ccaad3b5f0' - '6280e51dc8be1187b2b5a3cc35e08721bf9c2b5e3dacc8d08bc25bd0bdc3aea1') +source=("https://files.pythonhosted.org/packages/b0/4d/80d65c37ee60a479d338d27a2895fb15bbba27a3e6bb5b6d72bb28246e99/${_realname}-${pkgver}.tar.gz" + "0001-wxWidgets-win-from-cygwin.patch" + "0002-handle-cast.patch" + "0003-wxWidgets.Doxyfile.patch" + "0006-grid_h.patch" + "0100-wxPython-wxHandleFatalExceptions.patch") +noextract=("${_realname}-${pkgver}.tar.gz") +sha256sums=('00e5e3180ac7f2852f342ad341d57c44e7e4326de0b550b9a5c4a8361b6c3528' + '88cc6c7c9cdb6dd6f8e7a74356b275262f4e8d920d64bae987408ee2ff651bc1' + '7af6ee0a93cfd5d5a621ed09ba91a42a017c8c42a2ff4936b98bdf4014086359' + 'f0216f2e38f338d52311a963b976f17998a4754b4c5ab2698074c08ab4104538' + 'fc786aa69d9070ef0f8e4663798916323256f5c87ea9dd8cb12b68230eabddb8' + 'f2416985340363453c44b62c659d378e345a1e1b28c2173bbad2671a751cf844') prepare() { - cd "${srcdir}/${_realname}-src-${pkgver}" - patch -p1 -i ${srcdir}/001-mingw-python.patch - patch -p1 -i ${srcdir}/002-system-includes.patch - patch -p1 -i ${srcdir}/003-fix-cast-error.patch - patch -p1 -i ${srcdir}/004-plot-fix.patch - - #cd ${srcdir} - find . -type f -exec sed -i 's/env python/env python2/' {} \; - #sed -i 's/sys.exit(1)//' Editra-${_editraver}/setup.py + plain "Extracting ${_realname}-${pkgver}.tar.gz due to symlink(s) without pre-existing target(s)" + cd "${srcdir}" + [[ -d ${_realname}-${pkgver} ]] && rm -rf ${_realname}-${pkgver} + tar zxf "${srcdir}/${_realname}-${pkgver}.tar.gz" || true + cd "${srcdir}/${_realname}-${pkgver}" + rm -f etg/{_,}webkit.py sip/gen/{_,}webkit.sip + patch -Np1 -i "${srcdir}/0001-wxWidgets-win-from-cygwin.patch" + # clang doesn't like casting from pointer to smaller integer type (long) + # https://github.com/wxWidgets/Phoenix/pull/1972 + patch -Np1 -i "${srcdir}/0002-handle-cast.patch" + patch -Np1 -i "${srcdir}/0003-wxWidgets.Doxyfile.patch" + patch -Np1 -i "${srcdir}/0006-grid_h.patch" + # https://github.com/wxWidgets/Phoenix/commit/3500ac7a9e7377c154a507dd7ea1b5b7bfda8c09 + patch -Np1 -i "${srcdir}/0100-wxPython-wxHandleFatalExceptions.patch" } build() { - #[[ -d ${srcdir}/build-${CARCH} ]] && rm -rf ${srcdir}/build-${CARCH} - #mkdir -p ${srcdir}/build-${CARCH} && cd ${srcdir}/build-${CARCH} - export PYTHON=${MINGW_PREFIX}/bin/python2 - cd ${_realname}-src-${pkgver} - ./configure \ - --prefix=${MINGW_PREFIX} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} \ - --build=${MINGW_CHOST} \ - --with-msw \ - --disable-mslu \ - --enable-shared \ - --enable-iniconf \ - --enable-iff \ - --enable-permissive \ - --disable-monolithic \ - --disable-mediactrl \ - --enable-unicode \ - --enable-accessibility \ - --disable-precomp-headers + cd "${srcdir}/${_realname}-${pkgver}" + export PYTHONDONTWRITEBYTECODE=1 + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + WAF="{$MINGW_PREFIX}/bin/waf" \ + SIP="${MINGW_PREFIX}/bin/sip" \ + DOXYGEN="${MINGW_PREFIX}/bin/doxygen" \ + WX_CONFIG="${MINGW_PREFIX}/bin/wx-config-3.1" \ + "${MINGW_PREFIX}/bin/python" build.py \ + --prefix="${MINGW_PREFIX}" --python="${MINGW_PREFIX}/bin/python.exe" \ + --release --use_syswx --no_msedge --nodoc --cairo --verbose \ + --no_allmo --no_magic --regenerate_sysconfig \ + dox touch etg sip - cd wxPython - MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=;--install-headers=;-install-data=" \ - ${MINGW_PREFIX}/bin/python2 setup.py WXPORT=msw BUILD_ACTIVEX=0 UNICODE=1 COMPILER=mingw32 build - #make VERBOSE=1 + local _jobs=${MAKEFLAGS:--j1} + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + CC_NAME=${CC} CXX_NAME=${CXX} \ + LDFLAGS="${LDFLAGS} $(python-config --ldflags)" \ + PYTHON_CONFIG="${MINGW_PREFIX}/bin/python-config" \ + "${MINGW_PREFIX}/bin/waf" \ + --prefix="${MINGW_PREFIX}" --python="${MINGW_PREFIX}/bin/python.exe" \ + --check-cxx-compiler=${CXX} --check-c-compiler=${CC} --color=yes --jobs=${_jobs#-j} \ + --wx_config=wx-config-3.1 \ + --no_magic --nopyc --nopyo --nopycache \ + configure build } package() { - cd "${srcdir}/wxPython-src-${pkgver}/wxPython" - MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=;--install-headers=;-install-data=" \ - ${MINGW_PREFIX}/bin/python2 setup.py NO_HEADERS=0 WXPORT=msw BUILD_ACTIVEX=0 UNICODE=1 COMPILER=mingw32 \ - install --prefix=${MINGW_PREFIX} --root="${pkgdir}" + cd "${srcdir}/${_realname}-${pkgver}" + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + "${MINGW_PREFIX}/bin/python" setup.py install \ + --prefix="${MINGW_PREFIX}" --root="${pkgdir}" --skip-build - install -D -m644 ../docs/licence.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" - - local _dir=$(cygpath -am ${MINGW_PREFIX}) - for _f in ${pkgdir}${MINGW_PREFIX}/bin/*; do - sed -e "s|${_dir}|${MINGW_PREFIX}|g" -i ${_f} + # remove shebang line + for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do + sed -e '1 { s/^#!.*$// }' -i ${_f} done - #cd "${srcdir}/Editra-${_editraver}" - #MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ - #${MINGW_PREFIX}/bin/python2 setup.py install --root="${pkgdir}" --prefix=${MINGW_PREFIX} - #rm -r "${pkgdir}${MINGW_PREFIX}/lib/python2.7/site-packages/wx-3.0-gtk2/wx/tools/Editra" + install -vDm 644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/$_realname/LICENSE.txt" }