Page MenuHomeFreeBSD

[NEW PORT] x11-toolkits/py-wxPython40: GUI toolkit for the Python programming language
ClosedPublic

Authored by lbartoletti on Oct 6 2019, 6:51 PM.
Tags
Referenced Files
Unknown Object (File)
Fri, Nov 29, 1:31 PM
Unknown Object (File)
Mon, Nov 25, 8:53 PM
Unknown Object (File)
Mon, Nov 25, 4:54 PM
Unknown Object (File)
Mon, Nov 25, 12:12 PM
Unknown Object (File)
Mon, Nov 25, 8:13 AM
Unknown Object (File)
Mon, Nov 25, 1:00 AM
Unknown Object (File)
Sun, Nov 24, 8:19 PM
Unknown Object (File)
Sun, Nov 24, 6:53 PM
Subscribers

Details

Summary

py-wxPython40/Phoenix is a reborn of wxPython and in particular it allows to use wxWidgets with python3.

Introdcution from https://github.com/wxWidgets/Phoenix

"""
Welcome to wxPython's Project Phoenix! Phoenix is the improved next-generation wxPython, "better, stronger, faster than he was before." This new implementation is focused on improving speed, maintainability and extensibility. Just like "Classic" wxPython, Phoenix wraps the wxWidgets C++ toolkit and provides access to the user interface portions of the wxWidgets API, enabling Python applications to have a native GUI on Windows, Macs or Unix systems, with a native look and feel and requiring very little (if any) platform specific code.
"""

This is a first version of x11-toolkits/py-wxWidgets40 port. I only created the port, but I think that we need to modify also Mk/bsd.wx.mk.

Test Plan

