Page MenuHomeFreeBSD

Make it possible to install py-qt5 for multiple python versions at the same time
ClosedPublic

Authored by tcberner on Dec 5 2016, 9:05 AM.

Details

Summary
  • Pass the versioned sip-binary to configure.py
  • Add USE_PYTHON=concurrent to py-qt5-core to install pyuic5 versioned too
  • Make the sip-directory versioned
Test Plan

I only tested devel/py-sip and devel/py-qt5-core with
DEFAULT_VERSIONS+=python=3.5 python3=3.5 in make.conf
and a make PYTHON_VERSION=2.7 so far.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tcberner updated this revision to Diff 22712.Dec 5 2016, 9:05 AM
tcberner retitled this revision from to Make it possible to install py-qt5 for multiple python versions at the same time.
tcberner updated this object.
tcberner edited the test plan for this revision. (Show Details)
tcberner added reviewers: kde, rakuco, mat, adridg.
tcberner updated this revision to Diff 22719.Dec 5 2016, 4:23 PM
tcberner edited edge metadata.

Add concurrent to py-qt5-core too (I added it to py-qt4-core by mistake...
which also needs it.. so lets call it an opportunity ^^)

Of course every py-qt port also requires a PORTREVISION bump (as SIPDIR changed).

Owners edited edge metadata.Dec 5 2016, 4:23 PM
fluffy added a subscriber: fluffy.Dec 24 2016, 10:31 AM
adridg edited edge metadata.Dec 24 2016, 9:22 PM
  • Deinstalled py27-qt5*
  • Don't have Python 3.5 installed
  • cd devel/py-qt5
  • make PYTHON_VERSION=3.5
  • builds and installs a bunch of ports, including many py35-qt5-*
  • fails in misc/py-qt5-demo

However, building misc/py-qt5-demo on its own (while setting PYTHON_VERSION) does work.

You're absolutely right. There is other stuff that needs to be versioned too, like QSCIDIR.

In devel/py-qt5:

# make PYTHON_VERSION=3.5

yields tons of error messages in misc/py-qt5-demo like this:

pkg-static: Unable to access file /zbigone/src/ports-playground/misc/py-qt5-demo/work/stage/usr/local/share/examples/py-qt5/xmlpatterns/schema/ui_schema.pyc: No such file or directory

Which is fair, since the file is generated like this:

/zbigone/src/ports-playground/misc/py-qt5-demo/work/stage/usr/local/share/examples/py-qt5/xmlpatterns/schema/__pycache__/ui_schema.cpython-35.pyc

So there's more pkg-plist munging to be done, since the do-install step (which uses compileall.py) isn't producing what the plist expects.

dbn added a subscriber: dbn.Dec 26 2016, 8:47 AM
In D8714#184358, @groot_kde.org wrote:

Which is fair, since the file is generated like this:

/zbigone/src/ports-playground/misc/py-qt5-demo/work/stage/usr/local/share/examples/py-qt5/xmlpatterns/schema/__pycache__/ui_schema.cpython-35.pyc

So there's more pkg-plist munging to be done, since the do-install step (which uses compileall.py) isn't producing what the plist expects.

FYI, USES=python already has support for that: USE_PYTHON=py3kplist.

Hope this helps.

tcberner updated this revision to Diff 23425.Dec 29 2016, 11:18 PM
tcberner edited edge metadata.

Add a versioned PLIST_SUB for the api-files installed by the ports.

Instead of installing them to share/qt[45]/qsci/api put them into share/qt[45]/qsci-${PYTHON_VER}/api
(maybe a path structured similarly to PYQT_SIPDIR would be nicer: share/py-qsci-${PYTHON_VER}/PyQt[45]).

I still need to think how to handle for example devel/py-qt5-designerplugin, which installs a shared library, independent of the python version.

Also, maybe there is a better way for all of this...

Owners edited edge metadata.Dec 29 2016, 11:18 PM
tcberner updated this revision to Diff 23476.Dec 30 2016, 8:14 PM
tcberner edited edge metadata.

Now it should be coinstallable: install everything with default (python27), set PYTHON_VERSION to 3.5 and install the other ports seems to work as expected.

  • The shared libraries in lang/py-qt5-qml and devel/py-qt[45]-designerplugin have been renamed to carry the python version in them... -- I thought about only adding these ports if the PYTHON_VERSION is the DEFAULT_PYTHON_VERSIONS... but that does not seem proper either. Maybe these renames have to be followed up somehwere else, so far I haven't spotted an issue (rebuilt everything needing pyqt).
  • Moved api, doc, sip files around a bit so they are versioned by both the Qt version and the python version used
  • Added SIPDIR to desktuils/calibre's MAKE_ENV.
Owners edited edge metadata.Dec 30 2016, 8:14 PM
xmj added a subscriber: xmj.May 16 2017, 10:54 AM

Will this land any time soon?

Current PyQT glue is outright broken with Python 3.

Isn't this largely obsoleted by flavors now? Or have flavors not reached the PyQt bits, and this stuff needs to be reworked to fit?

Isn't this largely obsoleted by flavors now? Or have flavors not reached the PyQt bits, and this stuff needs to be reworked to fit?

As I know, at least two problems (223409 and 219641) are still relevant.

swills added a subscriber: swills.Apr 10 2018, 12:12 AM
tcberner planned changes to this revision.Jun 24 2018, 8:07 AM
tcberner updated this revision to Diff 44385.Jun 24 2018, 11:13 AM

Update pyqt5 to 5.10.1 and use subdirectories per python version.

mat added a comment.Jun 27 2018, 10:55 AM

To check, it would probably be easier to use poudriere bulk -i and only set BUILD_ALL_PYTHON_FLAVORS in make.conf.

In D8714#339535, @mat wrote:

To check, it would probably be easier to use poudriere bulk -i and only set BUILD_ALL_PYTHON_FLAVORS in make.conf.

Thanks, I'll give it a go

tcberner updated this revision to Diff 49681.Oct 27 2018, 12:22 PM

Update diff against current tree.

tcberner updated this revision to Diff 49682.Oct 27 2018, 12:50 PM

Add bumps to pyqt dependencies.

tcberner updated this revision to Diff 49685.Oct 27 2018, 2:40 PM

Fix patch with respect to use of PYQT_APIDIR.

tcberner updated this revision to Diff 49697.Oct 27 2018, 5:34 PM
  • Readd USE_PYTHON flags (I should have checked the output of arc patch ;-) ...)
  • Fix deskutils/calibre
tcberner updated this revision to Diff 49698.Oct 27 2018, 5:43 PM

Fix py-qt5-quickwidgets

This revision was not accepted when it landed; it landed in state Needs Review.Nov 22 2018, 8:18 PM
This revision was automatically updated to reflect the committed changes.