diff options
author | rakuco <rakuco@FreeBSD.org> | 2014-11-05 17:39:21 +0800 |
---|---|---|
committer | rakuco <rakuco@FreeBSD.org> | 2014-11-05 17:39:21 +0800 |
commit | dd2de4141f30ed0c37ede8e335774d98ce8c7909 (patch) | |
tree | de667d296e818eb8d5953ab35ea2c695f47825db /Mk | |
parent | 6c134ba3da3ce1083dc294631052fba5ce2044e9 (diff) | |
download | freebsd-ports-gnome-dd2de4141f30ed0c37ede8e335774d98ce8c7909.tar.gz freebsd-ports-gnome-dd2de4141f30ed0c37ede8e335774d98ce8c7909.tar.zst freebsd-ports-gnome-dd2de4141f30ed0c37ede8e335774d98ce8c7909.zip |
Update Qt5 ports to 5.3.2.
Proudly presented by the KDE on FreeBSD team, with several guest stars.
This update took way longer than initially expected due to us previously
accumulating assumptions and changes to Qt's build system that finally bit
us back with the 5.3 release series, so we had to do a fair amount of
cleanup.
New ports:
- comms/qt5-serialport: Qt functions to access serial ports, originally
based on work by Fernando Apesteguia. [1]
- devel/qt5-qdoc: Qt documentation generator, the Qt5 equivalent of
devel/qt4-qdoc3. Originally worked on by Tobias Berner.
It had already been half-split from devel/qt5-buildtools,
we just needed to finish the work.
Dead ports:
- devel/qt5-qmldevtools: Merged into lang/qt5-qml.
Minor changes:
- devel/qt5: Add x11/qt5-x11extras and the new ports to the dependency list.
- graphics/qt5-imageformats: The port now supports the JPEG2000, WEBP,
Direct Draw Surface and ICNS formats.
- multimedia/qt5-multimedia: The ALSA and PULSEAUDIO options are now
mutually exclusive due to changes introduced in
Qt 5.3.0 (the ALSA code is now a proper plugin
that is only built if PulseAudio is not used).
- x11/qt5-x11extras: Add USE_LDCONFIG since the port installs a shared
library.
The big changes:
- bsd.qt.mk: Set QMAKESPEC instead of QMAKEPATH. [3]
QMAKEPATH does much more than we want now that we call qmake from the top
of ${WRKSRC}. qmake uses QMAKEPATH when evaluating the QMAKE_MKSPECS
property, which is in turn used by qt_config.pri to load the .pri files in
mkspecs/modules.
In practice, this means that if people have an older Qt installation those
files will be used and QT_CONFIG will have values such as "gui" even if
one is building a port like textproc/qt5-xml, which passes -no-gui to the
configure script. Consequently, unintended code paths may be enabled or
the configuration step can just fail if the .pro files expect values that
are not present in the system-wide, older .pri files.
We avoid all those problems if we use QMAKESPEC, as qmake does not take
its value into account when evaluating the QMAKE_MKSPECS property and will
only parse the files in the mkspec's directory (mkspecs/freebsd-clang, for
example, instead of all the files in mkspecs).
- Stop explicitly passing ${LOCALBASE} to the compiler. [3]
qmake's behavior has changed in Qt 5, and the paths set in QMAKE_INCDIR
and QMAKE_LIBDIR in the mkspecs are passed before any others, such as the
ones in the build directory themselves.
In practice, this means that we end up with linker calls like this:
c++ -o libfoo.so foo.o bar.o -L/usr/local/lib -L/wrkdir/build/lib
-lQt5Gui -lQt5Core
So if one already has Qt installed in the system, the older, already
present version of the libraries in /usr/local/lib will be used instead of
the newly-built ones in /wrkdir/build/lib.
QTBUG-40825 discusses this behavior upstream, but there has been no
agreement on a solution yet.
For now, the solution adopted is to make the compiler and the linker aware
of those paths but only try them last after all others, and this is
achieved by setting the CPATH and LIBRARY_PATH environment variables when
qmake is being used.
In addition to setting them in CONFIGURE_ENV and MAKE_ENV, we also need to
stop changing QMAKE_INCDIR and QMAKE_LIBDIR as well as filter those paths
from the pkg-config calls qtbase's configure script makes.
- Call qmake from the root of the ${WRKSRC}.
In Qt 5.3, Qt's build infrastructure has undergone some changes that make
our previous approach of calling qmake from the directories we want to
build stop working. Things would break even more in Qt 5.4, in which
qtbase's configure script does not accept the -process, -fully-process and
-dont-process arguments anymore (it always behaves as if -process had been
used).
Bite the bullet and start calling qmake from ${WRKSRC}. The largest part of
this change involves changing lines in Makefiles from
WRKSRC_SUBDIR= foo/bar
to
BUILD_WRKSRC= ${WRKSRC}/foo/bar
INSTALL_WRKSRC= ${WRKSRC}/foo/bar
as well as adding patches to .pro files to avoid entering other
subdirectories and removing post-configure targets that are not necessary
anymore.
Since qmake needs to be called from the top of ${WRKSRC} anyway, we can
also simplify the configuration process for the qtbase ports a little.
Looking at r10019 it is not clear why we started calling qmake in the
pre-configure target in addition to the post-configure one (while also
skipping it in do-configure), but we can now drop this call since letting
configure behave as if -process had been passed means it will call qmake
on its own and overwrite the files generated by the pre-configure call. We
still need to call qmake in post-configure though, as the configure script
does not pass -recursive when calling qmake and we need to be able to call
make from any subdirectory when building.
PR: 194762 [1]
PR: 194566 # exp-run with base GCC and clang
PR: 194088 [3]
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Uses/qmake.mk | 13 | ||||
-rw-r--r-- | Mk/bsd.qt.mk | 62 |
2 files changed, 52 insertions, 23 deletions
diff --git a/Mk/Uses/qmake.mk b/Mk/Uses/qmake.mk index b9ee08afa208..f7322b305a3c 100644 --- a/Mk/Uses/qmake.mk +++ b/Mk/Uses/qmake.mk @@ -49,6 +49,19 @@ IGNORE= Incorrect 'USES+= qmake' usage: argument '${arg}' is not recognized USE_QT${_QT_VERSION:R:R}+= qmake_build .endif +.if ${_QT_VERSION:M5*} +# We deliberately do not pass -I${LOCALBASE}/include and -L${LOCALBASE}/lib +# in the FreeBSD mkspecs because in Qt5 they are always added before the +# paths in ${WRKSRC}. In other words, if one is upgrading an existing +# installation the old headers and libraries will always be picked up. +# Those directories to be passed though, they just need to be passed last. +# See QTBUG-40825 and ports/194088 for more information. +CONFIGURE_ENV+= CPATH=${LOCALBASE}/include \ + LIBRARY_PATH=${LOCALBASE}/lib +MAKE_ENV+= CPATH=${LOCALBASE}/include \ + LIBRARY_PATH=${LOCALBASE}/lib +.endif # ${_QT_VERSION:M5*} + # QMAKESPEC belongs to bsd.qt.mk. QMAKE_ENV?= ${CONFIGURE_ENV} QMAKE_ARGS+= -spec ${QMAKESPEC} \ diff --git a/Mk/bsd.qt.mk b/Mk/bsd.qt.mk index 76ac28b42672..a49b25ac45b4 100644 --- a/Mk/bsd.qt.mk +++ b/Mk/bsd.qt.mk @@ -27,7 +27,7 @@ Qt_Pre_Include= bsd.qt.mk # Qt versions currently supported by the framework. _QT_SUPPORTED?= 4 5 QT4_VERSION?= 4.8.6 -QT5_VERSION?= 5.2.1 +QT5_VERSION?= 5.3.2 QT_PREFIX?= ${LOCALBASE} @@ -103,12 +103,15 @@ QT_DIST= base declarative doc graphicaleffects imageformats \ # Qt configure requires pkg-config to detect dependencies. USES+= pkgconfig -# Use mkspecs installed in QMAKEPATH/mkspecs when building qtbase. -CONFIGURE_ENV+= QMAKEPATH="${QT_MKSPECDIR:H}" -MAKE_ENV+= QMAKEPATH="${QT_MKSPECDIR:H}" +# Set QMAKESPEC when building qtbase so that qmake (called by the configure +# script) can find the mkspecs we create ourselves in devel/qmake5. +CONFIGURE_ENV+= QMAKESPEC="${QMAKESPEC}" +MAKE_ENV+= QMAKESPEC="${QMAKESPEC}" . endif -# -nomake flags aren't enough. +# -nomake is only used by qtbase's configure script. +# Other ports from other Qt modules will automatically build examples and +# tests if the directories exist because of mkspecs/features/qt_parts.prf. EXTRACT_AFTER_ARGS?= ${DISTNAME:S,$,/examples,:S,^,--exclude ,} \ ${DISTNAME:S,$,/tests,:S,^,--exclude ,} . endif # ! ${_QT_VERSION:M4*} @@ -137,8 +140,7 @@ CONFIGURE_ARGS+=-fast \ -examplesdir ${PREFIX}/${QT_EXAMPLEDIR_REL}/examples \ -demosdir ${PREFIX}/${QT_EXAMPLEDIR_REL}/demos . else -CONFIGURE_ARGS+=-dont-process \ - -nomake examples -nomake tests \ +CONFIGURE_ARGS+=-nomake examples -nomake tests \ -archdatadir ${PREFIX}/${QT_ARCHDIR_REL} \ -libexecdir ${PREFIX}/${QT_LIBEXECDIR_REL} \ -qmldir ${PREFIX}/${QT_QMLDIR_REL} \ @@ -169,9 +171,7 @@ CONFIGURE_ARGS+=-verbose EXTRA_PATCHES?= ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-configure \ ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-config.tests-unix-compile.test \ ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-libtool -. if ${_QT_VERSION:M5*} -EXTRA_PATCHES+= ${.CURDIR:H:H}/devel/qt5-core/files/extrapatch-src__corelib__tools__qdatetime.cpp -. elif ${_QT_VERSION:M4*} +. if ${_QT_VERSION:M4*} EXTRA_PATCHES?= ${EXTRA_PATCHES} \ ${.CURDIR:H:H}/devel/${_QT_RELNAME}/files/extrapatch-src-corelib-global-qglobal.h . endif @@ -297,8 +297,8 @@ _USE_QT4_ONLY= accessible assistant-adp assistantclient codecs-cn codecs-jp \ qtestlib qvfb rcc uic uic3 xmlpatterns-tool _USE_QT5_ONLY= buildtools concurrent core graphicaleffects linguisttools \ - printsupport qdbus qdoc qev qml qmldevtools quick \ - quickcontrols uitools widgets x11extras + printsupport qdbus qdoc qev qml quick \ + quickcontrols serialport uitools widgets x11extras accessible_PORT= accessibility/${_QT_RELNAME}-accessible accessible_PATH= ${QT_PLUGINDIR}/accessible/libqtaccessiblewidgets.so @@ -438,9 +438,6 @@ qmake_PATH= ${QMAKE} qml_PORT= lang/${_QT_RELNAME}-qml qml_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}Qml.so -qmldevtools_PORT= devel/${_QT_RELNAME}-qmldevtools -qmldevtools_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}QmlDevTools.a - qmlviewer_PORT= devel/${_QT_RELNAME}-qmlviewer qmlviewer_PATH= ${QT_BINDIR}/qmlviewer @@ -471,6 +468,9 @@ script_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}Script.so scripttools_PORT= devel/${_QT_RELNAME}-scripttools scripttools_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}ScriptTools.so +serialport_PORT= comms/${_QT_RELNAME}-serialport +serialport_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}SerialPort.so + sql_PORT= databases/${_QT_RELNAME}-sql sql_PATH= ${QT_LIBDIR}/libQt${_QT_LIBVER}Sql.so @@ -551,7 +551,10 @@ _QT_TOOLS= # empty _QT_TOOLS+= ${QMAKE} . endif . if ${PORTNAME} != "buildtools" -_QT_TOOLS+= ${MOC} qdoc ${RCC} +_QT_TOOLS+= ${MOC} ${RCC} +. endif +. if ${PORTNAME} != "qdoc" +_QT_TOOLS+= qdoc . endif . if ${PORTNAME} != "dbus" _QT_TOOLS+= qdbuscpp2xml qdbusxml2cpp @@ -562,26 +565,39 @@ _QT_TOOLS+= ${UIC} pre-configure: qtbase-pre-configure qtbase-pre-configure: -. if ${PORTNAME} != "qmake" - @(cd ${WRKSRC} && ${SETENV} ${QMAKE_ENV} ${QMAKE} ${QMAKE_ARGS}) -# @${RM} -rf ${CONFIGURE_WRKSRC}/mkspecs -# @${MKDIR} ${CONFIGURE_WRKSRC}/mkspecs -. endif . for tool in ${_QT_TOOLS} @${TEST} -e ${QT_BINDIR}/${tool:T} && \ ${LN} -sf ${QT_BINDIR}/${tool:T} ${CONFIGURE_WRKSRC}/bin/${tool:T} || \ ${TRUE} . endfor +# Add ${LOCALBASE}/lib to DEFAULT_LIBDIRS, which we use to filter out +# certain paths from pkg-config calls (see the explanation in +# devel/qt5/files/patch-configure) as well as for setting +# QMAKE_DEFAULT_LIBDIR in mkspecs/qconfig.pri. Part of the solution for +# ports/194088. +post-patch: qtbase-post-patch +qtbase-post-patch: + ${REINPLACE_CMD} -e "/DEFAULT_LIBDIRS=/ s,\\\\\"\\\\n,\\\\n${LOCALBASE}/lib&," \ + ${WRKSRC}/configure + . if ${PORTNAME} != "qmake" -_QMAKE_WRKSRC= ${BUILD_WRKSRC} -QMAKE_SOURCE_PATH= ${_QMAKE_WRKSRC} _QMAKE= ${CONFIGURE_WRKSRC}/bin/qmake post-configure: qmake-configure . endif . endif # ${QT_DIST} == "base" +# Qt 5.3.2 introduced a check in mkspecs/features/create_cmake.prf that +# requires tests/auto/cmake to be present, otherwise the configure stage will +# fail. +# Since we cannot extract tests/auto/cmake/ and exclude tests/ at the same +# time, we have to disable the check in a cache file (the only way to get this +# value through to the configure script in qtbase). +pre-configure: qt5-pre-configure +qt5-pre-configure: + ${ECHO_CMD} 'CMAKE_MODULE_TESTS = -' > ${WRKSRC}/.qmake.cache + pre-install: qt-pre-install qt-pre-install: # Search both in CONFIGURE_WRKSRC and WRKSRC, as the former is not |