QT_LIBDIR -> ${PRREFIX}/lib/qt[45] (no change for qt5)
QT_BINDIR -> ${QT_LIBDIR}/bin (no change for qt5)
Depend on new port "misc/qtchooser" for qmake/moc/foo-binaries in PATH.
Note: previously only qt4 binaries were in path
Accoding to a comment in bsd.qt.mk, this was prepared, or planned long ago (by someone else in kde@) but never done.
Install two profiles: qt4 and qt5, so that env QT_SELECT=qt4 qmake gives you qmake4 and env QT_SELECT=qt5 qmake the other. This works for all qt-installed binaries.
Reasons for the move of files:
Long standing kde@ bug, that inplace upgrading of ports can fail: As we split up qtbase a port of qtbase could pick up the old shared library from $PREFIX/lib during the build instead of the one in $BUILDWRKSRC, if a dependency added $PREFIX/lib to the linker directories.
The symmetry between qt4 and qt5 allows us to use qtchooser.
I decided to keep installing Qt5's cmake files to lib/cmake and not lib/qt5/cmake. This requires some patches.
All the new ports were created by Marie Loise Nolden <nolden@kde.org> back in spring of last year.
Test Plan
I'm at the moment building all ports depending on Qt[45]. This will take a while, and I'll add the ports that need fixing to the diff.
Probably mostly "c++11" no enabled (see multimedia/mlt-qt5, graphics/poppler-qt5 and so on). -- Hopefully as Qt-5.7.1 is already more than 6months out, most of the fixes have already trickeld into the tree by themseleves... :)
Very small nitpick: there are two spaces instead of one after the '#'s, and an extra space before "QT_DIST".
Additionally, the comment is basically describing what we can see below, it'd be more helpful if it explained why instead.
Rather than to add a RUN_DEPENDS to the ports intalling binaries (qt5 were missing :/ ) add the RUN_DEPENDS for all QT_DIST ports via bsd.qt.mk. This is less confusing.
In this specific case, I think it's quite important to be clear about what's happening, just like you've done with devel/qt5/files/extrapatch-mkspecs_features_create__cmake.prf.
As for still having to use REINPLACE_CMD, why don't you use the same approach from that patch file I mentioned and go with $$[QT_INSTALL_PREFIX]/lib instead?
Fixup graphics/lprof-devel: modify get_QTDIR to return a sensible value (QT_ARCHDIR) if the environment variable QTDIR is empty. This should make lprof pickup ${QT_BINDIR}/assistant directly.
If these are the ones created by qtchooser in PREFIX/bin, it should be PREFIX/bin, not QT_BINDIR. (If they are the ones in PREFIX/some-qt-directory then it's ok.)
I think it's OK to leave those changes in the ports themselves; the vast majority of the ports just get the -std=c++11 bit for free via qmake and its mkspecs. The ports being patched here are either just relying on autoconf+pkgconfig or roll their own configuration system; I think it makes sense to have USE_CXXSTD so it can get removed in the future once those few ports are adjusted upstream.
Fix devel/Makefile, as reported by antoine in pr 216797
[00:01:43] ====>> Warning: Nonexistent port listed in category Makefiles: devel/qmake4
[00:01:43] ====>> Warning: Nonexistent port listed in category Makefiles: devel/qmake5
[00:01:43] ====>> Warning: Nonexistent port listed in category Makefiles: devel/qt5-make
Add patch to fix detection of the Qt5 tools in net/wireshark-qt5: The configure script tries to use qtchooser, or alternatively the binaries directly. However, it appends the flags for qtchooser nevertheless. Remove the qtchooser flags, as even if they are needed, we already set that up via CONFIGURE_ENV.