I am looking at the databases/sqlitestudio port.
In this makefile /usr/ports/databases/sqlitestudio/work/SQLiteStudio3/guiSQLiteStudio/Makefile qmake always adds -L/usr/local/lib in front, so LIBS looks like this:
> LIBS = $(SUBLIBS) -L/usr/local/lib -L/usr/ports/databases/sqlitestudio/work/SQLiteStudio3/../output/SQLiteStudio -lcoreSQLiteStudio -lQt5UiTools -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Xml -lQt5Core -lGL
This causes the build to first look at the pre-installed libraries, which is completely wrong.
I suspect this is a general problem for all Qt5-based ports that use internal shared libraries.
This causes the link failure for th new version of this package 3.1.0
It should add -L/usr/local/lib after project-defined libs.
we're well aware of the problem as it is a problem for upgrading Qt itself, too. OpenBSD has patched qmake for this purpose and I intend to make a similar patch upstream (that we backport).
The solution for you now is to deinstall the port first before compiling (similar to Qt itself)
To prevent similar complains I added an extra patching step to this port.
I close this for now. As Loise mentions this is an upstream issue/feature/wontfix in qmake itself. We work around it for the Qt ports by using the .qmake.cache file (see bsd.qt.mk).
You could maybe adapt this hack for your port too.
Is there the upstream bug report number for this?
665 # See QTBUG-40825 and ports bugs 194088, 195105 and 198720.
In short: https://bugreports.qt.io/browse/QTBUG-40825