wxPython4: update to 4.2.1, rename to wxPython

This commit is contained in:
Andrew J. Hesford 2023-09-25 07:53:19 -04:00
parent 99996d8f99
commit dfa1da5bb0
9 changed files with 36 additions and 212 deletions

View file

@ -0,0 +1,15 @@
Taken from Alpine:
https://git.alpinelinux.org/aports/plain/community/py3-wxpython/no-stacktrace.patch
--- a/sip/cpp/sip_corewxAppTraits.cpp
+++ b/sip/cpp/sip_corewxAppTraits.cpp
@@ -471,7 +471,7 @@
PyErr_Clear();
Py_BEGIN_ALLOW_THREADS
- sipRes = new ::wxString((sipSelfWasArg ? sipCpp-> ::wxAppTraits::GetAssertStackTrace() : sipCpp->GetAssertStackTrace()));
+ sipRes = new ::wxString("");
Py_END_ALLOW_THREADS
if (PyErr_Occurred())

View file

@ -1,7 +1,7 @@
# Template file for 'wxPython4'
pkgname=wxPython4
version=4.0.7
revision=7
# Template file for 'wxPython'
pkgname=wxPython
version=4.2.1
revision=1
build_style=python3-module
make_build_args="--skip-build"
make_install_args="--skip-build"
@ -9,23 +9,25 @@ hostmakedepends="pkg-config python3-setuptools python3-pathlib2"
makedepends="python3-devel wxWidgets-gtk3-devel SDL2-devel webkit2gtk-devel
gst-plugins-base1-devel"
depends="python3 python3-six python3-numpy python3-Pillow"
short_desc="WxWidgets GUI toolkit library (Python3 Bindings)"
short_desc="Python bindings for wxWidgets"
maintainer="Orphaned <orphan@voidlinux.org>"
license="custom:wxWindows"
homepage="http://www.wxpython.org/"
distfiles="${PYPI_SITE}/w/wxPython/wxPython-${version}.tar.gz"
checksum=3be608bfdede3063678cc703453850ab0a018b82bafd5ee057302250b18f0233
checksum=e48de211a6606bf072ec3fa778771d6b746c00b7f4b970eb58728ddf56d13d5c
export WXPYTHON_RELEASE=yes
if [ "$CROSS_BUILD" ]; then
CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
export WX_CONFIG="${XBPS_WRAPPERDIR}/wx-config-gtk3"
else
export WX_CONFIG=wx-config-gtk3
fi
pre_patch() {
# need to patch for Python 3.11, extract them now.
cd bin
sed '/__name__.*__main__/i sys.exit(0)' waf-* >tmp-waf
python3 tmp-waf
ln -s .waf3-* .waf3
post_patch() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
patch -Np1 < "${FILESDIR}/no-stacktrace.patch"
fi
}
pre_build() {
@ -48,3 +50,9 @@ pre_build() {
post_install() {
vlicense LICENSE.txt
}
wxPython4_package() {
build_style=meta
short_desc+=" - transitional dummy package"
depends="${sourcepkg}>=${version}_${revision}"
}

1
srcpkgs/wxPython4 Symbolic link
View file

@ -0,0 +1 @@
wxPython

View file

@ -1,52 +0,0 @@
From cddbe3b3b237b8e63abd8921fdb20314c20c2c08 Mon Sep 17 00:00:00 2001
From: Jasper Chan <jasperchan515@gmail.com>
Date: Sat, 22 Sep 2018 20:59:29 -0700
Subject: [PATCH] Switch to wx-config-gtk3 to avoid conflict with
wxWidgets-gtk2
---
build.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git build.py build.py
index 3cd5b828..57dbd384 100755
--- a/build.py
+++ b/build.py
@@ -400,7 +400,7 @@ def makeOptionParser():
("mac_arch", ("", "Comma separated list of architectures to build on Mac")),
("use_syswx", (False, "Try to use an installed wx rather than building the "
- "one in this source tree. The wx-config in {prefix}/bin "
+ "one in this source tree. The wx-config-gtk3 in {prefix}/bin "
"or the first found on the PATH determines which wx is "
"used. Implies --no_magic.")),
("force_config", (False, "Run configure when building even if the script "
@@ -1271,7 +1271,7 @@ def cmd_build_wx(options, args):
os.path.join(wxDir(), 'configure'),
os.path.join(wxDir(), 'setup.h.in'),
os.path.join(wxDir(), 'version-script.in'),
- os.path.join(wxDir(), 'wx-config.in'),
+ os.path.join(wxDir(), 'wx-config-gtk3.in'),
]
for dep in dependencies:
if newer(dep, os.path.join(BUILD_DIR, "Makefile")):
@@ -1424,13 +1424,13 @@ def cmd_build_py(options, args):
os.environ['WXPYTHON_RELEASE'] = 'yes'
if not isWindows:
- WX_CONFIG = posixjoin(BUILD_DIR, 'wx-config')
+ WX_CONFIG = posixjoin(BUILD_DIR, 'wx-config-gtk3')
if options.use_syswx:
- wxcfg = posixjoin(options.prefix, 'bin', 'wx-config')
+ wxcfg = posixjoin(options.prefix, 'bin', 'wx-config-gtk3')
if options.prefix and os.path.exists(wxcfg):
WX_CONFIG = wxcfg
else:
- WX_CONFIG = 'wx-config' # hope it is on the PATH
+ WX_CONFIG = 'wx-config-gtk3' # hope it is on the PATH
wafBuildBase = wafBuildDir = getWafBuildBase()
--
2.19.0

View file

@ -1,12 +0,0 @@
Index: wxPython-4.0.7/build.py
===================================================================
--- wxPython-4.0.7.orig/build.py
+++ wxPython-4.0.7/build.py
@@ -169,7 +169,6 @@ def main(args):
setPythonVersion(args)
setDevModeOptions(args)
- os.environ['PYTHONPATH'] = phoenixDir()
os.environ['PYTHONUNBUFFERED'] = 'yes'
os.environ['WXWIN'] = wxDir()

View file

@ -1,11 +0,0 @@
--- a/sip/cpp/sip_propgridwxPGPropArgCls.cpp
+++ b/sip/cpp/sip_propgridwxPGPropArgCls.cpp
@@ -317,7 +317,7 @@ static int convertTo_wxPGPropArgCls(PyOb
return sipGetState(sipTransferObj);
}
else if (sipPy == Py_None) {
- *sipCppPtr = new wxPGPropArgCls(reinterpret_cast< wxPGProperty * >(NULL));
+ *sipCppPtr = new wxPGPropArgCls(static_cast< wxPGProperty * >(NULL));
return sipGetState(sipTransferObj);
}
else {

View file

@ -1,92 +0,0 @@
diff -ur wxPython-4.0.7.orig/bin/.waf3/waflib/ConfigSet.py wxPython-4.0.7/bin/.waf3/waflib/ConfigSet.py
--- wxPython-4.0.7.orig/bin/.waf3/waflib/ConfigSet.py
+++ wxPython-4.0.7/bin/.waf3/waflib/ConfigSet.py
@@ -146,7 +146,7 @@
Utils.writef(filename,''.join(buf))
def load(self,filename):
tbl=self.table
- code=Utils.readf(filename,m='rU')
+ code=Utils.readf(filename,m='r')
for m in re_imp.finditer(code):
g=m.group
tbl[g(2)]=eval(g(3))
diff -ur wxPython-4.0.7.orig/bin/.waf3/waflib/Context.py wxPython-4.0.7/bin/.waf3/waflib/Context.py
--- wxPython-4.0.7.orig/bin/.waf3/waflib/Context.py
+++ wxPython-4.0.7/bin/.waf3/waflib/Context.py
@@ -106,7 +106,7 @@
cache[node]=True
self.pre_recurse(node)
try:
- function_code=node.read('rU',encoding)
+ function_code=node.read('r',encoding)
exec(compile(function_code,node.abspath(),'exec'),self.exec_dict)
finally:
self.post_recurse(node)
@@ -346,7 +346,7 @@
pass
module=imp.new_module(WSCRIPT_FILE)
try:
- code=Utils.readf(path,m='rU',encoding=encoding)
+ code=Utils.readf(path,m='r',encoding=encoding)
except EnvironmentError:
raise Errors.WafError('Could not read the file %r'%path)
module_dir=os.path.dirname(path)
diff -ur wxPython-4.0.7.orig/bin/.waf3/waflib/Tools/python.py wxPython-4.0.7/bin/.waf3/waflib/Tools/python.py
--- wxPython-4.0.7.orig/bin/.waf3/waflib/Tools/python.py
+++ wxPython-4.0.7/bin/.waf3/waflib/Tools/python.py
@@ -207,7 +207,7 @@
x='MACOSX_DEPLOYMENT_TARGET'
if dct[x]:
env[x]=conf.environ[x]=dct[x]
- env.pyext_PATTERN='%s'+dct['SO']
+ env.pyext_PATTERN='%s.so'
num='.'.join(env.PYTHON_VERSION.split('.')[:2])
conf.find_program([''.join(pybin)+'-config','python%s-config'%num,'python-config-%s'%num,'python%sm-config'%num],var='PYTHON_CONFIG',msg="python-config",mandatory=False)
if env.PYTHON_CONFIG:
diff -ur wxPython-4.0.7.orig/sip/siplib/sip.h wxPython-4.0.7/sip/siplib/sip.h
--- wxPython-4.0.7.orig/sip/siplib/sip.h
+++ wxPython-4.0.7/sip/siplib/sip.h
@@ -1794,7 +1794,7 @@
int (*api_get_time)(PyObject *, sipTimeDef *);
PyObject *(*api_from_time)(const sipTimeDef *);
int (*api_is_user_type)(const sipWrapperType *);
- struct _frame *(*api_get_frame)(int);
+ PyFrameObject *(*api_get_frame)(int);
int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
void (*api_unicode_write)(int, void *, int, unsigned);
diff -ur wxPython-4.0.7.orig/sip/siplib/siplib.c wxPython-4.0.7/sip/siplib/siplib.c
--- wxPython-4.0.7.orig/sip/siplib/siplib.c
+++ wxPython-4.0.7/sip/siplib/siplib.c
@@ -439,7 +439,7 @@
static int sip_api_get_time(PyObject *obj, sipTimeDef *time);
static PyObject *sip_api_from_time(const sipTimeDef *time);
static int sip_api_is_user_type(const sipWrapperType *wt);
-static struct _frame *sip_api_get_frame(int);
+static PyFrameObject *sip_api_get_frame(int);
static int sip_api_check_plugin_for_type(const sipTypeDef *td,
const char *name);
static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar,
@@ -13688,15 +13688,19 @@
/*
* Return a frame from the execution stack.
*/
-static struct _frame *sip_api_get_frame(int depth)
+static PyFrameObject *sip_api_get_frame(int depth)
{
- struct _frame *frame = PyEval_GetFrame();
+ PyFrameObject *frame = PyEval_GetFrame();
+ Py_XINCREF(frame);
while (frame != NULL && depth > 0)
{
- frame = frame->f_back;
+ PyFrameObject *oframe = frame;
+ frame = PyFrame_GetBack(frame);
+ Py_DECREF(oframe);
--depth;
}
+ Py_XDECREF(frame);
return frame;
}

View file

@ -1,32 +0,0 @@
Index: wxPython-4.0.7/wx/lib/masked/maskededit.py
===================================================================
--- wxPython-4.0.7.orig/wx/lib/masked/maskededit.py
+++ wxPython-4.0.7/wx/lib/masked/maskededit.py
@@ -2645,7 +2645,7 @@ class MaskedEditMixin:
raise ve
elif replace_to > end:
#### dbg(indent=0)
- ve = ValueError('"%s" will not fit into field %d of control "%s"' (choice, index, self.name))
+ ve = ValueError('"%s" will not fit into field %d of control "%s"' % (choice, index, self.name))
ve.value = choice
ve.index = index
raise ve
Index: wxPython-4.0.7/wx/lib/plot/plotcanvas.py
===================================================================
--- wxPython-4.0.7.orig/wx/lib/plot/plotcanvas.py
+++ wxPython-4.0.7/wx/lib/plot/plotcanvas.py
@@ -1852,12 +1852,12 @@ class PlotCanvas(wx.Panel):
# Get ticks and textExtents for axis if required
xticks = yticks = None
xTextExtent = yTextExtent = (0, 0) # No text for ticks
- if self._xSpec is not 'none':
+ if self._xSpec != 'none':
xticks = self._xticks(xAxis[0], xAxis[1])
# w h of x axis text last number on axis
xTextExtent = dc.GetTextExtent(xticks[-1][1])
- if self._ySpec is not 'none':
+ if self._ySpec != 'none':
yticks = self._yticks(yAxis[0], yAxis[1])
if self.logScale[1]:
# make sure we have enough room to display SI notation.

View file

@ -1 +0,0 @@
pkgname=wxPython