commit:     df8eccf744cf0a7990f4b0497b743dca017afcf8
Author:     Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Sun May 13 22:27:19 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun May 13 22:28:50 2018 +0000
URL:        https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=df8eccf7

dev-qt: Import Qt 4.8.7 from Gentoo ebuild repository

Package-Manager: Portage-2.3.36, Repoman-2.3.9

 dev-qt/assistant/assistant-4.8.7.ebuild            |  53 +++++++
 .../assistant/files/assistant-4.8.2+gcc-4.7.patch  |  12 ++
 dev-qt/assistant/files/disable-webkit.patch        |  26 ++++
 dev-qt/assistant/metadata.xml                      |  18 +++
 dev-qt/designer/designer-4.8.7.ebuild              |  56 +++++++
 dev-qt/designer/metadata.xml                       |  22 +++
 dev-qt/linguist/linguist-4.8.7.ebuild              |  39 +++++
 dev-qt/linguist/metadata.xml                       |  18 +++
 dev-qt/pixeltool/metadata.xml                      |  18 +++
 dev-qt/pixeltool/pixeltool-4.8.7.ebuild            |  32 ++++
 dev-qt/qdbusviewer/metadata.xml                    |  18 +++
 dev-qt/qdbusviewer/qdbusviewer-4.8.7.ebuild        |  39 +++++
 dev-qt/qt-meta/metadata.xml                        |  13 +-
 dev-qt/qt-meta/qt-meta-4.8.6.ebuild                |  38 +++++
 dev-qt/qt3support/metadata.xml                     |  13 ++
 dev-qt/qt3support/qt3support-4.8.7.ebuild          |  33 +++++
 dev-qt/qtbearer/metadata.xml                       |  13 ++
 dev-qt/qtbearer/qtbearer-4.8.7.ebuild              |  43 ++++++
 ...ExcludeSocketNotifiers-in-glib-event-loop.patch |  81 +++++++++++
 .../qtcore-4.8.5-qeventdispatcher-recursive.patch  |  94 ++++++++++++
 dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch    |  52 +++++++
 dev-qt/qtcore/files/qtcore-4.8.7-moc.patch         |  17 +++
 dev-qt/qtcore/metadata.xml                         |  21 +++
 dev-qt/qtcore/qtcore-4.8.7-r4.ebuild               |  92 ++++++++++++
 .../qtdbus-4.7-qdbusintegrator-no-const.patch      |  11 ++
 ...bus-4.8.4-qdbusconnection-silence-warning.patch |  14 ++
 dev-qt/qtdbus/metadata.xml                         |  18 +++
 dev-qt/qtdbus/qtdbus-4.8.7.ebuild                  |  40 +++++
 dev-qt/qtdeclarative/metadata.xml                  |  21 +++
 dev-qt/qtdeclarative/qtdeclarative-4.8.7.ebuild    |  51 +++++++
 dev-qt/qtdemo/files/qtdemo-4.6-plugandpaint.patch  |  13 ++
 dev-qt/qtdemo/metadata.xml                         |  20 +++
 dev-qt/qtdemo/qtdemo-4.8.7.ebuild                  |  88 +++++++++++
 dev-qt/qtgui/files/qtgui-4.7.3-cups.patch          |  84 +++++++++++
 .../qtgui-4.8.5-disable-gtk-theme-check.patch      |  22 +++
 .../qtgui/files/qtgui-4.8.5-qclipboard-delay.patch |  33 +++++
 dev-qt/qtgui/metadata.xml                          |  26 ++++
 dev-qt/qtgui/qtgui-4.8.7.ebuild                    | 162 +++++++++++++++++++++
 .../qthelp/files/qthelp-4.8.6-compat-install.patch |  35 +++++
 .../qthelp/files/qthelp-4.8.6-compat-syncqt.patch  |  25 ++++
 dev-qt/qthelp/metadata.xml                         |  20 +++
 dev-qt/qthelp/qthelp-4.8.7.ebuild                  | 111 ++++++++++++++
 .../files/qtmultimedia-4.8.0-alsa.patch            |  25 ++++
 ...4.8.6-Relax-ALSA-version-checks-for-1.1.x.patch | 155 ++++++++++++++++++++
 dev-qt/qtmultimedia/metadata.xml                   |  18 +++
 dev-qt/qtmultimedia/qtmultimedia-4.8.7.ebuild      |  44 ++++++
 dev-qt/qtopengl/metadata.xml                       |  20 +++
 dev-qt/qtopengl/qtopengl-4.8.7.ebuild              |  45 ++++++
 .../qtscript/files/4.8.6-javascriptcore-x32.patch  |  53 +++++++
 dev-qt/qtscript/metadata.xml                       |  18 +++
 dev-qt/qtscript/qtscript-4.8.7.ebuild              |  38 +++++
 dev-qt/qtsql/metadata.xml                          |  19 +++
 dev-qt/qtsql/qtsql-4.8.7-r1.ebuild                 |  59 ++++++++
 dev-qt/qtsvg/metadata.xml                          |  18 +++
 dev-qt/qtsvg/qtsvg-4.8.7.ebuild                    |  42 ++++++
 dev-qt/qttest/metadata.xml                         |  18 +++
 dev-qt/qttest/qttest-4.8.7.ebuild                  |  32 ++++
 dev-qt/qttranslations/metadata.xml                 |  14 ++
 dev-qt/qttranslations/qttranslations-4.8.7.ebuild  |  40 +++++
 dev-qt/qtwebkit/files/4.10.4-gcc5.patch            |  35 +++++
 .../files/4.10.4-use-correct-icu-typedef.patch     |  40 +++++
 dev-qt/qtwebkit/metadata.xml                       |  17 +++
 dev-qt/qtwebkit/qtwebkit-4.10.4.ebuild             | 125 ++++++++++++++++
 dev-qt/qtxmlpatterns/metadata.xml                  |  14 ++
 dev-qt/qtxmlpatterns/qtxmlpatterns-4.8.7.ebuild    |  33 +++++
 65 files changed, 2570 insertions(+), 7 deletions(-)

diff --git a/dev-qt/assistant/assistant-4.8.7.ebuild 
b/dev-qt/assistant/assistant-4.8.7.ebuild
new file mode 100644
index 0000000..f669b24
--- /dev/null
+++ b/dev-qt/assistant/assistant-4.8.7.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils qt4-build-multilib
+
+DESCRIPTION="Tool for viewing on-line documentation in Qt help file format"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+fi
+
+IUSE="webkit"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qthelp-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       >=dev-qt/qtsql-${PV}[aqua=,debug=,sqlite,${MULTILIB_USEDEP}]
+       webkit? ( ~dev-qt/qtwebkit-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.8.2+gcc-4.7.patch"
+)
+
+QT4_TARGET_DIRECTORIES="tools/assistant/tools/assistant"
+
+src_prepare() {
+       # bug 401173
+       use webkit || PATCHES+=("${FILESDIR}/disable-webkit.patch")
+
+       qt4-build-multilib_src_prepare
+}
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite2 
-no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-multimedia -no-opengl -no-phonon -no-svg 
-no-xmlpatterns
+               $(qt_use webkit)
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       doicon tools/assistant/tools/assistant/images/assistant.png
+       make_desktop_entry assistant Assistant assistant 
'Qt;Development;Documentation'
+}

diff --git a/dev-qt/assistant/files/assistant-4.8.2+gcc-4.7.patch 
b/dev-qt/assistant/files/assistant-4.8.2+gcc-4.7.patch
new file mode 100644
index 0000000..1cf7027
--- /dev/null
+++ b/dev-qt/assistant/files/assistant-4.8.2+gcc-4.7.patch
@@ -0,0 +1,12 @@
+--- tools/assistant/tools/assistant/mainwindow.cpp     2012-06-27 
03:02:37.539564947 +0200
++++ tools/assistant/tools/assistant/mainwindow.cpp     2012-06-27 
03:03:18.843561620 +0200
+@@ -944,8 +944,7 @@ void MainWindow::updateApplicationFont()
+     if (helpEngine.usesAppFont())
+         font = helpEngine.appFont();
+ 
+-    const QWidgetList &widgets = qApp->allWidgets();
+-    foreach (QWidget* widget, widgets)
++    foreach (QWidget* widget, QApplication::allWidgets())
+         widget->setFont(font);
+ }
+ 

diff --git a/dev-qt/assistant/files/disable-webkit.patch 
b/dev-qt/assistant/files/disable-webkit.patch
new file mode 100644
index 0000000..61bca05
--- /dev/null
+++ b/dev-qt/assistant/files/disable-webkit.patch
@@ -0,0 +1,26 @@
+Index: 
qt-everywhere-opensource-src-4.8.9999/tools/assistant/tools/assistant/assistant.pro
+===================================================================
+--- 
qt-everywhere-opensource-src-4.8.9999.orig/tools/assistant/tools/assistant/assistant.pro
++++ 
qt-everywhere-opensource-src-4.8.9999/tools/assistant/tools/assistant/assistant.pro
+@@ -2,7 +2,6 @@ include(../../../shared/fontpanel/fontpa
+ TEMPLATE = app
+ LANGUAGE = C++
+ TARGET = assistant
+-contains(QT_CONFIG, webkit):QT += webkit
+ CONFIG += qt \
+     warn_on \
+     help
+@@ -81,11 +80,8 @@ SOURCES += aboutdialog.cpp \
+     openpageswidget.cpp \
+     openpagesmanager.cpp \
+     openpagesswitcher.cpp
+-contains(QT_CONFIG, webkit) {
+-    SOURCES += helpviewer_qwv.cpp
+-} else {
+-    SOURCES += helpviewer_qtb.cpp
+-}
++
++SOURCES += helpviewer_qtb.cpp
+ 
+ FORMS += bookmarkdialog.ui \
+     bookmarkmanagerwidget.ui \
\ No newline at end of file

diff --git a/dev-qt/assistant/metadata.xml b/dev-qt/assistant/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/assistant/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/designer/designer-4.8.7.ebuild 
b/dev-qt/designer/designer-4.8.7.ebuild
new file mode 100644
index 0000000..40efef9
--- /dev/null
+++ b/dev-qt/designer/designer-4.8.7.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils qt4-build-multilib
+
+DESCRIPTION="WYSIWYG tool for designing and building Qt-based GUIs"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+DESIGNER_PLUGINS="declarative phonon qt3support webkit"
+IUSE="${DESIGNER_PLUGINS}"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtscript-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       declarative? ( 
~dev-qt/qtdeclarative-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       qt3support? ( ~dev-qt/qt3support-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] 
)
+       webkit? ( >=dev-qt/qtwebkit-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+PDEPEND="phonon? ( media-libs/phonon[designer,qt4] )"
+
+QT4_TARGET_DIRECTORIES="tools/designer"
+
+src_prepare() {
+       qt4-build-multilib_src_prepare
+
+       local plugin
+       for plugin in ${DESIGNER_PLUGINS}; do
+               if ! use ${plugin} || [[ ${plugin} == phonon ]]; then
+                       sed -i -e "/\<${plugin}\>/d" \
+                               tools/designer/src/plugins/plugins.pro || die
+               fi
+       done
+}
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite 
-no-sql-sqlite2 -no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-svg -no-webkit -no-phonon -no-opengl
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       doicon tools/designer/src/designer/images/designer.png
+       make_desktop_entry designer Designer designer 
'Qt;Development;GUIDesigner'
+}

diff --git a/dev-qt/designer/metadata.xml b/dev-qt/designer/metadata.xml
new file mode 100644
index 0000000..c5215df
--- /dev/null
+++ b/dev-qt/designer/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="declarative">Build the qdeclarativeview 
plugin</flag>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="phonon">Build the phononwidgets plugin</flag>
+               <flag name="qt3support">Build the qt3supportwidgets 
plugin</flag>
+               <flag name="webkit">Build the qwebview plugin</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/linguist/linguist-4.8.7.ebuild 
b/dev-qt/linguist/linguist-4.8.7.ebuild
new file mode 100644
index 0000000..90b2666
--- /dev/null
+++ b/dev-qt/linguist/linguist-4.8.7.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils qt4-build-multilib
+
+DESCRIPTION="Graphical tool for translating Qt applications"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd 
~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/designer-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="tools/linguist/linguist"
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite 
-no-sql-sqlite2 -no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-svg -no-webkit -no-phonon -no-opengl
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       newicon tools/linguist/linguist/images/icons/linguist-128-32.png 
linguist.png
+       make_desktop_entry linguist Linguist linguist 
'Qt;Development;Translation'
+}

