summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLlewelyn Trahaearn2017-02-18 11:23:49 -0800
committerLlewelyn Trahaearn2017-02-18 11:23:49 -0800
commitbef4f7fb2f5bbbeb5da6959c5757cd108db51996 (patch)
treeb4778f34e36bce66c7afa554243f3c806be13063
parent77e07c49a2e24c4d64fa1b25fb54c123a7367136 (diff)
downloadaur-bef4f7fb2f5bbbeb5da6959c5757cd108db51996.tar.gz
Adopted, rebased on PKGBUILD from [Extra]. Clang no longer used.
-rw-r--r--.SRCINFO43
-rw-r--r--PKGBUILD156
-rw-r--r--glib-honor-ExcludeSocketNotifiers-flag.diff63
-rw-r--r--improve-cups-support.patch84
-rw-r--r--kde4-settings.patch11
-rw-r--r--l-qclipboard_delay.patch12
-rw-r--r--l-qclipboard_fix_recursive.patch94
-rw-r--r--moc-boost-workaround.patch12
-rw-r--r--qt4-detect-gcc6.patch11
-rw-r--r--qt4-gcc6.patch (renamed from qt-everywhere-opensource-src-4.8.7-gcc6.patch)3
10 files changed, 398 insertions, 91 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 347cf8f9e6a..65082623f5e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,3 +1,5 @@
+# Generated by mksrcinfo v8
+# Sat Feb 18 19:21:55 UTC 2017
pkgbase = lib32-qt4
pkgdesc = A cross-platform application and UI framework (32-bit)
pkgver = 4.8.7
@@ -6,43 +8,46 @@ pkgbase = lib32-qt4
arch = x86_64
license = GPL3
license = LGPL
+ license = FDL
+ license = custom
makedepends = cups
- makedepends = clang
makedepends = gcc-multilib
- makedepends = lib32-mesa
+ makedepends = lib32-gtk2
makedepends = lib32-libcups
makedepends = lib32-libxfixes
- makedepends = lib32-gtk2
- depends = lib32-fontconfig
- depends = lib32-sqlite
+ makedepends = lib32-mesa
+ depends = qt4
depends = lib32-alsa-lib
- depends = lib32-glib2
depends = lib32-dbus
- depends = lib32-openssl
- depends = lib32-libpng
- depends = lib32-libtiff
- depends = lib32-libmng
+ depends = lib32-fontconfig
+ depends = lib32-glib2
depends = lib32-libgl
+ depends = lib32-libmng
+ depends = lib32-libpng
depends = lib32-libsm
+ depends = lib32-libtiff
+ depends = lib32-libxi
depends = lib32-libxrandr
depends = lib32-libxv
- depends = lib32-libxi
- depends = qt4
- optdepends = lib32-libxinerama: Xinerama support
+ depends = lib32-openssl
+ depends = lib32-sqlite
optdepends = lib32-libxcursor: Xcursor support
optdepends = lib32-libxfixes: Xfixes support
+ optdepends = lib32-libxinerama: Xinerama support
optdepends = lib32-sni-qt: StatusNotifierItem (AppIndicators) support
conflicts = lib32-qt
replaces = lib32-qt<=4.8.4
options = staticlibs
- source = http://download.qt-project.org/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
+ source = http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
+ source = improve-cups-support.patch
+ source = moc-boost-workaround.patch
source = kubuntu_14_systemtrayicon.diff
+ source = kde4-settings.patch
+ source = glib-honor-ExcludeSocketNotifiers-flag.diff
source = disable-sslv3.patch
- source = qt-everywhere-opensource-src-4.8.7-gcc6.patch
- md5sums = d990ee66bf7ab0c785589776f35ba6ad
- md5sums = a523644faa8f98a73f55c4aa23c114a6
- md5sums = 1803ab6313df762d807678e58fc85f53
- md5sums = 8ba77cd8f325c38daca8eadc982395a4
+ source = l-qclipboard_fix_recursive.patch
+ source = l-qclipboard_delay.patch
+ source = qt4-gcc6.patch
pkgname = lib32-qt4
diff --git a/PKGBUILD b/PKGBUILD
index 611046de1b3..bcf4426c70a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,88 +1,113 @@
-# Maintainer: Michał Lisowski <lisu@riseup.net>
-# Contributor: Florian Pritz <flo@xssn.at>
-# Contributor: Andrea Scarpino <andrea@archlinux.org>
-# Contributor: Pierre Schmitz <pierre@archlinux.de>
+# Maintainer: Llewelyn Trahaearn <woefulderelict [at] gmail [dot] com>
+# Contributor: Michał Lisowski <lisu [at] riseup [dot] net>
+# Contributor: Florian Pritz <flo [at] xssn [dot] at>
+# Contributor: Felix Yan <felixonmars [at] archlinux [dot] org>
+# Contributor: Andrea Scarpino <andrea[at] archlinux [dot] org>
+# Contributor: Pierre Schmitz <pierre [at] archlinux [dot] de>
-_pkgbasename=qt4
-pkgname=lib32-$_pkgbasename
+pkgname=lib32-qt4
pkgver=4.8.7
pkgrel=8
pkgdesc='A cross-platform application and UI framework (32-bit)'
arch=('x86_64')
url='http://qt-project.org/'
-license=('GPL3' 'LGPL')
-depends=('lib32-fontconfig' 'lib32-sqlite' 'lib32-alsa-lib' 'lib32-glib2'
- 'lib32-dbus' 'lib32-openssl' 'lib32-libpng' 'lib32-libtiff'
- 'lib32-libmng' 'lib32-libgl' 'lib32-libsm' 'lib32-libxrandr'
- 'lib32-libxv' 'lib32-libxi' $_pkgbasename)
-optdepends=('lib32-libxinerama: Xinerama support'
- 'lib32-libxcursor: Xcursor support'
+license=('GPL3' 'LGPL' 'FDL' 'custom')
+depends=("${pkgname#lib32-}" 'lib32-alsa-lib' 'lib32-dbus' 'lib32-fontconfig' 'lib32-glib2'
+ 'lib32-libgl' 'lib32-libmng' 'lib32-libpng' 'lib32-libsm' 'lib32-libtiff'
+ 'lib32-libxi' 'lib32-libxrandr' 'lib32-libxv' 'lib32-openssl' 'lib32-sqlite')
+makedepends=('cups' 'gcc-multilib' 'lib32-gtk2' 'lib32-libcups' 'lib32-libxfixes' 'lib32-mesa')
+optdepends=('lib32-libxcursor: Xcursor support'
'lib32-libxfixes: Xfixes support'
+ 'lib32-libxinerama: Xinerama support'
'lib32-sni-qt: StatusNotifierItem (AppIndicators) support')
-makedepends=('cups' 'clang' 'gcc-multilib' 'lib32-mesa' 'lib32-libcups'
- 'lib32-libxfixes' 'lib32-gtk2')
options=('staticlibs') # libQtUiTools builds as static only FS#36606
+conflicts=('lib32-qt')
replaces=('lib32-qt<=4.8.4')
-conflicts=(lib32-qt)
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
-source=("http://download.qt-project.org/official_releases/qt/4.8/${pkgver}/${_pkgfqn}.tar.gz"
- "kubuntu_14_systemtrayicon.diff"
- "disable-sslv3.patch"
- "qt-everywhere-opensource-src-4.8.7-gcc6.patch")
-md5sums=('d990ee66bf7ab0c785589776f35ba6ad'
- 'a523644faa8f98a73f55c4aa23c114a6'
- '1803ab6313df762d807678e58fc85f53'
- '8ba77cd8f325c38daca8eadc982395a4')
-
-export CC='clang'
-export CXX='clang++'
+source=("http://download.qt.io/official_releases/qt/4.8/${pkgver}/${_pkgfqn}.tar.gz"
+ 'improve-cups-support.patch'
+ 'moc-boost-workaround.patch'
+ 'kubuntu_14_systemtrayicon.diff'
+ 'kde4-settings.patch'
+ 'glib-honor-ExcludeSocketNotifiers-flag.diff'
+ 'disable-sslv3.patch'
+ 'l-qclipboard_fix_recursive.patch'
+ 'l-qclipboard_delay.patch'
+ 'qt4-gcc6.patch')
+sha515sums=('d990ee66bf7ab0c785589776f35ba6ad'
+ 'c439c7731c25387352d8453ca7574971'
+ 'da387bde22ae1c446f12525d2a31f070'
+ 'a523644faa8f98a73f55c4aa23c114a6'
+ '66dfea63916c8dbf47b23cb012ffdccc'
+ '85679531c8a7310317adfb7002d9f99a'
+ '1803ab6313df762d807678e58fc85f53'
+ '009de09b4e589a7770fba74405656c99'
+ 'addc5e88d538ee55e17bd49ba337ca67'
+ '98e00c5c7e5fee12e11ecbedd03f01ff')
prepare() {
- cd $srcdir/$_pkgfqn
+ cd $_pkgfqn
- export QT4DIR=$srcdir/$_pkgfqn
- export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
- export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
+ # (FS#28381) (KDEBUG#180051)
+ patch -p1 -i "${srcdir}"/improve-cups-support.patch
+
+ # QTBUG#22829
+ patch -p1 -i "${srcdir}"/moc-boost-workaround.patch
# http://blog.martin-graesslin.com/blog/2014/06/where-are-my-systray-icons/
patch -p1 -i "${srcdir}"/kubuntu_14_systemtrayicon.diff
- # disable SSLv3
- patch -p1 -i "${srcdir}"/disable-sslv3.patch
+ # FS#45106
+ patch -p0 -i "${srcdir}"/kde4-settings.patch
- # patch from Fedora, otherwise webkit will not be built (FS#51523)
- patch -p1 -i "${srcdir}"/qt-everywhere-opensource-src-4.8.7-gcc6.patch
+ # fixes for LibreOffice from the upstream Qt bug tracker FS#46436, FS#41648, FS#39819
+ # https://bugreports.qt.io/browse/QTBUG-37380
+ patch -p1 -i "${srcdir}"/glib-honor-ExcludeSocketNotifiers-flag.diff
+ # https://bugreports.qt.io/browse/QTBUG-34614
+ patch -p0 -i "${srcdir}"/l-qclipboard_fix_recursive.patch
+ # https://bugreports.qt.io/browse/QTBUG-38585
+ patch -p0 -i "${srcdir}"/l-qclipboard_delay.patch
- # some of those are likely unnecessary, but I'm too lazy to find and remove them
- sed -i "/^QMAKE_LINK\s/s|g++|g++ -m32|g" mkspecs/common/g++-base.conf
- sed -i "s|-O2|${CXXFLAGS} -m32|" mkspecs/common/g++-base.conf
- sed -i "s|-O2|${CXXFLAGS} -m32|" mkspecs/common/gcc-base.conf
+ # React to OpenSSL's OPENSSL_NO_SSL3 define
+ patch -p1 -i "${srcdir}"/disable-sslv3.patch
+
+ sed -i "s|-O2|${CXXFLAGS} -m32|" mkspecs/common/{g++,gcc}-base.conf
sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" mkspecs/common/gcc-base-unix.conf
sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS} -m32|g" mkspecs/common/gcc-base.conf
+
+ sed -i "/^QMAKE_LINK\s/s|g++|g++ -m32|g" mkspecs/common/g++-base.conf
sed -i "s|-Wl,-O1|-m32 -Wl,-O1|" mkspecs/common/g++-unix.conf
sed -e "s|-O2|$CXXFLAGS -m32|" \
-e "/^QMAKE_RPATH/s| -Wl,-rpath,||g" \
-e "/^QMAKE_LINK\s/s|g++|g++ -m32|g" \
-e "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" \
-i mkspecs/common/g++.conf
+
+ cp mkspecs/common/linux{,32}.conf
+ sed -i "/^QMAKE_LIBDIR\s/s|=|= /usr/lib32|g" mkspecs/common/linux32.conf
+ sed -i "s|common/linux.conf|common/linux32.conf|" mkspecs/linux-g++-32/qmake.conf
+
+ # Fix build with GCC6 (Fedora)
+ patch -p1 -i "$srcdir"/qt4-gcc6.patch
}
build() {
- cd $srcdir/$_pkgfqn
- export QT4DIR=$srcdir/$_pkgfqn
+ cd $_pkgfqn
+ export QT4DIR=${srcdir}/${_pkgfqn}
export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
- export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
-
- ./configure -confirm-license -opensource -v -platform linux-g++-32 \
+ export CXXFLAGS+=" -std=gnu++98" # Fix build with GCC 6
+ export PKG_CONFIG_LIBDIR='/usr/lib32/pkgconfig'
+
+ ./configure -confirm-license -opensource -platform linux-g++-32 \
-prefix /usr \
- -bindir /usr/lib32/qt4/bin \
+ -bindir /usr/lib/qt4/bin \
+ -headerdir /usr/include/qt4 \
-libdir /usr/lib32 \
-plugindir /usr/lib32/qt4/plugins \
- -headerdir /usr/include/qt4-32 \
-importdir /usr/lib32/qt4/imports \
- -datadir /usr/share/qt \
- -translationdir /usr/share/qt/translations \
- -sysconfdir /etc \
+ -datadir /usr/share/qt4 \
+ -translationdir /usr/share/qt4/translations \
+ -sysconfdir /etc/xdg \
-system-sqlite \
-no-phonon \
-no-phonon-backend \
@@ -92,27 +117,38 @@ build() {
-nomake demos \
-nomake examples \
-nomake docs \
- -optimized-qmake \
+ -silent \
-no-rpath \
+ -optimized-qmake \
+ -no-reduce-relocations \
-dbus-linked \
- -reduce-relocations \
-no-openvg
-
make
}
package() {
- cd $srcdir/$_pkgfqn
- make INSTALL_ROOT=$pkgdir install
+ cd $_pkgfqn
+ make INSTALL_ROOT="${pkgdir}" install
- # Fix wrong path in pkgconfig files
- find ${pkgdir}/usr/lib32/pkgconfig -type f -name '*.pc' \
+ # Remove conflicting files.
+ rm -rf "${pkgdir}"/usr/{bin,include,lib,share}
+
+ # install license addition
+ install -D -m644 LGPL_EXCEPTION.txt \
+ ${pkgdir}/usr/share/licenses/${pkgname}/LGPL_EXCEPTION
+
+ # Fix wrong libs path in pkgconfig files
+ find "${pkgdir}/usr/lib32/pkgconfig" -type f -name '*.pc' \
-exec perl -pi -e "s, -L${srcdir}/?\S+,,g" {} \;
+
+ # Fix wrong bins path in pkgconfig files
+ find "${pkgdir}/usr/lib32/pkgconfig" -type f -name '*.pc' \
+ -exec sed -i 's|/usr/bin/|/usr/lib/qt4/bin/|g' {} \;
+
# Fix wrong path in prl files
- find ${pkgdir}/usr/lib32 -type f -name '*.prl' \
+ find "${pkgdir}/usr/lib32" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
- rm -rf "${pkgdir}"/usr/{share,bin,tests}
- mkdir -p "$pkgdir/usr/share/licenses"
- ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
+ # The TGA plugin is broken (FS#33568)
+ rm "${pkgdir}"/usr/lib32/qt4/plugins/imageformats/libqtga.so
}
diff --git a/glib-honor-ExcludeSocketNotifiers-flag.diff b/glib-honor-ExcludeSocketNotifiers-flag.diff
new file mode 100644
index 00000000000..6949bbfef31
--- /dev/null
+++ b/glib-honor-ExcludeSocketNotifiers-flag.diff
@@ -0,0 +1,63 @@
+Author: Jan-Marek Glogowski <glogow@fbihome.de>
+Date: Thu Mar 06 18:44:43 2014 +0100
+
+ Honor QEventLoop::ExcludeSocketNotifiers in glib event loop.
+
+ Implements QEventLoop::ExcludeSocketNotifiers in the same way
+ QEventLoop::X11ExcludeTimers is already implemented for the glib
+ event loop.
+
+--- qt4-x11-4.8.1.orig/src/corelib/kernel/qeventdispatcher_glib.cpp
++++ qt4-x11-4.8.1/src/corelib/kernel/qeventdispatcher_glib.cpp
+@@ -65,6 +65,7 @@ struct GPollFDWithQSocketNotifier
+ struct GSocketNotifierSource
+ {
+ GSource source;
++ QEventLoop::ProcessEventsFlags processEventsFlags;
+ QList<GPollFDWithQSocketNotifier *> pollfds;
+ };
+
+@@ -80,6 +81,9 @@ static gboolean socketNotifierSourceChec
+ GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
+
+ bool pending = false;
++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers)
++ return pending;
++
+ for (int i = 0; !pending && i < src->pollfds.count(); ++i) {
+ GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
+
+@@ -103,6 +107,9 @@ static gboolean socketNotifierSourceDisp
+ QEvent event(QEvent::SockAct);
+
+ GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers)
++ return true;
++
+ for (int i = 0; i < src->pollfds.count(); ++i) {
+ GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
+
+@@ -330,6 +337,7 @@ QEventDispatcherGlibPrivate::QEventDispa
+ reinterpret_cast<GSocketNotifierSource *>(g_source_new(&socketNotifierSourceFuncs,
+ sizeof(GSocketNotifierSource)));
+ (void) new (&socketNotifierSource->pollfds) QList<GPollFDWithQSocketNotifier *>();
++ socketNotifierSource->processEventsFlags = QEventLoop::AllEvents;
+ g_source_set_can_recurse(&socketNotifierSource->source, true);
+ g_source_attach(&socketNotifierSource->source, mainContext);
+
+@@ -415,6 +423,7 @@ bool QEventDispatcherGlib::processEvents
+ // tell postEventSourcePrepare() and timerSource about any new flags
+ QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags;
+ d->timerSource->processEventsFlags = flags;
++ d->socketNotifierSource->processEventsFlags = flags;
+
+ if (!(flags & QEventLoop::EventLoopExec)) {
+ // force timers to be sent at normal priority
+@@ -426,6 +435,7 @@ bool QEventDispatcherGlib::processEvents
+ result = g_main_context_iteration(d->mainContext, canWait);
+
+ d->timerSource->processEventsFlags = savedFlags;
++ d->socketNotifierSource->processEventsFlags = savedFlags;
+
+ if (canWait)
+ emit awake();
diff --git a/improve-cups-support.patch b/improve-cups-support.patch
new file mode 100644
index 00000000000..e0305e11b89
--- /dev/null
+++ b/improve-cups-support.patch
@@ -0,0 +1,84 @@
+diff -ur qt-everywhere-opensource-src-4.6.2/src/gui/dialogs/qprintdialog_unix.cpp qt-everywhere-opensource-src-4.6.2-cups/src/gui/dialogs/qprintdialog_unix.cpp
+--- qt-everywhere-opensource-src-4.6.2/src/gui/dialogs/qprintdialog_unix.cpp 2010-02-11 16:55:22.000000000 +0100
++++ qt-everywhere-opensource-src-4.6.2-cups/src/gui/dialogs/qprintdialog_unix.cpp 2010-02-28 04:34:16.000000000 +0100
+@@ -569,6 +569,32 @@
+ void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
+ {
+ options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
++
++ if (cups) {
++ const ppd_option_t* duplex = cups->ppdOption("Duplex");
++ if (duplex) {
++ // copy default ppd duplex to qt dialog
++ if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
++ options.duplexShort->setChecked(true);
++ else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
++ options.duplexLong->setChecked(true);
++ else
++ options.noDuplex->setChecked(true);
++ }
++
++ if (cups->currentPPD()) {
++ // set default color
++ if (cups->currentPPD()->color_device)
++ options.color->setChecked(true);
++ else
++ options.grayscale->setChecked(true);
++ }
++
++ // set collation
++ const ppd_option_t *collate = cups->ppdOption("Collate");
++ if (collate)
++ options.collate->setChecked(qstrcmp(collate->defchoice, "True")==0);
++ }
+ }
+ #endif
+
+diff -ur qt-everywhere-opensource-src-4.6.2/src/gui/painting/qprinter.cpp qt-everywhere-opensource-src-4.6.2-cups/src/gui/painting/qprinter.cpp
+--- qt-everywhere-opensource-src-4.6.2/src/gui/painting/qprinter.cpp 2010-02-11 16:55:22.000000000 +0100
++++ qt-everywhere-opensource-src-4.6.2-cups/src/gui/painting/qprinter.cpp 2010-02-28 04:55:15.000000000 +0100
+@@ -627,6 +627,44 @@
+ && d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) {
+ setOutputFormat(QPrinter::PdfFormat);
+ }
++
++#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
++ // fill in defaults from ppd file
++ QCUPSSupport cups;
++
++ int printernum = -1;
++ for (int i = 0; i < cups.availablePrintersCount(); i++) {
++ if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name)
++ printernum = i;
++ }
++ if (printernum >= 0) {
++ cups.setCurrentPrinter(printernum);
++
++ const ppd_option_t* duplex = cups.ppdOption("Duplex");
++ if (duplex) {
++ // copy default ppd duplex to qt dialog
++ if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
++ setDuplex(DuplexShortSide);
++ else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
++ setDuplex(DuplexLongSide);
++ else
++ setDuplex(DuplexNone);
++ }
++
++ if (cups.currentPPD()) {
++ // set default color
++ if (cups.currentPPD()->color_device)
++ setColorMode(Color);
++ else
++ setColorMode(GrayScale);
++ }
++
++ // set collation
++ const ppd_option_t *collate = cups.ppdOption("Collate");
++ if (collate)
++ setCollateCopies(qstrcmp(collate->defchoice, "True")==0);
++ }
++#endif
+ }
+
+ /*!
diff --git a/kde4-settings.patch b/kde4-settings.patch
new file mode 100644
index 00000000000..4af5424c581
--- /dev/null
+++ b/kde4-settings.patch
@@ -0,0 +1,11 @@
+--- src/gui/kernel/qkde.cpp.orig 2015-05-27 11:42:02.507129332 +0200
++++ src/gui/kernel/qkde.cpp 2015-05-27 11:43:26.182875729 +0200
+@@ -63,7 +63,7 @@
+ kdeHomePath = QString::fromLocal8Bit(qgetenv("KDEHOME"));
+ if (kdeHomePath.isEmpty()) {
+ QDir homeDir(QDir::homePath());
+- QString kdeConfDir(QLatin1String("/.kde"));
++ QString kdeConfDir(QLatin1String("/.kde4"));
+ if (4 == X11->desktopVersion && homeDir.exists(QLatin1String(".kde4")))
+ kdeConfDir = QLatin1String("/.kde4");
+ kdeHomePath = QDir::homePath() + kdeConfDir;
diff --git a/l-qclipboard_delay.patch b/l-qclipboard_delay.patch
new file mode 100644
index 00000000000..22643e8d5a0
--- /dev/null
+++ b/l-qclipboard_delay.patch
@@ -0,0 +1,12 @@
+--- src/gui/kernel/qclipboard_x11.cpp.sav 2014-04-25 09:52:03.855693228 +0200
++++ src/gui/kernel/qclipboard_x11.cpp 2014-04-25 09:51:58.038693777 +0200
+@@ -548,7 +548,8 @@ bool QX11Data::clipboardWaitForEvent(Win
+ return false;
+
+ XSync(X11->display, false);
+- usleep(50000);
++ if (!XPending(X11->display))
++ usleep(5000);
+
+ now.start();
+
diff --git a/l-qclipboard_fix_recursive.patch b/l-qclipboard_fix_recursive.patch
new file mode 100644
index 00000000000..6d3bf2f2cde
--- /dev/null
+++ b/l-qclipboard_fix_recursive.patch
@@ -0,0 +1,94 @@
+--- src/corelib/kernel/qeventdispatcher_glib.cpp.sav 2014-03-28 15:26:37.000000000 +0100
++++ src/corelib/kernel/qeventdispatcher_glib.cpp 2014-04-24 09:44:09.358659204 +0200
+@@ -255,22 +255,30 @@ struct GPostEventSource
+ GSource source;
+ QAtomicInt serialNumber;
+ int lastSerialNumber;
++ QEventLoop::ProcessEventsFlags processEventsFlags;
+ QEventDispatcherGlibPrivate *d;
+ };
+
+ static gboolean postEventSourcePrepare(GSource *s, gint *timeout)
+ {
++ GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
+ QThreadData *data = QThreadData::current();
+ if (!data)
+ return false;
+
++ QEventLoop::ProcessEventsFlags excludeAllFlags
++ = QEventLoop::ExcludeUserInputEvents
++ | QEventLoop::ExcludeSocketNotifiers
++ | QEventLoop::X11ExcludeTimers;
++ if ((source->processEventsFlags & excludeAllFlags) == excludeAllFlags)
++ return false;
++
+ gint dummy;
+ if (!timeout)
+ timeout = &dummy;
+ const bool canWait = data->canWaitLocked();
+ *timeout = canWait ? -1 : 0;
+
+- GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
+ return (!canWait
+ || (source->serialNumber != source->lastSerialNumber));
+ }
+@@ -284,8 +292,14 @@ static gboolean postEventSourceDispatch(
+ {
+ GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
+ source->lastSerialNumber = source->serialNumber;
+- QCoreApplication::sendPostedEvents();
+- source->d->runTimersOnceWithNormalPriority();
++ QEventLoop::ProcessEventsFlags excludeAllFlags
++ = QEventLoop::ExcludeUserInputEvents
++ | QEventLoop::ExcludeSocketNotifiers
++ | QEventLoop::X11ExcludeTimers;
++ if ((source->processEventsFlags & excludeAllFlags) != excludeAllFlags) {
++ QCoreApplication::sendPostedEvents();
++ source->d->runTimersOnceWithNormalPriority();
++ }
+ return true; // i dunno, george...
+ }
+
+@@ -329,6 +343,7 @@ QEventDispatcherGlibPrivate::QEventDispa
+ postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
+ sizeof(GPostEventSource)));
+ postEventSource->serialNumber = 1;
++ postEventSource->processEventsFlags = QEventLoop::AllEvents;
+ postEventSource->d = this;
+ g_source_set_can_recurse(&postEventSource->source, true);
+ g_source_attach(&postEventSource->source, mainContext);
+@@ -423,6 +438,7 @@ bool QEventDispatcherGlib::processEvents
+
+ // tell postEventSourcePrepare() and timerSource about any new flags
+ QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags;
++ d->postEventSource->processEventsFlags = flags;
+ d->timerSource->processEventsFlags = flags;
+ d->socketNotifierSource->processEventsFlags = flags;
+
+@@ -435,6 +451,7 @@ bool QEventDispatcherGlib::processEvents
+ while (!result && canWait)
+ result = g_main_context_iteration(d->mainContext, canWait);
+
++ d->postEventSource->processEventsFlags = savedFlags;
+ d->timerSource->processEventsFlags = savedFlags;
+ d->socketNotifierSource->processEventsFlags = savedFlags;
+
+--- src/corelib/kernel/qeventdispatcher_unix.cpp.sav 2013-06-07 07:16:52.000000000 +0200
++++ src/corelib/kernel/qeventdispatcher_unix.cpp 2014-04-24 09:43:06.927589535 +0200
+@@ -905,7 +905,15 @@ bool QEventDispatcherUNIX::processEvents
+
+ // we are awake, broadcast it
+ emit awake();
+- QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
++
++ QEventLoop::ProcessEventsFlags excludeAllFlags
++ = QEventLoop::ExcludeUserInputEvents
++ | QEventLoop::ExcludeSocketNotifiers
++ | QEventLoop::X11ExcludeTimers;
++ if ((flags & excludeAllFlags) == excludeAllFlags)
++ return false;
++ if(( flags & excludeAllFlags ) != excludeAllFlags )
++ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+
+ int nevents = 0;
+ const bool canWait = (d->threadData->canWaitLocked()
diff --git a/moc-boost-workaround.patch b/moc-boost-workaround.patch
new file mode 100644
index 00000000000..027f8064dcf
--- /dev/null
+++ b/moc-boost-workaround.patch
@@ -0,0 +1,12 @@
+diff -upr qt-everywhere-opensource-src-4.8.6.orig/src/tools/moc/main.cpp qt-everywhere-opensource-src-4.8.6/src/tools/moc/main.cpp
+--- qt-everywhere-opensource-src-4.8.6.orig/src/tools/moc/main.cpp 2014-04-10 21:37:12.000000000 +0300
++++ qt-everywhere-opensource-src-4.8.6/src/tools/moc/main.cpp 2014-11-06 02:24:44.287305916 +0200
+@@ -190,6 +190,8 @@ int runMoc(int _argc, char **_argv)
+
+ // Workaround a bug while parsing the boost/type_traits/has_operator.hpp header. See QTBUG-22829
+ pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"];
++ pp.macros["BOOST_LEXICAL_CAST_INCLUDED"];
++ pp.macros["BOOST_NEXT_PRIOR_HPP_INCLUDED"];
+
+ QByteArray filename;
+ QByteArray output;
diff --git a/qt4-detect-gcc6.patch b/qt4-detect-gcc6.patch
deleted file mode 100644
index d96e68a00ab..00000000000
--- a/qt4-detect-gcc6.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure 2016-10-25 12:32:37.284859031 +0200
-+++ b/configure 2016-10-25 12:33:02.568191269 +0200
-@@ -7734,7 +7734,7 @@
- *-g++*)
- # Check gcc's version
- case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
-- 5*|4*|3.4*)
-+ 8*|7*|6*|5*|4*|3.4*)
- ;;
- 3.3*)
- canBuildWebKit="no"
diff --git a/qt-everywhere-opensource-src-4.8.7-gcc6.patch b/qt4-gcc6.patch
index aaf1c497f2f..d65cd2463c0 100644
--- a/qt-everywhere-opensource-src-4.8.7-gcc6.patch
+++ b/qt4-gcc6.patch
@@ -19,7 +19,8 @@ diff -up qt-everywhere-opensource-src-4.8.7/configure.gcc6 qt-everywhere-opensou
COMPILER_VERSION="4"
;;
*)
-diff -up qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h.gcc6 qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h
+diff -up qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h.gcc6
+qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h
--- qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h.gcc6 2015-05-07 09:14:48.000000000 -0500
+++ qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h 2016-04-15 07:04:19.431268227 -0500
@@ -70,8 +70,8 @@ namespace QPatternist