File: unbundle-sip.patch

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (201 lines) | stat: -rw-r--r-- 7,306 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
From 56c264844d6336f8b173525554d302f05c66a463 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 7 Jan 2019 21:10:25 -0500
Subject: [PATCH] Unbundle sip

---
 buildtools/config.py         |  1 -
 etg/dataview.py              |  4 ++--
 etg/grid.py                  |  4 ++--
 etg/sizer.py                 |  4 ++--
 etg/window.py                |  4 ++--
 unittests/test_dc.py         | 10 +++++-----
 wscript                      | 27 +--------------------------
 wx/lib/gizmos/dynamicsash.py |  6 +++---
 8 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/buildtools/config.py b/buildtools/config.py
index 8b872343..11194053 100644
--- a/buildtools/config.py
+++ b/buildtools/config.py
@@ -121,7 +121,6 @@ class Configuration(object):
                          '-w',    # enable warnings
                          '-o',    # turn on auto-docstrings
                          '-g',    # turn on acquire/release of GIL for everything
-                         '-n', 'wx.siplib', # name of the module containing the siplib
                          #'-e',    # turn on exceptions support
                          #'-T',    # turn off writing the timestamp to the generated files
                          #'-r',    # turn on function call tracing
diff --git a/etg/dataview.py b/etg/dataview.py
index 37e40e6b..6a1de4d1 100644
--- a/etg/dataview.py
+++ b/etg/dataview.py
@@ -372,8 +372,8 @@ def run():
             is reference counted so it can be shared with other views.
             """,
         body="""\
-            import wx.siplib
-            wasPyOwned = wx.siplib.ispyowned(model)
+            import sip
+            wasPyOwned = sip.ispyowned(model)
             self._AssociateModel(model)
             # Ownership of the python object has just been transferred to
             # C++, so DecRef the C++ instance associated with this python
diff --git a/etg/grid.py b/etg/grid.py
index e98f331c..dbe77f22 100644
--- a/etg/grid.py
+++ b/etg/grid.py
@@ -446,8 +446,8 @@ def run():
         body="""\
             val = self._SetTable(table, takeOwnership, selmode)
             if takeOwnership:
-                import wx.siplib
-                wx.siplib.transferto(table, self)
+                import sip
+                sip.transferto(table, self)
             return val
         """)
 
diff --git a/etg/sizer.py b/etg/sizer.py
index 2f6d7f4f..8d1a51e3 100644
--- a/etg/sizer.py
+++ b/etg/sizer.py
@@ -148,8 +148,8 @@ def run():
             "    if theSizer:\n"
             "        doSomething()",
         body="""\
-        import wx.siplib
-        return not wx.siplib.isdeleted(self)
+        import sip
+        return not sip.isdeleted(self)
         """)
 
     c.addPyMethod('__iter__', '(self)',
diff --git a/etg/window.py b/etg/window.py
index a6b85e5e..5c8260a2 100644
--- a/etg/window.py
+++ b/etg/window.py
@@ -178,8 +178,8 @@ def run():
             "    if theWindow:\n"
             "        doSomething()",
         body="""\
-        import wx.siplib
-        return not wx.siplib.isdeleted(self)
+        import sip
+        return not sip.isdeleted(self)
         """)
     c.addPyCode('Window.__bool__ = Window.__nonzero__') # For Python 3
 
diff --git a/unittests/test_dc.py b/unittests/test_dc.py
index 525d9694..f70ccba6 100644
--- a/unittests/test_dc.py
+++ b/unittests/test_dc.py
@@ -176,17 +176,17 @@ class dc_Tests(wtc.WidgetTestCase):
 
 
     def test_dcContextManager(self):
-        import wx.siplib
+        import sip
         with wx.ClientDC(self.frame) as dc:
             dc.DrawLine(0,0,100,100)
 
             # check ownership
-            assert wx.siplib.ispyowned(dc)
-            assert not wx.siplib.isdeleted(dc)
+            assert sip.ispyowned(dc)
+            assert not sip.isdeleted(dc)
 
         # check the DC's ownership has changed
-        assert not wx.siplib.ispyowned(dc)
-        assert wx.siplib.isdeleted(dc)
+        assert not sip.ispyowned(dc)
+        assert sip.isdeleted(dc)
 
 
 #---------------------------------------------------------------------------
diff --git a/wscript b/wscript
index a50904d1..4f4ae337 100644
--- a/wscript
+++ b/wscript
@@ -104,7 +104,7 @@ def configure(conf):
     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', 'wx/include', 'src']
+    conf.env.INCLUDES_WXPY = ['wx/include', 'src']
 
     if isWindows:
         # Windows/MSVC specific stuff
@@ -292,13 +292,6 @@ def configure(conf):
         conf.env.CFLAGS_WXPY.append('-UNDEBUG')
         conf.env.CXXFLAGS_WXPY.append('-UNDEBUG')
 
-        # set the name of our siplib module
-        conf.env.CFLAGS_WXPY.append('-DSIP_MODULE_NAME=wx.siplib')
-        conf.env.CXXFLAGS_WXPY.append('-DSIP_MODULE_NAME=wx.siplib')
-
-        conf.env.CFLAGS_WXPY.append('-DSIP_MODULE_BASENAME=siplib')
-        conf.env.CXXFLAGS_WXPY.append('-DSIP_MODULE_BASENAME=siplib')
-
         # Add basic debug info for all builds
         conf.env.CFLAGS_WXPY.append('-g')
         conf.env.CXXFLAGS_WXPY.append('-g')
@@ -547,24 +540,6 @@ def build(bld):
 
 
     # 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')
diff --git a/wx/lib/gizmos/dynamicsash.py b/wx/lib/gizmos/dynamicsash.py
index 2fed6597..18facc4a 100644
--- a/wx/lib/gizmos/dynamicsash.py
+++ b/wx/lib/gizmos/dynamicsash.py
@@ -16,7 +16,7 @@ reunified through the user interface.
 """
 
 import wx
-import wx.siplib
+import sip
 
 #----------------------------------------------------------------------------
 # Styles
@@ -942,7 +942,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler):
         # we'll just save the object's address instead, and then use that to
         # fetch the real proxy object when it's needed later.
         self.m_child = None
-        self.m_child_ptr = wx.siplib.unwrapinstance(window)
+        self.m_child_ptr = sip.unwrapinstance(window)
 
         # Delay the reparenting until after the AddChild has finished.
         event = _DynamicSashReparentEvent(self)
@@ -951,7 +951,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler):
 
     def _checkPendingChild(self):
         if hasattr(self, 'm_child_ptr'):
-            self.m_child = wx.siplib.wrapinstance(self.m_child_ptr, wx.Object)
+            self.m_child = sip.wrapinstance(self.m_child_ptr, wx.Object)
             del self.m_child_ptr
 
 
-- 
2.20.1