diff --git a/dev-qt/linguist/metadata.xml b/dev-qt/linguist/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/linguist/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/pixeltool/metadata.xml b/dev-qt/pixeltool/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/pixeltool/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/pixeltool/pixeltool-4.8.7.ebuild 
b/dev-qt/pixeltool/pixeltool-4.8.7.ebuild
new file mode 100644
index 0000000..7a4c687
--- /dev/null
+++ b/dev-qt/pixeltool/pixeltool-4.8.7.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="Qt screen magnifier"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       !<dev-qt/qthelp-4.8.5:4
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="tools/pixeltool"
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite 
-no-sql-sqlite2 -no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-svg -no-webkit -no-phonon -no-opengl
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qdbusviewer/metadata.xml b/dev-qt/qdbusviewer/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qdbusviewer/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qdbusviewer/qdbusviewer-4.8.7.ebuild 
b/dev-qt/qdbusviewer/qdbusviewer-4.8.7.ebuild
new file mode 100644
index 0000000..5b59d75
--- /dev/null
+++ b/dev-qt/qdbusviewer/qdbusviewer-4.8.7.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils qt4-build-multilib
+
+DESCRIPTION="Graphical tool that lets you introspect D-Bus objects and 
messages"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtdbus-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="tools/qdbus/qdbusviewer"
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite 
-no-sql-sqlite2 -no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-svg -no-webkit -no-phonon -no-opengl
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       newicon tools/qdbus/qdbusviewer/images/qdbusviewer-128.png 
qdbusviewer.png
+       make_desktop_entry qdbusviewer QDBusViewer qdbusviewer 'Qt;Development'
+}

diff --git a/dev-qt/qt-meta/metadata.xml b/dev-qt/qt-meta/metadata.xml
index 66ad6a0..b0ad13a 100644
--- a/dev-qt/qt-meta/metadata.xml
+++ b/dev-qt/qt-meta/metadata.xml
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-<!-- maintainer-needed -->
-<use>
-       <flag name='immqt-bc'>Enable binary compatible version of immodule for
-               Qt</flag>
-       <flag name='immqt'>Enable binary incompatible version of immodule for
-               Qt</flag>
-</use>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name='immqt-bc'>Enable binary compatible version of 
immodule for Qt</flag>
+               <flag name='immqt'>Enable binary incompatible version of 
immodule for Qt</flag>
+               <flag name="qt3support">Enable the Qt3Support library for 
Qt4</flag>
+       </use>
 </pkgmetadata>

diff --git a/dev-qt/qt-meta/qt-meta-4.8.6.ebuild 
b/dev-qt/qt-meta/qt-meta-4.8.6.ebuild
new file mode 100644
index 0000000..1092d37
--- /dev/null
+++ b/dev-qt/qt-meta/qt-meta-4.8.6.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Cross-platform application development framework (metapackage)"
+HOMEPAGE="https://www.qt.io/";
+
+LICENSE="metapackage"
+SLOT="4"
+KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="+dbus examples +qt3support +webkit"
+
+DEPEND=""
+RDEPEND="
+       >=dev-qt/assistant-${PV}:4
+       >=dev-qt/designer-${PV}:4
+       >=dev-qt/linguist-${PV}:4
+       >=dev-qt/pixeltool-${PV}:4
+       dbus? ( >=dev-qt/qdbusviewer-${PV}:4 )
+       qt3support? ( >=dev-qt/qt3support-${PV}:4 )
+       >=dev-qt/qtbearer-${PV}:4
+       >=dev-qt/qtcore-${PV}:4
+       dbus? ( >=dev-qt/qtdbus-${PV}:4 )
+       >=dev-qt/qtdeclarative-${PV}:4
+       examples? ( >=dev-qt/qtdemo-${PV}:4 )
+       >=dev-qt/qtgui-${PV}:4
+       >=dev-qt/qthelp-${PV}:4
+       >=dev-qt/qtmultimedia-${PV}:4
+       >=dev-qt/qtopengl-${PV}:4
+       >=dev-qt/qtscript-${PV}:4
+       >=dev-qt/qtsql-${PV}:4
+       >=dev-qt/qtsvg-${PV}:4
+       >=dev-qt/qttest-${PV}:4
+       webkit? ( >=dev-qt/qtwebkit-${PV}:4 )
+       >=dev-qt/qtxmlpatterns-${PV}:4
+       media-libs/phonon[qt4]
+"

diff --git a/dev-qt/qt3support/metadata.xml b/dev-qt/qt3support/metadata.xml
new file mode 100644
index 0000000..d4a6068
--- /dev/null
+++ b/dev-qt/qt3support/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+</pkgmetadata>

diff --git a/dev-qt/qt3support/qt3support-4.8.7.ebuild 
b/dev-qt/qt3support/qt3support-4.8.7.ebuild
new file mode 100644
index 0000000..9e35354
--- /dev/null
+++ b/dev-qt/qt3support/qt3support-4.8.7.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The Qt3Support module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+accessibility"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,qt3support,${MULTILIB_USEDEP}]
+       
~dev-qt/qtgui-${PV}[accessibility=,aqua=,debug=,qt3support,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsql-${PV}[aqua=,debug=,qt3support,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/qt3support
+       src/tools/uic3
+       tools/porting"
+
+multilib_src_configure() {
+       local myconf=(
+               -qt3support
+               $(qt_use accessibility)
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtbearer/metadata.xml b/dev-qt/qtbearer/metadata.xml
new file mode 100644
index 0000000..d4a6068
--- /dev/null
+++ b/dev-qt/qtbearer/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+</pkgmetadata>

diff --git a/dev-qt/qtbearer/qtbearer-4.8.7.ebuild 
b/dev-qt/qtbearer/qtbearer-4.8.7.ebuild
new file mode 100644
index 0000000..7a42127
--- /dev/null
+++ b/dev-qt/qtbearer/qtbearer-4.8.7.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The network bearer plugins for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="connman networkmanager"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       connman? ( ~dev-qt/qtdbus-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       networkmanager? ( ~dev-qt/qtdbus-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] 
)
+"
+RDEPEND="${DEPEND}
+       connman? ( net-misc/connman )
+       networkmanager? ( net-misc/networkmanager )
+"
+
+pkg_setup() {
+       QT4_TARGET_DIRECTORIES="
+               src/plugins/bearer/generic
+               $(use connman && echo src/plugins/bearer/connman)
+               $(use networkmanager && echo src/plugins/bearer/networkmanager)"
+}
+
+multilib_src_configure() {
+       local myconf=(
+               $(use connman || use networkmanager || echo -no-dbus)
+               -no-accessibility -no-xmlpatterns -no-multimedia 
-no-audio-backend -no-phonon
+               -no-phonon-backend -no-svg -no-webkit -no-script 
-no-scripttools -no-declarative
+               -system-zlib -no-gif -no-libtiff -no-libpng -no-libmng 
-no-libjpeg
+               -no-cups -no-gtkstyle -no-nas-sound -no-opengl
+               -no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor 
-no-xfixes
+               -no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype 
-no-xinput -no-xkb
+       )
+       qt4_multilib_src_configure
+}

diff --git 
a/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch
 
b/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch
new file mode 100644
index 0000000..0fcc1fa
--- /dev/null
+++ 
b/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch
@@ -0,0 +1,81 @@
+From 267feb2de49eed0823ca0c29f1cd5238537c7116 Mon Sep 17 00:00:00 2001
+From: Jan-Marek Glogowski <[email protected]>
+Date: Thu, 6 Mar 2014 18:44:43 +0100
+Subject: Honor ExcludeSocketNotifiers in glib event loop
+
+Implements QEventLoop::ExcludeSocketNotifiers in the same way
+QEventLoop::X11ExcludeTimers is already implemented for the glib
+event loop.
+
+This prevents crashes when QClipboard checks for clipboard events
+and
+  qApp->clipboard()->setProperty( "useEventLoopWhenWaiting", true );
+is set.
+
+Task-number: QTBUG-34614
+Task-number: QTBUG-37380
+
+Change-Id: Id4e2a74c6bdf8c3b439a4e3813d24d11368b607d
+---
+ src/corelib/kernel/qeventdispatcher_glib.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp 
b/src/corelib/kernel/qeventdispatcher_glib.cpp
+index 0b0e308..ba522fa 100644
+--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
++++ b/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 socketNotifierSourceCheck(GSource *source)
+     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 socketNotifierSourceDispatch(GSource 
*source, GSourceFunc, gpoin
+     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);
+ 
+@@ -331,6 +338,7 @@ 
QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
+         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);
+ 
+@@ -416,6 +424,7 @@ bool 
QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
+     // 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
+@@ -427,6 +436,7 @@ bool 
QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
+         result = g_main_context_iteration(d->mainContext, canWait);
+ 
+     d->timerSource->processEventsFlags = savedFlags;
++    d->socketNotifierSource->processEventsFlags = savedFlags;
+ 
+     if (canWait)
+         emit awake();
+-- 
+2.0.0
+

diff --git a/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-recursive.patch 
b/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-recursive.patch
new file mode 100644
index 0000000..6d3bf2f
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-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/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch 
b/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch
new file mode 100644
index 0000000..b838c7a
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.7-libressl.patch
@@ -0,0 +1,52 @@
+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig        2015-11-25 
01:38:42.103898399 -0500
++++ src/network/ssl/qsslsocket_openssl_symbols.cpp     2015-11-25 
01:40:50.146247648 -0500
+@@ -224,13 +224,17 @@
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, 
return 0, return)
++#endif
+ DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, 
return 0, return)
++#endif
+ DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, 
return 0, return)
+ #else
+@@ -818,13 +822,17 @@
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_client_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_client_method)
++#endif
+     RESOLVEFUNC(SSLv23_client_method)
+     RESOLVEFUNC(TLSv1_client_method)
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_server_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_server_method)
++#endif
+     RESOLVEFUNC(SSLv23_server_method)
+     RESOLVEFUNC(TLSv1_server_method)
+     RESOLVEFUNC(X509_NAME_entry_count)
+--- src/network/ssl/qsslsocket_openssl.cpp.orig        2015-11-25 
01:44:55.235087906 -0500
++++ src/network/ssl/qsslsocket_openssl.cpp     2015-11-25 01:45:45.194443818 
-0500
+@@ -263,7 +263,11 @@
+ #endif
+         break;
+     case QSsl::SslV3:
++#ifndef OPENSSL_NO_SSL3
+         ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : 
q_SSLv3_server_method());
++#else
++        ctx = 0; // SSL 3 not supported by the system, but chosen 
deliberately -> error
++#endif
+         break;
+     case QSsl::SecureProtocols: // SslV2 will be disabled below
+     case QSsl::TlsV1SslV3: // SslV2 will be disabled below

