ports/devel/qt5/files/extrapatch-configure
Tobias C. Berner f3c180c343 Update Qt5 to 5.7.1, and unify the Qt4 and Qt5 ports some more
* Update Qt5 to 5.7.1
* Move Qt4 binaries to lib/qt4/bin
* Move Qt5 libraries to lib/qt5/lib
  By moving the libraries we should finally be able to get rid of the inplace
  upgrade bug (see ports bugs 194088, 195105 and 198720):  when Qt5's libraries
  were lying in /usr/local/lib, which would often get added by pkgconfig to the
  linker paths via dependencies, the already installed libraries were linked
  against, instead of the ones that were being built. This forced us to make
  sure, that -L${WRKSRC}/lib was always coming before -L/usr/local/lib in the
  linker flags. With this change this should no longer be the case.
* Rename some ports to match the rest (foo-qtX -> qtX-foo)
* Depend on new port misc/qtchooser [see UPDATING & CHANGES]

There are several new Qt5 ports which all have been created by Marie Loise Nolden
<nolden@kde.org>. Thanks again.

PR:		216797
Exp-Run by:	antoine
Reviewed by:	rakuco, mat, groot_kde.org
Approved by:	rakuco (mentor)
Differential Revision:	https://reviews.freebsd.org/D9213
2017-02-18 19:48:05 +00:00

177 lines
10 KiB
Text