Poudriere 11, 12, 13 i386/amd64
portlint -NAB. 1 unrelevant warning (WARN: Makefile: [8]: possible direct use of command "python" found. use ${PYTHON_CMD} instead.)
I tried wxdemo on 12 amd64: OK
I built databases/grass7 with it and run it: OK

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 28756
Build 26766: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
py-wxPython40/Makefile
37 ↗(On Diff #64200)

You can just strip *.so here, unless you want to know if and when the .so file list changes (minimal benefit)

But .. this whole block is commented out anyway. Why?

py-wxPython40/files/patch-build.py
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-etg_propgridiface.py
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-sip_cpp_sip__corecmodule.cpp
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-sip_cpp_sip__corewxString.cpp
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-sip_cpp_sip__propgridwxPGPropArgCls.cpp
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-sip_gen_propgridiface.sip
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-src_string.sip
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

py-wxPython40/files/patch-src_wxpy__api.sip
1 ↗(On Diff #64200)

Document/comment patches in the patch headers with upstream or other references like issue, PR, mailing list, commit URL's and a short description, to help our future selves

This revision now requires changes to proceed.Nov 12 2019, 12:15 AM

New diff:

x11-toolkits/py-wxPython40:

  • svn cp
  • add information about the patch for wxPGPropArgCls ; patched upstream
  • update to 4.0.7
  • remove patches for wx unicode fixed in x11-toolkits/wxgtk30

x11-toolkits/wxgtk30

  • take mainternship
  • fix unicode configuration

Maybe that wxgtk30 should request an exp-run?

lbartoletti added inline comments.
py-wxPython40/Makefile
33 ↗(On Diff #64200)

I uploaded my test sorry :)

37 ↗(On Diff #64200)

Yes It's commented because... strip crash :/
I forgot to mention it at the first patch

gentle ping koobs@

Just don't know how to strip libraries since the command crash everytime :/

py-wxPython40/Makefile
37 ↗(On Diff #64200)

If all the files are in /wx/, can you try *.so (without the loop), or using a ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR}/wx -name *.so -exec ${STRIP_CMD} ...

It would be nice to get to the bottom of the crash.

If all of the above still crash (let us know), please add a comment to the top of the commented block about why its commented, so that our future selves can isolate and hopefully fix it.

koobs requested changes to this revision.Dec 29 2019, 4:05 AM
koobs added inline comments.
x11-toolkits/py-wxPython40/Makefile
23

Is this correct?
Does it need to be updated?
What parts, if any, of the WX ports framework elements need to be updated?

I see your comment in the revision summary "but I think that we need to modify also Mk/bsd.wx.mk."

32

Can this be passed in as an environment variable of setup.py build argument? Preferable over patching.

x11-toolkits/py-wxPython40/files/patch-build.py
9

Is there any way to set this without patching the file? That's preferable over patches

Maybe:

  • setup.py build <args> (PYDISTUTILS_BUILDARGS)
  • Environment variables?
This revision now requires changes to proceed.Dec 29 2019, 4:05 AM
lbartoletti added inline comments.
x11-toolkits/py-wxPython40/Makefile
23

Is this correct?

Yes, wxPython40 requires wx-widgets 3.0 AFAIK no one uses 3.1 yet.

I see your comment in the revision summary "but I think that we need to modify also Mk/bsd.wx.mk."

Yes, as I had asked on IRC who was taking care of that, because, I don't really understand why there are two ports (wxPythonX and wxPythonX-common) per version.

This new port, it's the only one allowing to offer wxwidgets in python3 (and requested by the new version of databases/grass7 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241892)

For the wx ports framework, I didn't modify it because I don't know how much I have to modify it to include this new port.

In my example on databases/grass7, I don't use the variable

USE_WX=3.0
WX_COMPS=wx:build python:run

but

RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}wxPython40>=0:x11-toolkits/py-wxPython40@${PY_FLAVOR}

I think that wxPython40 sould be callable within Mk/bsd.wx.mk, but how?

Should we replace py- wxPython30 by py-wxPython40 for wxgtk30 like this

_WX_PORT_python_3.0=	x11-toolkits/py-wxPython40
_WX_FILE_python_3.0=	${PYTHON_SITELIBDIR}/wx-3.0-gtk3/wx/__init__.py

Or, is it necessary to add something else to choose the version of wxPython (3 or 4) for wxWidgets (3.0). Knowing, that only wxPython40 is available for python3.

Maybe we need to integrate this port first and then run an exp-run by depreciating wxPython30 by wxPython40 and see the result?

32

AFAIK, no. I tried with PYDISTUTILS_BUILDARGS= WX_CONFIG=${WX_CONFIG} but there is no effect on the variable.
All linux distributions make this substitution. I'm going to open a ticket upstream.

x11-toolkits/py-wxPython40/files/patch-build.py
9

It's possible to avoid these patch using a manual do-build:

do-build:
    ${PYTHON_CMD} ${WRKSRC}/build.py build --use_syswx --release

But it doesn't compile anymore (IIRC only with llvm...), because of an include problem:

...
In file included from ../../../../sip/cpp/sip_glcanvaswxGLContext.cpp:10:
In file included from ../../../../sip/cpp/sipAPI_glcanvas.h:524:
In file included from /usr/local/include/wx-3.0/wx/glcanvas.h:195:
In file included from /usr/local/include/wx-3.0/wx/gtk/glcanvas.h:14:
/usr/local/include/wx-3.0/wx/unix/glx11.h:13:10: fatal error: 'GL/glx.h' file not found
#include <GL/glx.h>
         ^~~~~~~~~~
1 error generated.

Waf: Leaving directory `/wrkdirs/usr/ports/x11-toolkits/py-wxPython40/work-py37/wxPython-4.0.7/build/waf/3.7/gtk3'
Build failed
 -> task in '_glcanvas' failed with exit status 1 (run with -v to display more information)
 -> task in '_glcanvas' failed with exit status 1 (run with -v to display more information)
 -> task in '_glcanvas' failed with exit status 1 (run with -v to display more information)
Will build using: "/usr/local/bin/python3.7"
...
x11-toolkits/py-wxPython40/Makefile
23

I tried to build ports where wxPython30 was required with wxPython40 and all built successfully

x11-toolkits/py-wxPython40/Makefile
23

(except emulators/playonbsd stage-qa for shebang errors and sysutils/hachoir-wx unfetchable)

x11-toolkits/py-wxPython40/Makefile
23

erg no sorry for the false positive alert... need a second try with wxPython40 instead of wxPython30

  • Update Mk/bsd.wx.mk to use x11-toolkits/py-wxPython40 for wxWidgets 3.0
  • While I'm here fix stagging for emulators/playonbsd
  • Fix Makefile for cad/kicad (explicitly use wxPyton40 aka Phoenix)

Tested ports (12 amd64 only):
audio/py-karaoke: Failed (configure). Can be built with py27-wxPython28
cad/kicad: Success
comms/gnuradio: Success
comms/quisk: Success
databases/grass7: Success
deskutils/cycle: Success
deskutils/taskcoach: Success
deskutils/wammu: Failed (build). DEPRECATED: Unmaintained, uses EOLed python27. Expiration Date EXPIRATION DATE: 2020-01-27
devel/drpython: Failed (build). DEPRECATED: Unmaintained, uses EOLed python27. Expiration Date EXPIRATION DATE: 2020-01-27
devel/py-robotframework-ride: Success
devel/wxGlade: Success
emulators/playonbsd: Success
games/pyfa: Success
graphics/djvusmooth: Success
graphics/sk1: Success
misc/metalink-editor: Success
misc/pyobd: Success
multimedia/photofilmstrip: Success
sysutils/hachoir-wx: Success
x11-toolkits/py-SquareMap: Success
x11-wm/obapps: Success

Fix build for audio/py-karaoke. Use wxgtk-2.8

x11-toolkits/py-wxPython40/Makefile
32

koobs@ FYI, I opened an issue upstream

x11-toolkits/py-wxPython40/files/patch-build.py
9

koobs, I also tried the commands follow up our discussion on IRC without success.

Bump portrevision for audio/py-karaoke

bump portversion for cad/kicad and cad/kicad-devel

Bump portversion emulators/playonbsd

Update comms/congruity and graphics/py-mayavi to USE_WX=3.0+

Replace LIB_DEPENDS to USE_WX for graphics/djvusmooth

Bump portversion for all ports which require wxPython40

Bump portversion for graphics/djvusmooth

Looks good to me. Make sure to include

Exp-run by: antoine

in your commit message, and also to have it properly repo-copied :)

Looks good to me. Make sure to include

Exp-run by: antoine

Thanks

and also to have it properly repo-copied :)

My biggest fear with svn :)
How to be sure? I see that x11-toolkits/py-wxPython40 is copied from x11-toolkits/py-wxPython30. OK, but I deleted useless patches [1] and are not marked as deleted

[1] files/patch-src_gtk_propgridwrap.cpp, files/patch-src_gtk_gdi__wrap.cpp, files/patch-setup.py

In D21915#522759, @lbartoletti_tuxfamily.org wrote:

My biggest fear with svn :)
How to be sure? I see that x11-toolkits/py-wxPython40 is copied from x11-toolkits/py-wxPython30. OK, but I deleted useless patches [1] and are not marked as deleted

[1] files/patch-src_gtk_propgridwrap.cpp, files/patch-src_gtk_gdi__wrap.cpp, files/patch-setup.py

So, per 20.4. Repository Copies, what you do is svn cp, then you patch what needs to be changed, and maybe add new files, or remove obsolete ones, that is all, no magic involved.

Delete old patches from wxPython30

This revision was not accepted when it landed; it landed in state Needs Review.Feb 29 2020, 6:24 PM
This revision was automatically updated to reflect the committed changes.