diff --git a/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch 
b/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch
new file mode 100644
index 0000000..7660ded
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-4.8.7-moc.patch
@@ -0,0 +1,17 @@
+diff -up qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829 
qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp
+--- qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp.QTBUG-22829      
2015-05-07 09:14:44.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.7/src/tools/moc/main.cpp  2016-03-16 
13:20:43.145899869 -0500
+@@ -188,8 +188,12 @@ int runMoc(int _argc, char **_argv)
+     pp.macros["Q_MOC_RUN"];
+     pp.macros["__cplusplus"];
+ 
+-    // Workaround a bug while parsing the boost/type_traits/has_operator.hpp 
header. See QTBUG-22829
++    // Workaround a bug while parsing some boost headers. See QTBUG-22829
+     pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"];
++    pp.macros["BOOST_LEXICAL_CAST_INCLUDED"];
++    pp.macros["BOOST_NEXT_PRIOR_HPP_INCLUDED"];
++    pp.macros["BOOST_TYPE_TRAITS_HPP"];
++    pp.macros["_SYS_SYSMACROS_H_OUTER"];
+ 
+     QByteArray filename;
+     QByteArray output;

diff --git a/dev-qt/qtcore/metadata.xml b/dev-qt/qtcore/metadata.xml
new file mode 100644
index 0000000..9548ffa
--- /dev/null
+++ b/dev-qt/qtcore/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="glib">Enable <pkg>dev-libs/glib</pkg> eventloop 
support</flag>
+               <flag name="qt3support">Enable the Qt3Support libraries for 
Qt4. Note that
+                       this does not mean you can compile pure Qt3 programs 
with Qt4.</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtcore/qtcore-4.8.7-r4.ebuild 
b/dev-qt/qtcore/qtcore-4.8.7-r4.ebuild
new file mode 100644
index 0000000..48e9702
--- /dev/null
+++ b/dev-qt/qtcore/qtcore-4.8.7-r4.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="Cross-platform application development framework"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+glib iconv icu libressl qt3support ssl"
+
+DEPEND="
+       >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+       glib? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
+       iconv? ( >=virtual/libiconv-0-r2[${MULTILIB_USEDEP}] )
+       icu? ( <dev-libs/icu-59:=[${MULTILIB_USEDEP}] )
+       ssl? (
+               !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] 
)
+               libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+       )
+"
+RDEPEND="${DEPEND}"
+PDEPEND="
+       ~dev-qt/qttranslations-${PV}
+       qt3support? ( 
~dev-qt/qtgui-${PV}[aqua=,debug=,glib=,qt3support,${MULTILIB_USEDEP}] )
+"
+
+MULTILIB_WRAPPED_HEADERS=(
+       /usr/include/qt4/Qt/qconfig.h
+       /usr/include/qt4/QtCore/qconfig.h
+)
+
+PATCHES=(
+       
"${FILESDIR}/${PN}-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch" 
# bug 514968
+       "${FILESDIR}/${PN}-4.8.5-qeventdispatcher-recursive.patch" # bug 514968
+       "${FILESDIR}/${PN}-4.8.7-libressl.patch" # bug 584796
+       "${FILESDIR}/${PN}-4.8.7-moc.patch" # bug 556104, 635394
+)
+
+QT4_TARGET_DIRECTORIES="
+       src/tools/bootstrap
+       src/tools/moc
+       src/tools/rcc
+       src/tools/uic
+       src/corelib
+       src/network
+       src/xml
+       src/plugins/codecs/cn
+       src/plugins/codecs/jp
+       src/plugins/codecs/kr
+       src/plugins/codecs/tw
+       tools/linguist/lconvert
+       tools/linguist/lrelease
+       tools/linguist/lupdate"
+
+QCONFIG_DEFINE="QT_ZLIB"
+
+src_prepare() {
+       qt4-build-multilib_src_prepare
+
+       # bug 172219
+       sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \
+               -e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \
+               qmake/Makefile.unix || die "sed qmake/Makefile.unix failed"
+
+       # bug 427782
+       sed -i -e '/^CPPFLAGS\s*=/ s/-g //' \
+               qmake/Makefile.unix || die "sed CPPFLAGS in qmake/Makefile.unix 
failed"
+       sed -i -e 's/setBootstrapVariable QMAKE_CFLAGS_RELEASE/QMakeVar set 
QMAKE_CFLAGS_RELEASE/' \
+               -e 's/setBootstrapVariable QMAKE_CXXFLAGS_RELEASE/QMakeVar set 
QMAKE_CXXFLAGS_RELEASE/' \
+               configure || die "sed configure setBootstrapVariable failed"
+}
+
+multilib_src_configure() {
+       local myconf=(
+               -no-accessibility -no-xmlpatterns -no-multimedia 
-no-audio-backend -no-phonon
+               -no-phonon-backend -no-svg -no-webkit -no-script 
-no-scripttools -no-declarative
+               -system-zlib -no-gif -no-libtiff -no-libpng -no-libmng 
-no-libjpeg
+               -no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl 
-no-openvg
+               -no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor 
-no-xfixes
+               -no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype 
-no-xinput -no-xkb
+               $(qt_use glib)
+               $(qt_use iconv)
+               $(qt_use icu)
+               $(use ssl && echo -openssl-linked || echo -no-openssl)
+               $(qt_use qt3support)
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtdbus/files/qtdbus-4.7-qdbusintegrator-no-const.patch 
b/dev-qt/qtdbus/files/qtdbus-4.7-qdbusintegrator-no-const.patch
new file mode 100644
index 0000000..086eb47
--- /dev/null
+++ b/dev-qt/qtdbus/files/qtdbus-4.7-qdbusintegrator-no-const.patch
@@ -0,0 +1,11 @@
+--- src/dbus/qdbusintegrator.cpp.orig  2011-03-12 02:11:32.313467991 +0100
++++ src/dbus/qdbusintegrator.cpp       2011-03-12 02:11:03.795809176 +0100
+@@ -71,7 +71,7 @@
+ static bool isDebugging;
+ #define qDBusDebug              if (!::isDebugging); else qDebug
+ 
+-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, 
(QLatin1String(DBUS_SERVICE_DBUS)))
++Q_GLOBAL_STATIC_WITH_ARGS(QString, orgFreedesktopDBusString, 
(QLatin1String(DBUS_SERVICE_DBUS)))
+ 
+ static inline QString dbusServiceString()
+ { return *orgFreedesktopDBusString(); }

diff --git 
a/dev-qt/qtdbus/files/qtdbus-4.8.4-qdbusconnection-silence-warning.patch 
b/dev-qt/qtdbus/files/qtdbus-4.8.4-qdbusconnection-silence-warning.patch
new file mode 100644
index 0000000..dd3a5a0
--- /dev/null
+++ b/dev-qt/qtdbus/files/qtdbus-4.8.4-qdbusconnection-silence-warning.patch
@@ -0,0 +1,14 @@
+diff -up 
qt-everywhere-opensource-src-4.8.3/src/dbus/qdbusconnection.cpp.qdbusconnection_no_debug.patch
 qt-everywhere-opensource-src-4.8.3/src/dbus/qdbusconnection.cpp
+--- 
qt-everywhere-opensource-src-4.8.3/src/dbus/qdbusconnection.cpp.qdbusconnection_no_debug.patch
     2012-09-06 02:33:44.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.3/src/dbus/qdbusconnection.cpp    
2012-09-11 08:55:29.854026815 -0500
+@@ -1109,8 +1109,10 @@ public:
+         // make sure this connection is running on the main thread
+         QCoreApplication *instance = QCoreApplication::instance();
+         if (!instance) {
++#ifndef QT_NO_DEBUG
+             qWarning("QDBusConnection: %s D-Bus connection created before 
QCoreApplication. Application may misbehave.",
+                      type == SessionBus ? "session" : type == SystemBus ? 
"system" : "generic");
++#endif
+         } else if (QDBusConnectionPrivate::d(*this)) {
+             
QDBusConnectionPrivate::d(*this)->moveToThread(instance->thread());
+         }

diff --git a/dev-qt/qtdbus/metadata.xml b/dev-qt/qtdbus/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qtdbus/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtdbus/qtdbus-4.8.7.ebuild 
b/dev-qt/qtdbus/qtdbus-4.8.7.ebuild
new file mode 100644
index 0000000..060650c
--- /dev/null
+++ b/dev-qt/qtdbus/qtdbus-4.8.7.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The DBus module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       sys-apps/dbus[${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.7-qdbusintegrator-no-const.patch"
+       "${FILESDIR}/${PN}-4.8.4-qdbusconnection-silence-warning.patch"
+)
+
+QT4_TARGET_DIRECTORIES="
+       src/dbus
+       tools/qdbus/qdbus
+       tools/qdbus/qdbusxml2cpp
+       tools/qdbus/qdbuscpp2xml"
+
+QCONFIG_ADD="dbus dbus-linked"
+QCONFIG_DEFINE="QT_DBUS"
+
+multilib_src_configure() {
+       local myconf=(
+               -dbus-linked
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtdeclarative/metadata.xml 
b/dev-qt/qtdeclarative/metadata.xml
new file mode 100644
index 0000000..81a3e95
--- /dev/null
+++ b/dev-qt/qtdeclarative/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="qt3support">Enable the Qt3Support libraries for 
Qt4. Note that
+                       this does not mean you can compile pure Qt3 programs 
with Qt4.</flag>
+               <flag name="webkit">Build the WebView QML component</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtdeclarative/qtdeclarative-4.8.7.ebuild 
b/dev-qt/qtdeclarative/qtdeclarative-4.8.7.ebuild
new file mode 100644
index 0000000..a98de8b
--- /dev/null
+++ b/dev-qt/qtdeclarative/qtdeclarative-4.8.7.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The Declarative module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+accessibility qt3support webkit"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       
~dev-qt/qtgui-${PV}[accessibility=,aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtopengl-${PV}[aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtscript-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsql-${PV}[aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsvg-${PV}[accessibility=,aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtxmlpatterns-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       qt3support? ( 
~dev-qt/qt3support-${PV}[accessibility=,aqua=,debug=,${MULTILIB_USEDEP}] )
+       webkit? ( >=dev-qt/qtwebkit-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/declarative
+       src/imports
+       src/plugins/qmltooling
+       tools/qml
+       tools/qmlplugindump"
+
+QCONFIG_ADD="declarative"
+QCONFIG_DEFINE="QT_DECLARATIVE"
+
+pkg_setup() {
+       use webkit && QT4_TARGET_DIRECTORIES+="
+               src/3rdparty/webkit/Source/WebKit/qt/declarative"
+}
+
+multilib_src_configure() {
+       local myconf=(
+               -declarative -no-gtkstyle
+               $(qt_use accessibility)
+               $(qt_use qt3support)
+               $(qt_use webkit)
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtdemo/files/qtdemo-4.6-plugandpaint.patch 
b/dev-qt/qtdemo/files/qtdemo-4.6-plugandpaint.patch
new file mode 100644
index 0000000..262996a
--- /dev/null
+++ b/dev-qt/qtdemo/files/qtdemo-4.6-plugandpaint.patch
@@ -0,0 +1,13 @@
+diff --git a/examples/tools/plugandpaint/plugandpaint.pro 
b/examples/tools/plugandpaint/plugandpaint.pro
+index 9616eb8..e188bc1 100644
+--- a/examples/tools/plugandpaint/plugandpaint.pro
++++ b/examples/tools/plugandpaint/plugandpaint.pro
+@@ -10,7 +10,7 @@ SOURCES        = main.cpp \
+ symbian {
+     LIBS           = -lpnp_basictools.lib
+ } else {
+-    LIBS           = -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins 
-lpnp_basictools
++    LIBS           += -L$${QT_BUILD_TREE}/examples/tools/plugandpaint/plugins 
-lpnp_basictools
+ }
+ 
+ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {

diff --git a/dev-qt/qtdemo/metadata.xml b/dev-qt/qtdemo/metadata.xml
new file mode 100644
index 0000000..6a4bc14
--- /dev/null
+++ b/dev-qt/qtdemo/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="dbus">Build QtDBus examples and demos</flag>
+               <flag name="declarative">Build QtDeclarative examples and 
demos</flag>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="multimedia">Build QtMultimedia examples and 
demos</flag>
+               <flag name="opengl">Build QtOpenGL examples and demos</flag>
+               <flag name="phonon">Build Phonon examples and demos</flag>
+               <flag name="webkit">Build QtWebKit examples and demos</flag>
+               <flag name="xmlpatterns">Build QtXmlPatterns examples and 
demos</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+</pkgmetadata>

diff --git a/dev-qt/qtdemo/qtdemo-4.8.7.ebuild 
b/dev-qt/qtdemo/qtdemo-4.8.7.ebuild
new file mode 100644
index 0000000..53fcf60
--- /dev/null
+++ b/dev-qt/qtdemo/qtdemo-4.8.7.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="Demonstration module and examples for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="amd64 arm ppc ppc64 x86"
+fi
+
+IUSE="dbus declarative multimedia opengl phonon webkit xmlpatterns"
+
+DEPEND="
+       ~dev-qt/designer-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qthelp-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtscript-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsql-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsvg-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qttest-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       dbus? ( ~dev-qt/qtdbus-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       declarative? ( 
~dev-qt/qtdeclarative-${PV}[aqua=,debug=,webkit?,${MULTILIB_USEDEP}] )
+       multimedia? ( 
~dev-qt/qtmultimedia-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       opengl? ( ~dev-qt/qtopengl-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       phonon? ( >=media-libs/phonon-4.8.3-r1[qt4,${MULTILIB_USEDEP}] )
+       webkit? ( >=dev-qt/qtwebkit-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+       xmlpatterns? ( 
~dev-qt/qtxmlpatterns-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.6-plugandpaint.patch"
+)
+
+QT4_TARGET_DIRECTORIES="
+       demos
+       examples"
+
+src_prepare() {
+       qt4-build-multilib_src_prepare
+
+       # Array mapping USE flags to subdirs
+       local flags_subdirs_map=(
+               'dbus'
+               'declarative:declarative'
+               'multimedia:spectrum'
+               'opengl:boxes|glhypnotizer'
+               'phonon:mediaplayer'
+               'webkit:browser'
+               'xmlpatterns'
+       )
+
+       # Disable unwanted examples/demos
+       for flag in "${flags_subdirs_map[@]}"; do
+               if ! use ${flag%:*}; then
+                       einfo "Disabling ${flag%:*} examples"
+                       sed -i -e "/SUBDIRS += ${flag%:*}/d" \
+                               examples/examples.pro || die
+
+                       if [[ ${flag} == *:* ]]; then
+                               einfo "Disabling ${flag%:*} demos"
+                               sed -i -re "/SUBDIRS \+= demos_(${flag#*:})/d" \
+                                       demos/demos.pro || die
+                       fi
+               fi
+       done
+
+       # Remove bogus dependency on qt3support (bug 510042)
+       sed -i -e 's/contains(QT_CONFIG, qt3support)://' \
+               examples/graphicsview/graphicsview.pro || die
+}
+
+multilib_src_configure() {
+       local myconf=(
+               $(qt_use dbus)
+               $(qt_use declarative)
+               $(qt_use multimedia) -no-audio-backend
+               $(qt_use opengl)
+               -no-openvg
+               $(qt_use phonon) -no-phonon-backend
+               $(qt_use webkit)
+               $(qt_use xmlpatterns)
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtgui/files/qtgui-4.7.3-cups.patch 
b/dev-qt/qtgui/files/qtgui-4.7.3-cups.patch
new file mode 100644
index 0000000..e0305e1
--- /dev/null
+++ b/dev-qt/qtgui/files/qtgui-4.7.3-cups.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/dev-qt/qtgui/files/qtgui-4.8.5-disable-gtk-theme-check.patch 
b/dev-qt/qtgui/files/qtgui-4.8.5-disable-gtk-theme-check.patch
new file mode 100644
index 0000000..9a9f773
--- /dev/null
+++ b/dev-qt/qtgui/files/qtgui-4.8.5-disable-gtk-theme-check.patch
@@ -0,0 +1,22 @@
+diff -up 
qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp.qgtkstyle_disable_gtk_theme_check
 qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp
+--- 
qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp.qgtkstyle_disable_gtk_theme_check
        2013-06-09 16:28:22.938840346 -0500
++++ qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp  
2013-06-09 17:03:01.781125479 -0500
+@@ -503,18 +503,6 @@ void QGtkStylePrivate::initGtkWidgets()
+         return;
+     }
+ 
+-    static QString themeName;
+-    if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) {
+-        themeName = getThemeName();
+-
+-        if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
+-            // Due to namespace conflicts with Qt3 and obvious recursion with 
Qt4,
+-            // we cannot support the GTK_Qt Gtk engine
+-            qWarning("QGtkStyle cannot be used together with the GTK_Qt 
engine.");
+-            return;
+-        }
+-    }
+-
+     if (QGtkStylePrivate::gtk_init) {
+         // Gtk will set the Qt error handler so we have to reset it afterwards
+         x11ErrorHandler qt_x_errhandler = XSetErrorHandler(0);

diff --git a/dev-qt/qtgui/files/qtgui-4.8.5-qclipboard-delay.patch 
b/dev-qt/qtgui/files/qtgui-4.8.5-qclipboard-delay.patch
new file mode 100644
index 0000000..d46f8c5
--- /dev/null
+++ b/dev-qt/qtgui/files/qtgui-4.8.5-qclipboard-delay.patch
@@ -0,0 +1,33 @@
+From a83ddc5212736f89a0b94667c495494fe6861d63 Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <[email protected]>
+Date: Mon, 16 Jun 2014 23:52:24 +1000
+Subject: Fix delay with QClipboard and useEventLoop.
+
+This manifests when using LibreOffice with KDE integration. When KFileDialog is
+open, the clipboard is repeatedly polled causing a visible delay since using
+QClipboard in "useEventLoop" mode adds 50ms delay to every single clipboard
+fetch.
+
+Change-Id: Id30cda7b983ae7c949fa270d04f772fa44fc21cd
+Task-number: QTBUG-38585
+---
+ src/gui/kernel/qclipboard_x11.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gui/kernel/qclipboard_x11.cpp 
b/src/gui/kernel/qclipboard_x11.cpp
+index 14bf088..5f442b9 100644
+--- a/src/gui/kernel/qclipboard_x11.cpp
++++ b/src/gui/kernel/qclipboard_x11.cpp
+@@ -548,7 +548,8 @@ bool QX11Data::clipboardWaitForEvent(Window win, int type, 
XEvent *event, int ti
+                 return false;
+ 
+             XSync(X11->display, false);
+-            usleep(50000);
++            if (!XPending(X11->display))
++                usleep(5000);
+ 
+             now.start();
+ 
+-- 
+2.0.0
+

diff --git a/dev-qt/qtgui/metadata.xml b/dev-qt/qtgui/metadata.xml
new file mode 100644
index 0000000..2e17fd1
--- /dev/null
+++ b/dev-qt/qtgui/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="egl">Enable EGL integration</flag>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="glib">Enable integration with the 
<pkg>dev-libs/glib</pkg> event loop</flag>
+               <flag name="gtkstyle">Build a widgets style that mimics the 
active GTK+ theme</flag>
+               <flag name="qt3support">Enable the Qt3Support libraries for 
Qt4. Note that
+                       this does not mean you can compile pure Qt3 programs 
with Qt4.</flag>
+               <flag name="trace">Build the 'trace' graphicssystem engine 
which allows to record
+                       all drawing operations into a trace buffer. The trace 
can be replayed
+                       later with the qttracereplay tool.</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtgui/qtgui-4.8.7.ebuild b/dev-qt/qtgui/qtgui-4.8.7.ebuild
new file mode 100644
index 0000000..79f95bf
--- /dev/null
+++ b/dev-qt/qtgui/qtgui-4.8.7.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils qt4-build-multilib
+
+DESCRIPTION="The GUI module for the Qt toolkit"
+SRC_URI+=" 
https://dev.gentoo.org/~pesa/patches/${PN}-systemtrayicon-plugin-system.patch";
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+accessibility cups egl +glib gtkstyle mng nas nis qt3support tiff trace 
xinerama +xv"
+
+REQUIRED_USE="
+       gtkstyle? ( glib )
+"
+
+# cairo[-qt4] is needed because of bug 454066
+RDEPEND="
+       app-eselect/eselect-qtgraphicssystem
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,glib=,qt3support=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtscript-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       >=media-libs/fontconfig-2.10.2-r1[${MULTILIB_USEDEP}]
+       >=media-libs/freetype-2.4.11-r1:2[${MULTILIB_USEDEP}]
+       media-libs/libpng:0=[${MULTILIB_USEDEP}]
+       >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+       virtual/jpeg:0[${MULTILIB_USEDEP}]
+       !aqua? (
+               >=x11-libs/libICE-1.0.8-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libSM-1.2.1-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libX11-1.5.0-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXcursor-1.1.13-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXext-1.3.1-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXfixes-5.0-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXi-1.6.2-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXrandr-1.4.0-r1[${MULTILIB_USEDEP}]
+               >=x11-libs/libXrender-0.9.7-r1[${MULTILIB_USEDEP}]
+               xinerama? ( >=x11-libs/libXinerama-1.1.2-r1[${MULTILIB_USEDEP}] 
)
+               xv? ( >=x11-libs/libXv-1.0.7-r1[${MULTILIB_USEDEP}] )
+       )
+       cups? ( net-print/cups[${MULTILIB_USEDEP}] )
+       egl? ( media-libs/mesa[egl,${MULTILIB_USEDEP}] )
+       glib? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
+       gtkstyle? (
+               >=x11-libs/cairo-1.12[-qt4(-),${MULTILIB_USEDEP}]
+               >=x11-libs/gtk+-2.24.23-r1:2[aqua=,${MULTILIB_USEDEP}]
+       )
+       mng? ( >=media-libs/libmng-1.0.10-r2:=[${MULTILIB_USEDEP}] )
+       nas? ( >=media-libs/nas-1.9.3-r1[${MULTILIB_USEDEP}] )
+       nis? ( elibc_glibc? ( net-libs/libnsl:=[${MULTILIB_USEDEP}] ) )
+       tiff? ( >=media-libs/tiff-4.0.3-r2:0[${MULTILIB_USEDEP}] )
+       !<dev-qt/qthelp-4.8.5:4
+"
+DEPEND="${RDEPEND}
+       !aqua? ( x11-base/xorg-proto )
+"
+PDEPEND="
+       qt3support? ( ~dev-qt/qt3support-${PV}[aqua=,debug=,${MULTILIB_USEDEP}] 
)
+"
+
+PATCHES=(
+       "${DISTDIR}/${PN}-systemtrayicon-plugin-system.patch" # bug 503880
+       "${FILESDIR}/${PN}-4.7.3-cups.patch" # bug 323257
+       "${FILESDIR}/${PN}-4.8.5-disable-gtk-theme-check.patch" # bug 491226
+       "${FILESDIR}/${PN}-4.8.5-qclipboard-delay.patch" # bug 514968
+)
+
+QT4_TARGET_DIRECTORIES="
+       src/gui
+       src/scripttools
+       src/plugins/imageformats/gif
+       src/plugins/imageformats/ico
+       src/plugins/imageformats/jpeg
+       src/plugins/imageformats/tga
+       src/plugins/inputmethods"
+
+pkg_setup() {
+       use accessibility && QT4_TARGET_DIRECTORIES+=" 
src/plugins/accessible/widgets"
+       use mng && QT4_TARGET_DIRECTORIES+=" src/plugins/imageformats/mng"
+       use tiff && QT4_TARGET_DIRECTORIES+=" src/plugins/imageformats/tiff"
+       use trace && QT4_TARGET_DIRECTORIES+=" 
src/plugins/graphicssystems/trace tools/qttracereplay"
+
+       [[ ${CHOST} != *-darwin* ]] && QT4_TARGET_DIRECTORIES+=" tools/qtconfig"
+
+       QCONFIG_ADD="
+               mitshm tablet x11sm xcursor xfixes xinput xkb xrandr xrender 
xshape xsync
+               fontconfig system-freetype gif png system-png jpeg system-jpeg
+               $(usev accessibility)
+               $(usev cups)
+               $(use mng && echo system-mng)
+               $(usev nas)
+               $(usev nis)
+               $(use tiff && echo system-tiff)
+               $(usev xinerama)
+               $(use xv && echo xvideo)"
+       QCONFIG_REMOVE="no-freetype no-gif no-jpeg no-png no-gui"
+       QCONFIG_DEFINE="$(use accessibility && echo QT_ACCESSIBILITY)
+                       $(use cups && echo QT_CUPS)
+                       $(use egl && echo QT_EGL)
+                       QT_FONTCONFIG QT_FREETYPE
+                       $(use gtkstyle && echo QT_STYLE_GTK)
+                       QT_IMAGEFORMAT_JPEG QT_IMAGEFORMAT_PNG
+                       $(use mng && echo QT_IMAGEFORMAT_MNG)
+                       $(use nas && echo QT_NAS)
+                       $(use nis && echo QT_NIS)
+                       $(use tiff && echo QT_IMAGEFORMAT_TIFF)
+                       QT_SESSIONMANAGER QT_SHAPE QT_TABLET QT_XCURSOR 
QT_XFIXES
+                       $(use xinerama && echo QT_XINERAMA)
+                       QT_XINPUT QT_XKB QT_XRANDR QT_XRENDER QT_XSYNC
+                       $(use xv && echo QT_XVIDEO)"
+}
+
+src_prepare() {
+       qt4-build-multilib_src_prepare
+
+       # Add -xvideo to the list of accepted configure options
+       sed -i -e 's:|-xinerama|:&-xvideo|:' configure || die
+}
+
+multilib_src_configure() {
+       local myconf=(
+               $(qt_use accessibility)
+               $(qt_use cups)
+               $(qt_use glib)
+               $(qt_use mng libmng system)
+               $(qt_use nas nas-sound system)
+               $(qt_use nis)
+               $(qt_use tiff libtiff system)
+               $(qt_use egl)
+               $(qt_use qt3support)
+               $(qt_use gtkstyle)
+               $(qt_use xinerama)
+               $(qt_use xv xvideo)
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite 
-no-sql-sqlite2 -no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -fontconfig -no-svg -no-webkit -no-phonon -no-opengl
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       dodir /usr/share/qt4/graphicssystems
+       echo "default" > "${ED}"/usr/share/qt4/graphicssystems/raster || die
+       echo "" > "${ED}"/usr/share/qt4/graphicssystems/native || die
+
+       if has tools/qtconfig ${QT4_TARGET_DIRECTORIES}; then
+               newicon tools/qtconfig/images/appicon.png qtconfig.png
+               make_desktop_entry qtconfig 'Qt Configuration Tool' qtconfig 
'Qt;Settings;DesktopSettings'
+       fi
+}
+
+pkg_postinst() {
+       qt4-build-multilib_pkg_postinst
+
+       # raster is the default graphicssystem, set it on first install
+       eselect qtgraphicssystem set raster --use-old
+}

diff --git a/dev-qt/qthelp/files/qthelp-4.8.6-compat-install.patch 
b/dev-qt/qthelp/files/qthelp-4.8.6-compat-install.patch
new file mode 100644
index 0000000..e157381
--- /dev/null
+++ b/dev-qt/qthelp/files/qthelp-4.8.6-compat-install.patch
@@ -0,0 +1,35 @@
+From 89f99089abe0c1369a78a3bb8e2a576c513ec809 Mon Sep 17 00:00:00 2001
+From: Davide Pesavento <[email protected]>
+Date: Wed, 6 May 2015 23:21:54 +0200
+Subject: [PATCH] Install assistant_adp binary.
+
+---
+ tools/assistant/compat/compat.pro | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tools/assistant/compat/compat.pro 
b/tools/assistant/compat/compat.pro
+index 171106a..a14e3f8 100755
+--- a/tools/assistant/compat/compat.pro
++++ b/tools/assistant/compat/compat.pro
+@@ -14,6 +14,8 @@ QT += xml network
+ 
+ PROJECTNAME = Assistant
+ 
++DESTDIR = ../../../bin
++
+ FORMS += helpdialog.ui \
+         mainwindow.ui \
+         tabbedbrowser.ui \
+@@ -59,6 +61,9 @@ mac {
+     TARGET = Assistant_adp
+ }
+ 
++target.path = $$[QT_INSTALL_BINS]
++INSTALLS += target
++
+ TRANSLATIONS = translations/assistant_adp_de.ts \
+     translations/assistant_adp_ja.ts \
+     translations/assistant_adp_pl.ts \
+-- 
+2.4.0
+

diff --git a/dev-qt/qthelp/files/qthelp-4.8.6-compat-syncqt.patch 
b/dev-qt/qthelp/files/qthelp-4.8.6-compat-syncqt.patch
new file mode 100644
index 0000000..4ba6b6f
--- /dev/null
+++ b/dev-qt/qthelp/files/qthelp-4.8.6-compat-syncqt.patch
@@ -0,0 +1,25 @@
+From 37725ccec4d26148dde377d78c71046e8b6a6de9 Mon Sep 17 00:00:00 2001
+From: Davide Pesavento <[email protected]>
+Date: Wed, 6 May 2015 22:44:57 +0200
+Subject: [PATCH] Teach syncqt how to handle the QtAssistant compat headers.
+
+See https://bugs.gentoo.org/show_bug.cgi?id=529398#c47
+---
+ bin/syncqt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/bin/syncqt b/bin/syncqt
+index dd94d4d..cc5a7bf 100755
+--- a/bin/syncqt
++++ b/bin/syncqt
+@@ -81,6 +81,7 @@ my %modules = ( # path to module name map
+         "ActiveQt" => "$basedir/src/activeqt",
+         "QtTest" => "$basedir/src/testlib",
+         "QtHelp" => "$basedir/tools/assistant/lib",
++        "QtAssistant" => "$basedir/tools/assistant/compat/lib",
+         "QtDesigner" => "$basedir/tools/designer/src/lib",
+         "QtUiTools" => "$basedir/tools/designer/src/uitools",
+         "QtDBus" => "$basedir/src/dbus",
+-- 
+2.4.0
+

diff --git a/dev-qt/qthelp/metadata.xml b/dev-qt/qthelp/metadata.xml
new file mode 100644
index 0000000..47d01f4
--- /dev/null
+++ b/dev-qt/qthelp/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="compat">Build the extra compatibility layer 
required by a few packages, see
+                       
http://blog.qt.io/blog/2010/06/22/qt-assistant-compat-version-available-as-extra-source-package/</flag>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qthelp/qthelp-4.8.7.ebuild 
b/dev-qt/qthelp/qthelp-4.8.7.ebuild
new file mode 100644
index 0000000..45f1f82
--- /dev/null
+++ b/dev-qt/qthelp/qthelp-4.8.7.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The Help module for the Qt toolkit"
+SRC_URI+="
+       compat? (
+               
http://download.qt.io/archive/qt/4.6/qt-assistant-qassistantclient-library-compat-src-4.6.3.tar.gz
+               
https://dev.gentoo.org/~pesa/distfiles/qt-assistant-compat-headers-4.7.tar.gz
+       )"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ia64 ppc ppc64 sparc x86"
+fi
+
+IUSE="compat doc"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtsql-${PV}[aqua=,debug=,sqlite,${MULTILIB_USEDEP}]
+       compat? (
+               ~dev-qt/qtdbus-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+               >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+       )
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       tools/assistant/lib/fulltextsearch
+       tools/assistant/lib
+       tools/assistant/tools/qhelpgenerator
+       tools/assistant/tools/qcollectiongenerator
+       tools/assistant/tools/qhelpconverter
+       tools/qdoc3"
+
+pkg_setup() {
+       use compat && QT4_TARGET_DIRECTORIES+="
+               tools/assistant/compat
+               tools/assistant/compat/lib"
+}
+
+src_unpack() {
+       qt4-build-multilib_src_unpack
+
+       # compat version
+       # 
http://blog.qt.io/blog/2010/06/22/qt-assistant-compat-version-available-as-extra-source-package/
+       if use compat; then
+               mv 
"${WORKDIR}"/qt-assistant-qassistantclient-library-compat-version-4.6.3 
"${S}"/tools/assistant/compat || die
+               mv "${WORKDIR}"/QtAssistant "${S}"/include || die
+               find "${S}"/tools/assistant/compat -type f -execdir chmod a-x 
'{}' + || die
+       fi
+}
+
+src_prepare() {
+       use compat && PATCHES+=(
+               "${FILESDIR}/${PN}-4.8.6-compat-install.patch"
+               "${FILESDIR}/${PN}-4.8.6-compat-syncqt.patch"
+       )
+
+       qt4-build-multilib_src_prepare
+
+       # prevent rebuild of QtCore and QtXml (bug 348034)
+       sed -i -e '/^sub-qdoc3\.depends/d' doc/doc.pri || die
+}
+
+multilib_src_configure() {
+       local myconf=(
+               -system-libpng -system-libjpeg -system-zlib
+               -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite2 
-no-sql-odbc
+               -sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm 
-xinput -xkb
+               -no-multimedia -no-opengl -no-phonon -no-qt3support -no-svg 
-no-webkit -no-xmlpatterns
+               -no-nas-sound -no-cups -no-nis -fontconfig
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_compile() {
+       qt4_multilib_src_compile
+
+       # release tarballs are shipped with prebuilt docs
+       if [[ ${QT4_BUILD_TYPE} == live ]] && multilib_is_native_abi; then
+               # qhelpgenerator needs libQtHelp.so.4
+               export LD_LIBRARY_PATH=${BUILD_DIR}/lib
+               export 
DYLD_LIBRARY_PATH=${BUILD_DIR}/lib:${BUILD_DIR}/lib/QtHelp.framework
+               emake docs
+       fi
+}
+
+multilib_src_install() {
+       qt4_multilib_src_install
+
+       if multilib_is_native_abi; then
+               emake INSTALL_ROOT="${D}" install_qchdocs
+               use doc && emake INSTALL_ROOT="${D}" install_htmldocs
+
+               # do not compress .qch files
+               docompress -x "${QT4_DOCDIR#${EPREFIX}}"/qch
+       fi
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       if use compat; then
+               insinto "${QT4_DATADIR#${EPREFIX}}"/mkspecs/features
+               doins tools/assistant/compat/features/assistant.prf
+       fi
+}

diff --git a/dev-qt/qtmultimedia/files/qtmultimedia-4.8.0-alsa.patch 
b/dev-qt/qtmultimedia/files/qtmultimedia-4.8.0-alsa.patch
new file mode 100644
index 0000000..8bd40ed
--- /dev/null
+++ b/dev-qt/qtmultimedia/files/qtmultimedia-4.8.0-alsa.patch
@@ -0,0 +1,25 @@
+--- qt-everywhere-opensource-src-4.8.0.orig/configure  2012-03-13 
00:45:02.502205702 +0100
++++ qt-everywhere-opensource-src-4.8.0/configure       2012-03-13 
00:47:40.386231881 +0100
+@@ -1049,7 +1049,7 @@
+         VAL=no
+         ;;
+     #Qt style yes options
+-    
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
++    
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu|-alsa)
+         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
+         VAL=yes
+         ;;
+@@ -2399,6 +2399,13 @@
+         else
+             UNKNOWN_OPT=yes
+         fi
++        ;;
++    alsa)
++        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
++            CFG_ALSA="$VAL"
++        else
++            UNKNOWN_OPT=yes
++        fi
+         ;;
+     *)
+         UNKNOWN_OPT=yes

diff --git 
a/dev-qt/qtmultimedia/files/qtmultimedia-4.8.6-Relax-ALSA-version-checks-for-1.1.x.patch
 
b/dev-qt/qtmultimedia/files/qtmultimedia-4.8.6-Relax-ALSA-version-checks-for-1.1.x.patch
new file mode 100644
index 0000000..6a040b2
--- /dev/null
+++ 
b/dev-qt/qtmultimedia/files/qtmultimedia-4.8.6-Relax-ALSA-version-checks-for-1.1.x.patch
@@ -0,0 +1,155 @@
+From 7737e5f851fdf33ea3e8e60cf7856f47565f09d3 Mon Sep 17 00:00:00 2001
+From: Davide Pesavento <[email protected]>
+Date: Fri, 22 Jan 2016 23:17:16 +0100
+Subject: [PATCH] Relax ALSA version checks for alsa-lib >= 1.1.0
+
+Backport of qtmultimedia/3b322323d036ae2fc9f685bfc74d1ebcd5532159
+---
+ config.tests/unix/alsa/alsatest.cpp              |  2 +-
+ src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 16 ++++++++--------
+ src/multimedia/audio/qaudiodeviceinfo_alsa_p.h   |  2 +-
+ src/multimedia/audio/qaudioinput_alsa_p.cpp      |  4 ++--
+ src/multimedia/audio/qaudiooutput_alsa_p.cpp     |  4 ++--
+ 5 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/config.tests/unix/alsa/alsatest.cpp 
b/config.tests/unix/alsa/alsatest.cpp
+index ac5f1e1..8d78f95 100644
+--- a/config.tests/unix/alsa/alsatest.cpp
++++ b/config.tests/unix/alsa/alsatest.cpp
+@@ -40,7 +40,7 @@
+ ****************************************************************************/
+ 
+ #include <alsa/asoundlib.h>
+-#if(!(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10))
++#if (!(SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 10)))
+ #error "Alsa version found too old, require >= 1.0.10"
+ #endif
+ 
+diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp 
b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+index 973cbab..a09dcf6 100644
+--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
++++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+@@ -63,7 +63,7 @@ 
QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode
+     device = QLatin1String(dev);
+     this->mode = mode;
+ 
+-#if (SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+     checkSurround();
+ #endif
+ }
+@@ -159,13 +159,13 @@ bool QAudioDeviceInfoInternal::open()
+     QList<QByteArray> devices = availableDevices(mode);
+ 
+     if(dev.compare(QLatin1String("default")) == 0) {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(devices.first().constData());
+ #else
+         dev = QLatin1String("hw:0,0");
+ #endif
+     } else {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = device;
+ #else
+         int idx = 0;
+@@ -212,13 +212,13 @@ bool QAudioDeviceInfoInternal::testSettings(const 
QAudioFormat& format) const
+     QList<QByteArray> devices = 
QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput);
+ 
+     if(dev.compare(QLatin1String("default")) == 0) {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(devices.first().constData());
+ #else
+         dev = QLatin1String("hw:0,0");
+ #endif
+     } else {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = device;
+ #else
+         int idx = 0;
+@@ -396,7 +396,7 @@ void QAudioDeviceInfoInternal::updateLists()
+     }
+     channelz.append(1);
+     channelz.append(2);
+-#if (SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+     if (surround40) channelz.append(4);
+     if (surround51) channelz.append(6);
+     if (surround71) channelz.append(8);
+@@ -419,7 +419,7 @@ QList<QByteArray> 
QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
+     QList<QByteArray> devices;
+     QByteArray filter;
+ 
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+     // Create a list of all current audio devices that support mode
+     void **hints, **n;
+     char *name, *descr, *io;
+@@ -498,7 +498,7 @@ QByteArray QAudioDeviceInfoInternal::defaultOutputDevice()
+     return devices.first();
+ }
+ 
+-#if (SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+ void QAudioDeviceInfoInternal::checkSurround()
+ {
+     QList<QByteArray> devices;
+diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h 
b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
+index 96febf4..714bf60 100644
+--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
++++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
+@@ -98,7 +98,7 @@ private:
+     bool open();
+     void close();
+ 
+-#if (SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+     void checkSurround();
+     bool surround40;
+     bool surround51;
+diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp 
b/src/multimedia/audio/qaudioinput_alsa_p.cpp
+index 339fd9f..202a5b2 100644
+--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
++++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
+@@ -284,13 +284,13 @@ bool QAudioInputPrivate::open()
+     QString dev = QString(QLatin1String(m_device.constData()));
+     QList<QByteArray> devices = 
QAudioDeviceInfoInternal::availableDevices(QAudio::AudioInput);
+     if(dev.compare(QLatin1String("default")) == 0) {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(devices.first());
+ #else
+         dev = QLatin1String("hw:0,0");
+ #endif
+     } else {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(m_device);
+ #else
+         int idx = 0;
+diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp 
b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+index bf85de5..fe4b010 100644
+--- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp
++++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+@@ -299,13 +299,13 @@ bool QAudioOutputPrivate::open()
+     QString dev = QString(QLatin1String(m_device.constData()));
+     QList<QByteArray> devices = 
QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput);
+     if(dev.compare(QLatin1String("default")) == 0) {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(devices.first());
+ #else
+         dev = QLatin1String("hw:0,0");
+ #endif
+     } else {
+-#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14)
++#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+         dev = QLatin1String(m_device);
+ #else
+         int idx = 0;
+-- 
+2.7.0
+

diff --git a/dev-qt/qtmultimedia/metadata.xml b/dev-qt/qtmultimedia/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qtmultimedia/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtmultimedia/qtmultimedia-4.8.7.ebuild 
b/dev-qt/qtmultimedia/qtmultimedia-4.8.7.ebuild
new file mode 100644
index 0000000..dc8b789
--- /dev/null
+++ b/dev-qt/qtmultimedia/qtmultimedia-4.8.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The Multimedia module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="amd64 arm ~arm64 ~ia64 ppc ppc64 x86"
+fi
+
+IUSE="alsa"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.8.0-alsa.patch"
+       "${FILESDIR}/${PN}-4.8.6-Relax-ALSA-version-checks-for-1.1.x.patch" # 
bug 572426
+)
+
+QT4_TARGET_DIRECTORIES="src/multimedia"
+
+QCONFIG_ADD="multimedia"
+QCONFIG_DEFINE="QT_MULTIMEDIA"
+
+multilib_src_configure() {
+       local myconf=(
+               -multimedia -audio-backend
+               $(qt_use alsa)
+               -no-accessibility -no-qt3support -no-xmlpatterns -no-phonon 
-no-phonon-backend
+               -no-svg -no-webkit -no-script -no-scripttools -no-declarative
+               -system-zlib -no-gif -no-libtiff -no-libpng -no-libmng 
-no-libjpeg -no-openssl
+               -no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl
+               -no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor 
-no-xfixes
+               -no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype 
-no-xinput -no-xkb
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtopengl/metadata.xml b/dev-qt/qtopengl/metadata.xml
new file mode 100644
index 0000000..7d95cf8
--- /dev/null
+++ b/dev-qt/qtopengl/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="egl">Use EGL instead of GLX to manage OpenGL 
contexts</flag>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="qt3support">Enable the Qt3Support libraries for 
Qt4</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtopengl/qtopengl-4.8.7.ebuild 
b/dev-qt/qtopengl/qtopengl-4.8.7.ebuild
new file mode 100644
index 0000000..ffcb404
--- /dev/null
+++ b/dev-qt/qtopengl/qtopengl-4.8.7.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The OpenGL module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="egl qt3support"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[aqua=,debug=,egl=,qt3support=,${MULTILIB_USEDEP}]
+       >=x11-libs/libX11-1.5.0-r1[${MULTILIB_USEDEP}]
+       >=x11-libs/libXrender-0.9.7-r1[${MULTILIB_USEDEP}]
+       >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/opengl
+       src/plugins/graphicssystems/opengl"
+
+QCONFIG_ADD="opengl"
+QCONFIG_DEFINE="QT_OPENGL"
+
+multilib_src_configure() {
+       local myconf=(
+               -opengl
+               $(qt_use qt3support)
+               $(qt_use egl)
+       )
+       qt4_multilib_src_configure
+}
+
+multilib_src_install_all() {
+       qt4_multilib_src_install_all
+
+       dodir /usr/share/qt4/graphicssystems
+       echo "experimental" > "${ED}"/usr/share/qt4/graphicssystems/opengl || 
die
+}

diff --git a/dev-qt/qtscript/files/4.8.6-javascriptcore-x32.patch 
b/dev-qt/qtscript/files/4.8.6-javascriptcore-x32.patch
new file mode 100644
index 0000000..cde4cfb
--- /dev/null
+++ b/dev-qt/qtscript/files/4.8.6-javascriptcore-x32.patch
@@ -0,0 +1,53 @@
+From 4e7126ea1488f3e1df0b76cacf83cb73f9d4b54c Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <[email protected]>
+Date: Tue, 4 Mar 2014 10:46:18 +0100
+Subject: Fix build on x32
+
+Recognize x32 and disable JIT in this configuration.
+
+Task-number: QTBUG-35463
+Change-Id: Ie5bf64f22f3e58a9b3f12190cf790ad6c39f415e
+---
+ src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 
b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+index 0b95639..85ed8a7 100644
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+@@ -202,6 +202,11 @@
+ #if   defined(__x86_64__) \
+     || defined(_M_X64)
+ #define WTF_CPU_X86_64 1
++
++#if defined(__ILP32__)
++#define WTF_CPU_X32 1
++#endif
++
+ #endif
+ 
+ /* 64-bit mode on AIX */
+@@ -906,7 +911,7 @@
+ #endif
+ 
+ #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && 
!defined(WTF_USE_JSVALUE32_64)
+-#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || 
(CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || 
CPU(MIPS64) || CPU(AARCH64)
++#if (CPU(X86_64) && !CPU(X32) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || 
OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || 
CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64)
+ #define WTF_USE_JSVALUE64 1
+ #elif CPU(ARM) || CPU(PPC64)
+ #define WTF_USE_JSVALUE32 1
+@@ -923,6 +928,11 @@ on MinGW. See 
https://bugs.webkit.org/show_bug.cgi?id=29268 */
+ #define ENABLE_REPAINT_THROTTLING 0
+ #endif
+ 
++/* Disable JIT on x32 */
++#if CPU(X32)
++#define ENABLE_JIT 0
++#endif
++
+ #if !defined(ENABLE_JIT)
+ 
+ /* The JIT is tested & working on x86_64 Mac */
+-- 
+cgit v0.11.0
+

diff --git a/dev-qt/qtscript/metadata.xml b/dev-qt/qtscript/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qtscript/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtscript/qtscript-4.8.7.ebuild 
b/dev-qt/qtscript/qtscript-4.8.7.ebuild
new file mode 100644
index 0000000..94bccbb
--- /dev/null
+++ b/dev-qt/qtscript/qtscript-4.8.7.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The QtScript module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+jit"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="src/script"
+
+QCONFIG_ADD="script"
+QCONFIG_DEFINE="QT_SCRIPT"
+
+PATCHES=( "${FILESDIR}/4.8.6-javascriptcore-x32.patch" )
+
+multilib_src_configure() {
+       local myconf=(
+               $(qt_use jit javascript-jit)
+               -no-xkb -no-fontconfig -no-xrender -no-xrandr -no-xfixes 
-no-xcursor -no-xinerama
+               -no-xshape -no-sm -no-opengl -no-nas-sound -no-dbus -no-cups 
-no-nis -no-gif
+               -no-libpng -no-libmng -no-libjpeg -no-openssl -system-zlib 
-no-webkit -no-phonon
+               -no-qt3support -no-xmlpatterns -no-freetype -no-libtiff
+               -no-accessibility -no-fontconfig -no-glib -no-opengl -no-svg
+               -no-gtkstyle
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtsql/metadata.xml b/dev-qt/qtsql/metadata.xml
new file mode 100644
index 0000000..0a4a6b2
--- /dev/null
+++ b/dev-qt/qtsql/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+               <flag name="qt3support">Enable the Qt3Support libraries for 
Qt4</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtsql/qtsql-4.8.7-r1.ebuild 
b/dev-qt/qtsql/qtsql-4.8.7-r1.ebuild
new file mode 100644
index 0000000..14c4487
--- /dev/null
+++ b/dev-qt/qtsql/qtsql-4.8.7-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit multilib qt4-build-multilib
+
+DESCRIPTION="The SQL module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="freetds mysql oci8 odbc postgres qt3support +sqlite"
+
+REQUIRED_USE="
+       || ( freetds mysql oci8 odbc postgres sqlite )
+"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,qt3support=,${MULTILIB_USEDEP}]
+       freetds? ( dev-db/freetds )
+       mysql? ( virtual/libmysqlclient:=[${MULTILIB_USEDEP}] )
+       oci8? ( 
>=dev-db/oracle-instantclient-basic-11.2.0.4[${MULTILIB_USEDEP}] )
+       odbc? ( || (
+               >=dev-db/unixODBC-2.3.2-r2[${MULTILIB_USEDEP}]
+               >=dev-db/libiodbc-3.52.8-r2[${MULTILIB_USEDEP}]
+       ) )
+       postgres? ( dev-db/postgresql:* )
+       sqlite? ( >=dev-db/sqlite-3.8.3:3[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/sql
+       src/plugins/sqldrivers"
+
+multilib_src_configure() {
+       local myconf=(
+               $(qt_native_use freetds  sql-tds    plugin)
+               $(qt_use        mysql    sql-mysql  plugin) $(use mysql && echo 
-mysql_config "${EPREFIX}/usr/bin/${CHOST}-mysql_config")
+               $(qt_use        oci8     sql-oci    plugin) $(use oci8 && echo 
"-I${ORACLE_HOME}/include -L${ORACLE_HOME}/$(get_libdir)")
+               $(qt_use        odbc     sql-odbc   plugin) $(use odbc && echo 
"-I${EPREFIX}/usr/include/iodbc")
+               $(qt_native_use postgres sql-psql   plugin) $(use postgres && 
multilib_is_native_abi && echo "-I${EPREFIX}/usr/include/postgresql/pgsql")
+               $(qt_use        sqlite   sql-sqlite plugin) $(use sqlite && 
echo -system-sqlite)
+               -no-sql-db2
+               -no-sql-ibase
+               -no-sql-sqlite2
+               -no-sql-symsql
+               $(qt_use qt3support)
+               -no-accessibility -no-xmlpatterns -no-multimedia 
-no-audio-backend -no-phonon
+               -no-phonon-backend -no-svg -no-webkit -no-script 
-no-scripttools -no-declarative
+               -system-zlib -no-gif -no-libtiff -no-libpng -no-libmng 
-no-libjpeg -no-openssl
+               -no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-nis -no-opengl
+               -no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor 
-no-xfixes
+               -no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype 
-no-xinput -no-xkb
+               -no-glib
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qtsvg/metadata.xml b/dev-qt/qtsvg/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qtsvg/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtsvg/qtsvg-4.8.7.ebuild b/dev-qt/qtsvg/qtsvg-4.8.7.ebuild
new file mode 100644
index 0000000..13a7e13
--- /dev/null
+++ b/dev-qt/qtsvg/qtsvg-4.8.7.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The SVG module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE="+accessibility"
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+       ~dev-qt/qtgui-${PV}[accessibility=,aqua=,debug=,${MULTILIB_USEDEP}]
+       >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/svg
+       src/plugins/imageformats/svg
+       src/plugins/iconengines/svgiconengine"
+
+QCONFIG_ADD="svg"
+QCONFIG_DEFINE="QT_SVG"
+
+multilib_src_configure() {
+       local myconf=(
+               -svg
+               $(qt_use accessibility)
+               -no-xkb  -no-xrender
+               -no-xrandr -no-xfixes -no-xcursor -no-xinerama -no-xshape -no-sm
+               -no-opengl -no-nas-sound -no-dbus -no-cups -no-nis -no-gif 
-no-libpng
+               -no-libmng -no-libjpeg -no-openssl -system-zlib -no-webkit 
-no-phonon
+               -no-qt3support -no-xmlpatterns -no-freetype -no-libtiff
+               -no-fontconfig -no-glib -no-gtkstyle
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qttest/metadata.xml b/dev-qt/qttest/metadata.xml
new file mode 100644
index 0000000..92ddaaf
--- /dev/null
+++ b/dev-qt/qttest/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="exceptions">Add support for exceptions - like 
catching them
+                       inside the event loop (recommended by upstream)</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qttest/qttest-4.8.7.ebuild 
b/dev-qt/qttest/qttest-4.8.7.ebuild
new file mode 100644
index 0000000..c64b547
--- /dev/null
+++ b/dev-qt/qttest/qttest-4.8.7.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The QtTest module for unit testing Qt applications and libraries"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="src/testlib"
+
+multilib_src_configure() {
+       local myconf=(
+               -no-xkb -no-fontconfig -no-xrender -no-xrandr -no-xfixes 
-no-xcursor
+               -no-xinerama -no-xshape -no-sm -no-opengl
+               -no-nas-sound -no-dbus -no-cups -no-nis -no-gif -no-libpng
+               -no-libmng -no-libjpeg -no-openssl -system-zlib -no-webkit 
-no-phonon
+               -no-qt3support -no-xmlpatterns -no-freetype -no-libtiff
+               -no-accessibility -no-fontconfig -no-glib -no-svg
+       )
+       qt4_multilib_src_configure
+}

diff --git a/dev-qt/qttranslations/metadata.xml 
b/dev-qt/qttranslations/metadata.xml
new file mode 100644
index 0000000..a152b6d
--- /dev/null
+++ b/dev-qt/qttranslations/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qttranslations/qttranslations-4.8.7.ebuild 
b/dev-qt/qttranslations/qttranslations-4.8.7.ebuild
new file mode 100644
index 0000000..a3ab1f0
--- /dev/null
+++ b/dev-qt/qttranslations/qttranslations-4.8.7.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="Translation files for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}
+"
+RDEPEND=""
+
+QT4_TARGET_DIRECTORIES="translations"
+
+multilib_src_configure() {
+       if multilib_is_native_abi; then
+               qt4_prepare_env
+               qt4_symlink_tools_to_build_dir
+               qt4_foreach_target_subdir qt4_qmake
+       fi
+}
+
+multilib_src_compile() {
+       multilib_is_native_abi && qt4_multilib_src_compile
+}
+
+multilib_src_test() {
+       :
+}
+
+multilib_src_install() {
+       multilib_is_native_abi && qt4_multilib_src_install
+}

diff --git a/dev-qt/qtwebkit/files/4.10.4-gcc5.patch 
b/dev-qt/qtwebkit/files/4.10.4-gcc5.patch
new file mode 100644
index 0000000..3a6b2a3
--- /dev/null
+++ b/dev-qt/qtwebkit/files/4.10.4-gcc5.patch
@@ -0,0 +1,35 @@
+From: Allan Sandfeld Jensen <[email protected]>
+Date: Fri, 6 Mar 2015 10:20:13 +0000 (+0100)
+Subject: Fix g++ 5.0 build
+X-Git-Tag: v5.4.2~12
+X-Git-Url: 
https://codereview.qt-project.org/gitweb?p=qt%2Fqtwebkit.git;a=commitdiff_plain;h=650c6ee8e76bb574d3a1bea09e2494992d8f070e;hp=f9966f351678351ee6b971d7b6b25a4987407e46
+
+Fix g++ 5.0 build
+
+A non-inline template needs to be explicitly instantiated if used
+outside the object where it is declared.
+
+Patch suggested by Khem Raj.
+
+Task-number: QTBUG-44829
+Change-Id: Ib0adbd9273bd1cef01e5863bc8aaa9c373022792
+Reviewed-by: Andras Becsi <[email protected]>
+---
+
+diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp 
b/Source/JavaScriptCore/runtime/JSObject.cpp
+index 5637e20..bd55919 100644
+--- a/Source/JavaScriptCore/runtime/JSObject.cpp
++++ b/Source/JavaScriptCore/runtime/JSObject.cpp
+@@ -1909,6 +1909,11 @@ void 
JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, un
+     }
+ }
+ 
++// Used in JSArray.cpp so we must instantiate explicit
++template void 
JSObject::putByIndexBeyondVectorLengthWithoutAttributes<Int32Shape>(ExecState* 
exec, unsigned i, JSValue value);
++template void 
JSObject::putByIndexBeyondVectorLengthWithoutAttributes<DoubleShape>(ExecState* 
exec, unsigned i, JSValue value);
++template void 
JSObject::putByIndexBeyondVectorLengthWithoutAttributes<ContiguousShape>(ExecState*
 exec, unsigned i, JSValue value);
++
+ void JSObject::putByIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, 
unsigned i, JSValue value, bool shouldThrow, ArrayStorage* storage)
+ {
+     VM& vm = exec->vm();
+

diff --git a/dev-qt/qtwebkit/files/4.10.4-use-correct-icu-typedef.patch 
b/dev-qt/qtwebkit/files/4.10.4-use-correct-icu-typedef.patch
new file mode 100644
index 0000000..3e48162
--- /dev/null
+++ b/dev-qt/qtwebkit/files/4.10.4-use-correct-icu-typedef.patch
@@ -0,0 +1,40 @@
+From 916f00008b602ae1b260106e7fb1274d2282f61f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <[email protected]>
+Date: Tue, 3 Sep 2013 16:59:35 +0200
+Subject: [PATCH] ICU has defined UChar32 to be an int32_t since 2002
+
+This fixes the build failure of qtwebkit23 on my Gentoo machine.
+---
+ Source/WTF/wtf/unicode/qt4/UnicodeQt4.h     |    2 +-
+ Source/WTF/wtf/unicode/wchar/UnicodeWchar.h |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h 
b/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
+index a2d1ad4..392d2db 100644
+--- a/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
++++ b/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
+@@ -69,7 +69,7 @@ typedef uint16_t UChar;
+ #endif
+ 
+ #if !USE(ICU_UNICODE)
+-typedef uint32_t UChar32;
++typedef int32_t UChar32;
+ #endif
+ 
+ namespace WTF {
+diff --git a/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h 
b/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
+index 10c2026..db8944e 100644
+--- a/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
++++ b/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
+@@ -31,7 +31,7 @@
+ #include <wtf/unicode/UnicodeMacrosFromICU.h>
+ 
+ typedef wchar_t UChar;
+-typedef uint32_t UChar32;
++typedef int32_t UChar32;
+ 
+ namespace WTF {
+ namespace Unicode {
+-- 
+1.7.1
+

diff --git a/dev-qt/qtwebkit/metadata.xml b/dev-qt/qtwebkit/metadata.xml
new file mode 100644
index 0000000..43ec034
--- /dev/null
+++ b/dev-qt/qtwebkit/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <use>
+               <flag name="gstreamer">Enable HTML5 audio/video support via 
<pkg>media-libs/gstreamer</pkg> using SLOT 1.0</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtwebkit/qtwebkit-4.10.4.ebuild 
b/dev-qt/qtwebkit/qtwebkit-4.10.4.ebuild
new file mode 100644
index 0000000..c71a7b8
--- /dev/null
+++ b/dev-qt/qtwebkit/qtwebkit-4.10.4.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit eutils multilib python-any-r1 qmake-utils toolchain-funcs 
multilib-minimal
+
+MY_PV=${PV/4.10/2.3}
+
+DESCRIPTION="The WebKit module for the Qt toolkit"
+HOMEPAGE="https://www.qt.io/ http://trac.webkit.org/wiki/QtWebKit";
+SRC_URI="mirror://kde/stable/${PN}-2.3/${MY_PV}/src/${PN}-${MY_PV}.tar.gz"
+
+LICENSE="|| ( LGPL-2.1 GPL-3 )"
+SLOT="4"
+KEYWORDS="amd64 arm ia64 ~mips ppc ppc64 x86"
+IUSE="debug +gstreamer"
+
+RDEPEND="
+       >=dev-db/sqlite-3.8.3:3[${MULTILIB_USEDEP}]
+       dev-libs/libxml2:2[${MULTILIB_USEDEP}]
+       dev-libs/libxslt[${MULTILIB_USEDEP}]
+       >=dev-qt/qtcore-4.8.6-r1:4[ssl,${MULTILIB_USEDEP}]
+       >=dev-qt/qtdeclarative-4.8.6-r1:4[${MULTILIB_USEDEP}]
+       >=dev-qt/qtgui-4.8.6-r1:4[${MULTILIB_USEDEP}]
+       >=dev-qt/qtopengl-4.8.6-r1:4[${MULTILIB_USEDEP}]
+       >=dev-qt/qtscript-4.8.6-r1:4[${MULTILIB_USEDEP}]
+       >=dev-qt/qtsql-4.8.6-r1:4[sqlite,${MULTILIB_USEDEP}]
+       >=media-libs/fontconfig-2.10.2-r1[${MULTILIB_USEDEP}]
+       media-libs/libpng:0=[${MULTILIB_USEDEP}]
+       >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+       virtual/jpeg:0[${MULTILIB_USEDEP}]
+       virtual/libudev:=[${MULTILIB_USEDEP}]
+       >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+       x11-libs/libX11[${MULTILIB_USEDEP}]
+       x11-libs/libXrender[${MULTILIB_USEDEP}]
+       gstreamer? (
+               dev-libs/glib:2[${MULTILIB_USEDEP}]
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
+       )
+"
+DEPEND="${RDEPEND}
+       ${PYTHON_DEPS}
+       dev-lang/perl
+       dev-lang/ruby
+       dev-util/gperf
+       sys-devel/bison
+       sys-devel/flex
+       virtual/perl-Digest-MD5
+       virtual/perl-File-Spec
+       virtual/perl-Getopt-Long
+       virtual/pkgconfig[${MULTILIB_USEDEP}]
+"
+
+S=${WORKDIR}
+
+PATCHES=(
+       "${FILESDIR}/${PV}-gcc5.patch"
+       "${FILESDIR}/${PV}-use-correct-icu-typedef.patch"
+)
+
+src_prepare() {
+       # examples cause a sandbox violation (bug 458222)
+       sed -i -e '/SUBDIRS += examples/d' Source/QtWebKit.pro || die
+
+       # respect CXXFLAGS
+       sed -i -e '/QMAKE_CXXFLAGS_RELEASE.*=/d' \
+               Source/WTF/WTF.pro \
+               Source/JavaScriptCore/Target.pri || die
+
+       # apply patches
+       [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+       epatch_user
+}
+
+multilib_src_compile() {
+       local -x \
+               QTDIR=${EPREFIX}/usr/$(get_libdir)/qt4 \
+               WEBKITOUTPUTDIR=${BUILD_DIR}
+
+       local myconf=(
+               "${S}"/Tools/Scripts/build-webkit
+               --qt
+               # tell the build system where to find the qmake binary for the 
current ABI
+               --qmake="$(qt4_get_bindir)"/qmake
+               --qmakearg="CONFIG+=nostrip DEFINES+=HAVE_QTTESTLIB=0"
+               --makeargs="${MAKEOPTS}"
+               --$(usex debug debug release)
+               --$(usex gstreamer video no-video)
+               # disable WebKit2 since it requires Qt5
+               --no-webkit2
+               # prevent automagic dependency on qt-mobility (bug 547350)
+               --no-geolocation
+               --no-device-orientation
+               --no-orientation-events
+               # copied from eqmake4
+               QMAKE_AR="'$(tc-getAR) cqs'"
+               QMAKE_CC="'$(tc-getCC)'"
+               QMAKE_CXX="'$(tc-getCXX)'"
+               QMAKE_LINK="'$(tc-getCXX)'"
+               QMAKE_LINK_C="'$(tc-getCC)'"
+               QMAKE_OBJCOPY="'$(tc-getOBJCOPY)'"
+               QMAKE_RANLIB=
+               QMAKE_STRIP=
+               QMAKE_CFLAGS="'${CFLAGS}'"
+               QMAKE_CFLAGS_RELEASE=
+               QMAKE_CFLAGS_DEBUG=
+               QMAKE_CXXFLAGS="'${CXXFLAGS}'"
+               QMAKE_CXXFLAGS_RELEASE=
+               QMAKE_CXXFLAGS_DEBUG=
+               QMAKE_LFLAGS="'${LDFLAGS}'"
+               QMAKE_LFLAGS_RELEASE=
+               QMAKE_LFLAGS_DEBUG=
+       )
+       echo "${myconf[@]}"
+       "${myconf[@]}" || die
+}
+
+multilib_src_install() {
+       emake INSTALL_ROOT="${D}" install -C $(usex debug Debug Release)
+
+       # move pkgconfig file to the correct location
+       mv "${ED}"/usr/$(get_libdir){/qt4/pkgconfig,} || die
+}

diff --git a/dev-qt/qtxmlpatterns/metadata.xml 
b/dev-qt/qtxmlpatterns/metadata.xml
new file mode 100644
index 0000000..a152b6d
--- /dev/null
+++ b/dev-qt/qtxmlpatterns/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <!-- maintainer-needed -->
+       <upstream>
+               <bugs-to>https://bugreports.qt.io/</bugs-to>
+               <doc>https://doc.qt.io/</doc>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use 
private parts of the Qt API.
+               </subslots>
+       </slots>
+</pkgmetadata>

diff --git a/dev-qt/qtxmlpatterns/qtxmlpatterns-4.8.7.ebuild 
b/dev-qt/qtxmlpatterns/qtxmlpatterns-4.8.7.ebuild
new file mode 100644
index 0000000..daca6ec
--- /dev/null
+++ b/dev-qt/qtxmlpatterns/qtxmlpatterns-4.8.7.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit qt4-build-multilib
+
+DESCRIPTION="The XmlPatterns module for the Qt toolkit"
+
+if [[ ${QT4_BUILD_TYPE} == release ]]; then
+       KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86 
~amd64-fbsd ~x86-fbsd"
+fi
+
+IUSE=""
+
+DEPEND="
+       ~dev-qt/qtcore-${PV}[aqua=,debug=,${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+QT4_TARGET_DIRECTORIES="
+       src/xmlpatterns
+       tools/xmlpatterns
+       tools/xmlpatternsvalidator"
+
+QCONFIG_ADD="xmlpatterns"
+QCONFIG_DEFINE="QT_XMLPATTERNS"
+
+multilib_src_configure() {
+       local myconf=(
+               -xmlpatterns
+       )
+       qt4_multilib_src_configure
+}

Reply via email to