Commit b11b9faa authored by Scott Talbert's avatar Scott Talbert

d/patches: Fix FTBFS with SIP 4.19.14 (Closes: #924856)

parent fee6fd19
wxpython4.0 (4.0.4+dfsg-2) unstable; urgency=medium
* d/patches: Fix FTBFS with SIP 4.19.14 (Closes: #924856)
-- Scott Talbert <swt@techie.net> Mon, 01 Apr 2019 22:41:28 -0400
wxpython4.0 (4.0.4+dfsg-1) unstable; urgency=medium
* Update d/copyright and d/watch to use uscan repack mechanism vs. repack.sh
......
From 3636ba3e606e3080942427beb68528f11cfb408e Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Fri, 22 Mar 2019 23:17:31 -0400
Subject: [PATCH 1/2] Fix building with SIP 4.19.14
This commit fixes building Phoenix with SIP 4.19.14. One of the main changes
in this release was to add SIP_OVERRIDE, which adds the C++ override keyword
to method declarations that are intended to override the C++ class that SIP
is wrapping. Unfortunately, this exposed a few bugs which caused compile
errors. Most of the fixes are to the interface headers. The two trickier
fixes were to wxFileConfig and wxRendererNative.
For wxFileConfig, the Save method's second parameter, 'conv', had been ignored.
This caused the override check to fail. This was resolved by ignoring the
auto-generated Save() and adding a manually generated one without the second
parameter.
For wxRendererNative, the DrawTitleBarBitmap method is actually pure virtual
in the subclass, so the fix was to ignore it there. In the subclass
wxDelegateRendererNative, it is concrete, but only on certain platforms. This
was fixed in a similar way by adding a manually generated method that will
do the right thing on the platforms that support it.
There is one other fix required for SIP 4.19.14: SIP has now added its own
wrapper for size_t, so it required removing the one in wacky_ints. This change
was omitted for now because it should probably wait until Phoenix officially
moves to 4.19.14.
---
etg/config.py | 10 +++++++++-
etg/printfw.py | 1 -
etg/renderer.py | 18 +++++++++++-------
etg/statbox.py | 2 +-
ext/wxWidgets | 2 +-
5 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/etg/config.py b/etg/config.py
index 8675e751..299f63b2 100644
--- a/etg/config.py
+++ b/etg/config.py
@@ -179,7 +179,7 @@ def run():
c.find('wxFileConfig').findOverload('wxInputStream').find('conv').ignore()
ctor = c.find('wxFileConfig').findOverload('wxString').find('conv').ignore()
#ctor.items.remove(ctor.find('conv'))
- ctor = c.find('Save').find('conv').ignore()
+ c.find('Save').ignore()
c.find('GetGlobalFile').ignore()
c.find('GetLocalFile').ignore()
@@ -188,6 +188,14 @@ def run():
c.find('GetFirstEntry').ignore()
c.find('GetNextEntry').ignore()
+ c.addCppMethod('bool', 'Save', '(wxOutputStream& os)', doc=c.find('Save').briefDoc, body="""\
+ #if wxUSE_STREAMS
+ return self->Save(*os);
+ #else
+ wxPyRaiseNotImplemented();
+ #endif
+ """)
+
#-----------------------------------------------------------------
diff --git a/etg/printfw.py b/etg/printfw.py
index 0d0500ff..90f5f75a 100644
--- a/etg/printfw.py
+++ b/etg/printfw.py
@@ -61,7 +61,6 @@ def run():
c.find('CreateCanvas').isVirtual = True
c.find('CreateControlBar').isVirtual = True
c.find('Initialize').isVirtual = True
- c.find('InitializeWithModality').isVirtual = True
diff --git a/etg/renderer.py b/etg/renderer.py
index 2319b62d..eea14676 100644
--- a/etg/renderer.py
+++ b/etg/renderer.py
@@ -43,25 +43,29 @@ def run():
c.find('GetGeneric').mustHaveApp()
c.find('GetDefault').mustHaveApp()
c.find('Set').mustHaveApp()
+ c.find('DrawTitleBarBitmap').ignore()
+ draw_tb_bmp_doc = c.find('DrawTitleBarBitmap').briefDoc
+
+
+ c = module.find('wxDelegateRendererNative')
+ c.mustHaveApp()
+ c.addPrivateCopyCtor()
#virtual void DrawTitleBarBitmap(wxWindow *win,
# wxDC& dc,
# const wxRect& rect,
# wxTitleBarButton button,
- # int flags = 0) = 0;
- c.find('DrawTitleBarBitmap').setCppCode("""\
+ # int flags = 0);
+ c.addCppMethod('void', 'DrawTitleBarBitmap', '(wxWindow* win, wxDC& dc, const wxRect& rect, wxTitleBarButton button, int flags = 0)', doc=draw_tb_bmp_doc, body="""\
#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
self->DrawTitleBarBitmap(win, *dc, *rect, button, flags);
+ #else
+ wxPyRaiseNotImplemented();
#endif
""")
- c = module.find('wxDelegateRendererNative')
- c.mustHaveApp()
- c.addPrivateCopyCtor()
-
-
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
diff --git a/etg/statbox.py b/etg/statbox.py
index 2fdcb0bf..6274d376 100644
--- a/etg/statbox.py
+++ b/etg/statbox.py
@@ -41,7 +41,7 @@ def run():
# This is intentionally not documented, but I think it would be handy to
# use from wxPython.
- meth = MethodDef(name='GetBordersForSizer', isVirtual=True, type='void', protection='public',
+ meth = MethodDef(name='GetBordersForSizer', isConst=True, isVirtual=True, type='void', protection='public',
briefDoc="Returns extra space that may be needed for borders within a StaticBox.",
items=[ParamDef(name='borderTop', type='int*', out=True),
ParamDef(name='borderOther', type='int*', out=True),
--
2.20.1
From d24b9713c4526593c6052be0fd2f65e9427a8405 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Sun, 17 Mar 2019 22:23:55 -0400
Subject: [PATCH 2/2] Remove MappedType for size_t as SIP added native support
in 4.19.14
---
src/wacky_ints.sip | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/src/wacky_ints.sip b/src/wacky_ints.sip
index 4677e537..7fd804a5 100644
--- a/src/wacky_ints.sip
+++ b/src/wacky_ints.sip
@@ -13,35 +13,6 @@
//--------------------------------------------------------------------------
-// size_t will either be equivalent to an unsigned long, or to an
-// unsigned long long. wxWidgets' configure script has already figured out
-// which it is, so we can make it conditional on those results.
-
-%MappedType size_t {
-
- %TypeHeaderCode
- #include <wxPython/wxpy_api.h>
- %End
-
- %ConvertToTypeCode
- // Allow conversions from any number type
- if (!sipIsErr) {
- if (PyNumber_Check(sipPy))
- return TRUE;
- return FALSE;
- }
-
- // Do the conversion
- *sipCppPtr = new size_t(wxPyInt_AsSize_t(sipPy));
- return sipGetState(sipTransferObj);
- %End
-
- %ConvertFromTypeCode
- return wxPyInt_FromSize_t(*sipCpp);
- %End
-};
-
-
// This type is a signed integer value that is large enough to hold a
// pointer. Again we'll use the results of wxWidgets configuration.
%MappedType wxIntPtr {
--
2.20.1
From 3a04a456397926c16588bbedfd3fbbf819a42948 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Fri, 22 Mar 2019 10:36:59 -0400
Subject: [PATCH] Fix inconsistent function declarations in documentation
Mostly remove the virtual keyword where the actual implementation isn't
virtual.
(Backport of ac18cfe7cc1c7c6f8e545ccdcb1a947392c3f320 plus some additional
fixes that were already in master.)
---
interface/wx/dataview.h | 6 +++---
interface/wx/grid.h | 2 +-
interface/wx/html/winpars.h | 2 +-
interface/wx/image.h | 2 +-
interface/wx/intl.h | 10 +++++-----
interface/wx/print.h | 2 +-
interface/wx/propgrid/propgridiface.h | 2 +-
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/ext/wxWidgets/interface/wx/dataview.h b/ext/wxWidgets/interface/wx/dataview.h
index 81bcd5adfde..658986a706c 100644
--- a/ext/wxWidgets/interface/wx/dataview.h
+++ b/ext/wxWidgets/interface/wx/dataview.h
@@ -132,7 +132,7 @@ class wxDataViewModel : public wxRefCounter
Called to inform the model that all data has been cleared.
The control will reread the data from the model again.
*/
- virtual bool Cleared();
+ bool Cleared();
/**
The compare function to be used by control. The default compare function
@@ -336,8 +336,8 @@ class wxDataViewModel : public wxRefCounter
This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
event to the user.
*/
- virtual bool ValueChanged(const wxDataViewItem& item,
- unsigned int col);
+ bool ValueChanged(const wxDataViewItem& item,
+ unsigned int col);
virtual bool IsListModel() const;
diff --git a/ext/wxWidgets/interface/wx/grid.h b/ext/wxWidgets/interface/wx/grid.h
index ff2cb695ec4..35554268d5c 100644
--- a/ext/wxWidgets/interface/wx/grid.h
+++ b/ext/wxWidgets/interface/wx/grid.h
@@ -446,7 +446,7 @@ class wxGridCellEditor : public wxClientDataContainer, public wxRefCounter
Draws the part of the cell not occupied by the control: the base class
version just fills it with background colour from the attribute.
*/
- virtual void PaintBackground(wxDC& dc, const wxRect& rectCell, wxGridCellAttr& attr);
+ virtual void PaintBackground(wxDC& dc, const wxRect& rectCell, const wxGridCellAttr& attr);
/**
Reset the value in the control back to its starting value.
diff --git a/ext/wxWidgets/interface/wx/html/winpars.h b/ext/wxWidgets/interface/wx/html/winpars.h
index 6e7d0158fa9..5e629c955f0 100644
--- a/ext/wxWidgets/interface/wx/html/winpars.h
+++ b/ext/wxWidgets/interface/wx/html/winpars.h
@@ -59,7 +59,7 @@ class wxHtmlWinTagHandler : public wxHtmlTagHandler
Assigns @a parser to this handler. Each @b instance of handler
is guaranteed to be called only from the one parser.
*/
- virtual void SetParser(wxHtmlWinParser* parser);
+ virtual void SetParser(wxHtmlParser* parser);
protected:
/**
diff --git a/ext/wxWidgets/interface/wx/image.h b/ext/wxWidgets/interface/wx/image.h
index e3735d4d3cb..242800be0b6 100644
--- a/ext/wxWidgets/interface/wx/image.h
+++ b/ext/wxWidgets/interface/wx/image.h
@@ -224,7 +224,7 @@ class wxImageHandler : public wxObject
for which this function returns the number of frames in the
animation).
*/
- virtual int GetImageCount(wxInputStream& stream);
+ int GetImageCount(wxInputStream& stream);
/**
Gets the MIME type associated with this handler.
diff --git a/ext/wxWidgets/interface/wx/intl.h b/ext/wxWidgets/interface/wx/intl.h
index 357fa93a71b..fa443d9d042 100644
--- a/ext/wxWidgets/interface/wx/intl.h
+++ b/ext/wxWidgets/interface/wx/intl.h
@@ -362,15 +362,15 @@ class wxLocale
/**
Calls wxGetTranslation(const wxString&, const wxString&).
*/
- virtual const wxString& GetString(const wxString& origString,
- const wxString& domain = wxEmptyString) const;
+ const wxString& GetString(const wxString& origString,
+ const wxString& domain = wxEmptyString) const;
/**
Calls wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&).
*/
- virtual const wxString& GetString(const wxString& origString,
- const wxString& origString2, unsigned n,
- const wxString& domain = wxEmptyString) const;
+ const wxString& GetString(const wxString& origString,
+ const wxString& origString2, unsigned n,
+ const wxString& domain = wxEmptyString) const;
/**
Returns current platform-specific locale name as passed to setlocale().
diff --git a/ext/wxWidgets/interface/wx/print.h b/ext/wxWidgets/interface/wx/print.h
index 1a16f1d08e3..ebd5ba18d0e 100644
--- a/ext/wxWidgets/interface/wx/print.h
+++ b/ext/wxWidgets/interface/wx/print.h
@@ -262,7 +262,7 @@ class wxPreviewFrame : public wxFrame
@since 2.9.2
*/
- virtual void InitializeWithModality(wxPreviewFrameModalityKind kind);
+ void InitializeWithModality(wxPreviewFrameModalityKind kind);
/**
Enables any disabled frames in the application, and deletes the print preview
diff --git a/ext/wxWidgets/interface/wx/propgrid/propgridiface.h b/ext/wxWidgets/interface/wx/propgrid/propgridiface.h
index 7f30c0038e3..2186f8df999 100644
--- a/ext/wxWidgets/interface/wx/propgrid/propgridiface.h
+++ b/ext/wxWidgets/interface/wx/propgrid/propgridiface.h
@@ -596,7 +596,7 @@ class wxPropertyGridInterface
/**
Returns true if property is selected.
*/
- virtual bool IsPropertySelected( wxPGPropArg id ) const;
+ bool IsPropertySelected( wxPGPropArg id ) const;
/**
Returns @true if property is shown (ie. HideProperty() with @true not
......@@ -3,3 +3,6 @@ lib-copy-destination.patch
fix-joystick-stubs.patch
fix-vlbox-test.patch
fix-access-test.patch
fix-build-sip-4.19.14-1.patch
fix-build-sip-4.19.14-2.patch
fix-build-sip-4.19.14-3.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment