Page MenuHomeFreeBSD

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

Authored by lbartoletti_tuxfamily.org on Oct 6 2019, 6:51 PM.

Details

Reviewers
koobs
Group Reviewers
Python
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
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

lbartoletti_tuxfamily.org retitled this revision from [WIP][NEW PORT] x11-toolkits/py-wxPython40 to [NEW PORT] x11-toolkits/py-wxPython40.
lbartoletti_tuxfamily.org edited the test plan for this revision. (Show Details)
koobs retitled this revision from [NEW PORT] x11-toolkits/py-wxPython40 to [NEW PORT] x11-toolkits/py-wxPython40: GUI toolkit for the Python programming language.Nov 12 2019, 12:05 AM
koobs requested changes to this revision.Nov 12 2019, 12:15 AM
koobs added a subscriber: koobs.

If this is a copy of an existing port, create the new port using svn copy (as this is what committers will have to do). Also have the benefits of that copy being tracked and displayed in the phabricator differential, and showing the diffs to the original source (so we know whats been updated/changed, rather than everything being new)

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

If the NLS option is disabled, but gettext is installed (say, for another port), does the package still find/link gettext?

OPTIONS that affect third-party library dependencies/discovery/linking should be explicitly disabled so that the build system of the software doesn't accidentally find it and link with it anyway

You can test this in poudriere by adding an test/temporary unconditional BUILD_DEPENDS on gettext, disabling the option during the poudriere run (testport -c) and seeing what happens

33 ↗(On Diff #64200)

Use the USE_WX variables instead of hardcoding:

# WX_CONFIG     - The path to the wx-config program (with different name)

Use a MAKE_ENV make environment variable instead of a inplace patch if the python package supports setting the config binary path via env vars. If not, it should (ask upstream for that feature)

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_tuxfamily.org marked 5 inline comments as done.Nov 29 2019, 5:37 PM
lbartoletti_tuxfamily.org 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

lbartoletti_tuxfamily.org marked an inline comment as done.Thu, Dec 26, 8:36 AM

gentle ping koobs@

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

koobs added inline comments.Fri, Dec 27, 2:29 AM
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.

Fix stripcmd. Thanks koobs@

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

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
8

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.Sun, Dec 29, 4:05 AM
lbartoletti_tuxfamily.org marked 5 inline comments as done.Mon, Dec 30, 8:19 AM
lbartoletti_tuxfamily.org added inline comments.
x11-toolkits/py-wxPython40/Makefile
24

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
8

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"
...
lbartoletti_tuxfamily.org marked 3 inline comments as done.Mon, Dec 30, 8:20 AM