* The "build qmake" chunk is required for qtbase ports other than devel/qmake5
to use the already built qmake instead of always building their own copy.
* All the other chunks are part of the changes required to avoid ports/194088.
We want to avoid passing -I${LOCALBASE}/include and -L${LOCALBASE}/lib to the
compiler since in Qt5 at least for the Qt ports themselves those parameters
will be passed before the build directories, and consequently an older
installed version will be used when building a new Qt port and cause
problems. See QTBUG-40825 for a discussion we have started upstream.
This part of the solution comprises both filtering the output of the
pkg-config calls so it does not contain those parameters as well as
changing the default value of DEFAULT_LIBDIRS in bsd.qt.mk (in the
qtbase-post-patch target). It is used in the pkg-config filtering as well
as the value of QMAKE_DEFAULT_LIBDIRS in mkspecs/qconfig.pri (which qmake
uses to filter out those same paths when processing .pro files).
--- configure.orig 2015-03-16 17:16:10.000000000 +0100
+++ configure 2016-04-18 12:35:38.595937000 +0200
@@ -3878,7 +3878,7 @@
}
# build qmake
-if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+if [ '!' -e "$outpath/bin/qmake" ]; then
echo "Creating qmake..."
mkdir -p "$outpath/qmake" || exit
@@ -5045,8 +5045,8 @@
SQLITE_AUTODETECT_FAILED="no"
if [ "$CFG_SQLITE" = "system" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists sqlite3 2>/dev/null; then
- QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
- QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
+ QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null | filterIncludeOptions`
+ QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null | filterLibraryOptions`
else
QT_CFLAGS_SQLITE=
QT_LFLAGS_SQLITE="-lsqlite3 -lz"
@@ -5149,8 +5149,8 @@
# runtime: no detection (cannot fail), load libdbus-1 at runtime
if [ "$CFG_DBUS" = "auto" ] || [ "$CFG_DBUS" = "linked" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
- QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
- QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
+ QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null | filterIncludeOptions`
+ QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null | filterLibraryOptions`
else
QT_LIBS_DBUS="-ldbus-1"
fi
@@ -5201,8 +5201,8 @@
# auto-detect Glib support
if [ "$CFG_GLIB" != "no" ]; then
if [ -n "$PKG_CONFIG" ]; then
- QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
- QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
+ QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null | filterIncludeOptions`
+ QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null | filterLibraryOptions`
fi
if compileTest unix/glib "Glib" $QT_CFLAGS_GLIB $QT_LIBS_GLIB; then
CFG_GLIB=yes
@@ -5225,9 +5225,9 @@
# auto-detect GTK style support
if [ "$CFG_GLIB" = "yes" -a "$CFG_GTK" != "no" ]; then
if [ -n "$PKG_CONFIG" ]; then
- QT_CFLAGS_QGTK3=`$PKG_CONFIG --cflags gtk+-3.0 2>/dev/null`
- QT_LIBS_QGTK3=`$PKG_CONFIG --libs gtk+-3.0 2>/dev/null`
- QT_LIBS_QGOBJECT=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
+ QT_CFLAGS_QGTK3=`$PKG_CONFIG --cflags gtk+-3.0 2>/dev/null | filterIncludeOptions`
+ QT_LIBS_QGTK3=`$PKG_CONFIG --libs gtk+-3.0 2>/dev/null | filterLibraryOptions`
+ QT_LIBS_QGOBJECT=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null | filterLibraryOptions`
fi
if [ -n "$QT_CFLAGS_QGTK3" ] ; then
CFG_GTK=yes
@@ -5272,8 +5272,8 @@
# Auto-detect PulseAudio support
if [ "$CFG_PULSEAUDIO" != "no" ]; then
if [ -n "$PKG_CONFIG" ]; then
- QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
- QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
+ QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null | filterIncludeOptions`
+ QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null | filterLibraryOptions`
fi
if compileTest unix/pulseaudio "PulseAudio" $QT_CFLAGS_PULSEAUDIO $QT_LIBS_PULSEAUDIO; then
CFG_PULSEAUDIO=yes
@@ -5436,8 +5436,8 @@
# auto-detect FontConfig support
if [ "$CFG_FONTCONFIG" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
- QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
- QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null`
+ QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null | filterIncludeOptions`
+ QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null | filterLibraryOptions`
else
QT_CFLAGS_FONTCONFIG=
QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
@@ -5192,9 +5192,9 @@
if [ "$CFG_LIBUDEV" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
- QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
- QMAKE_LIBS_LIBUDEV=`$PKG_CONFIG --libs libudev 2>/dev/null`
- QMAKE_CFLAGS_LIBUDEV=`$PKG_CONFIG --cflags libudev 2>/dev/null`
+ QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | filterIncludeOptions | sed -e 's,^-I,,g' -e 's, -I, ,g'`
+ QMAKE_LIBS_LIBUDEV=`$PKG_CONFIG --libs libudev 2>/dev/null | filterLibraryOptions`
+ QMAKE_CFLAGS_LIBUDEV=`$PKG_CONFIG --cflags libudev 2>/dev/null | filterIncludeOptions`
QMakeVar set QMAKE_INCDIR_LIBUDEV "$QMAKE_INCDIR_LIBUDEV"
QMakeVar set QMAKE_LIBS_LIBUDEV "$QMAKE_LIBS_LIBUDEV"
fi
@@ -5333,8 +5333,8 @@
if [ "$CFG_XCB" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
- QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags xcb 2>/dev/null`"
- QMAKE_LIBS_XCB="`$PKG_CONFIG --libs xcb 2>/dev/null`"
+ QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags xcb 2>/dev/null | filterIncludeOptions`"
+ QMAKE_LIBS_XCB="`$PKG_CONFIG --libs xcb 2>/dev/null | filterLibraryOptions`"
fi
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "x11" 2> /dev/null; then
QMAKE_X11_PREFIX="`$PKG_CONFIG --variable=prefix x11`"
@@ -5631,16 +5631,16 @@
CFG_XCB="system"
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
XCB_PACKAGES="xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape"
- QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags $XCB_PACKAGES 2>/dev/null`"
- QMAKE_LIBS_XCB="`$PKG_CONFIG --libs $XCB_PACKAGES 2>/dev/null`"
+ QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags $XCB_PACKAGES 2>/dev/null | filterIncludeOptions`"
+ QMAKE_LIBS_XCB="`$PKG_CONFIG --libs $XCB_PACKAGES 2>/dev/null | filterLibraryOptions`"
fi
# libxcb version 1.10 was the first version that enables xcb-xkb by default,
# therefore the minimal xcb-xkb version we support is 1.10
CFG_XKB=no
if $PKG_CONFIG --exists "xcb-xkb >= 1.10" 2>/dev/null; then
- QMAKE_CFLAGS_XKB="`$PKG_CONFIG --cflags xcb xcb-xkb 2>/dev/null`"
- QMAKE_LIBS_XKB="`$PKG_CONFIG --libs xcb xcb-xkb 2>/dev/null`"
+ QMAKE_CFLAGS_XKB="`$PKG_CONFIG --cflags xcb xcb-xkb 2>/dev/null | filterIncludeOptions`"
+ QMAKE_LIBS_XKB="`$PKG_CONFIG --libs xcb xcb-xkb 2>/dev/null | filterLibraryOptions`"
if compileTest qpa/xcb-xkb "xcb-xkb" $QMAKE_CFLAGS_XKB $QMAKE_LIBS_XKB; then
CFG_XKB=yes
fi
@@ -5416,8 +5416,8 @@
if [ "$CFG_DIRECTFB" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists directfb 2>/dev/null; then
- QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
- QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
+ QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null | filterIncludeOptions`
+ QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null | filterLibraryOptions`
if compileTest qpa/directfb "DirectFB" $QMAKE_CFLAGS_DIRECTFB $QMAKE_LIBS_DIRECTFB; then
CFG_DIRECTFB=yes
elif [ "$CFG_DIRECTFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
@@ -5776,8 +5776,8 @@
if [ "$CFG_XKBCOMMON" != "no" ] && [ "$CFG_XKBCOMMON" != "qt" ]; then
# Check if there is a suitable system-wide xkbcommon
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon xkbcommon-x11 >= $MIN_REQ_XKBCOMMON" 2>/dev/null; then
- QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon xkbcommon-x11 2>/dev/null`"
- QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon xkbcommon-x11 2>/dev/null`"
+ QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon xkbcommon-x11 2>/dev/null | filterIncludeOptions`"
+ QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon xkbcommon-x11 2>/dev/null | filterLibraryOptions`"
QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON"
QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON"
@@ -5830,9 +5830,9 @@
fi
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then
- QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
- QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null`
- QMAKE_CFLAGS_EGL=`$PKG_CONFIG --cflags egl 2>/dev/null`
+ QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | filterIncludeOptions | sed -e 's,^-I,,g' -e 's, -I, ,g'`
+ QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null | filterLibraryOptions`
+ QMAKE_CFLAGS_EGL=`$PKG_CONFIG --cflags egl 2>/dev/null | filterIncludeOptions`
QMakeVar set QMAKE_INCDIR_EGL "$QMAKE_INCDIR_EGL"
QMakeVar set QMAKE_LIBS_EGL "$QMAKE_LIBS_EGL"
QMakeVar set QMAKE_CFLAGS_EGL "`echo " $QMAKE_CFLAGS_EGL " | sed -e 's, -I[^ ]* , ,g;s,^ ,,;s, $,,'`"