commit:     1417b0d0d58d2f11b54fe8edf1495dec5de4ccc4
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  5 22:44:09 2016 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Tue Jan  5 22:44:09 2016 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=1417b0d0

add qt5 support, mask it for now since its not so great at runtime

 eclass/mozconfig-v6.44.eclass                      | 66 ++++++++++++++++++++--
 profiles/package.use.mask                          |  5 ++
 .../firefox/files/firefox-44-qt-widget-fix.patch   | 21 +++++++
 www-client/firefox/firefox-44.0_beta4.ebuild       |  2 +
 4 files changed, 88 insertions(+), 6 deletions(-)

diff --git a/eclass/mozconfig-v6.44.eclass b/eclass/mozconfig-v6.44.eclass
index 1aec119..8af9bab 100644
--- a/eclass/mozconfig-v6.44.eclass
+++ b/eclass/mozconfig-v6.44.eclass
@@ -54,6 +54,16 @@ esac
 # Set the variable to "enabled" if the use flag should be enabled by default.
 # Set the variable to any value if the use flag should exist but not be 
default-enabled.
 
+# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
+# @DESCRIPTION:
+# Set this variable before the inherit line, when an ebuild can provide
+# optional qt5 support via IUSE="qt5".  Currently this would include
+# ebuilds for firefox, but thunderbird and seamonkey could follow in the 
future.
+#
+# Leave the variable UNSET if qt5 support should not be available.
+# Set the variable to "enabled" if the use flag should be enabled by default.
+# Set the variable to any value if the use flag should exist but not be 
default-enabled.
+
 # use-flags common among all mozilla ebuilds
 IUSE="${IUSE} dbus debug ffmpeg +gstreamer gstreamer-0 +jemalloc3 neon 
pulseaudio selinux startup-notification system-cairo
        system-icu system-jpeg system-libevent system-sqlite system-libvpx"
@@ -118,6 +128,24 @@ if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
        RDEPEND+="
        gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
 fi
+if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
+       inherit qmake-utils
+       if [[ ${MOZCONFIG_OPTIONAL_QT5} = "enabled" ]]; then
+               IUSE+=" +qt5"
+       else
+               IUSE+=" qt5"
+       fi
+       RDEPEND+="
+       qt5? (
+               dev-qt/qtcore:5
+               dev-qt/qtgui:5
+               dev-qt/qtnetwork:5
+               dev-qt/qtprintsupport:5
+               dev-qt/qtwidgets:5
+               dev-qt/qtxml:5
+               dev-qt/qtdeclarative:5
+       )"
+fi
 if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
        if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
                IUSE+=" +wifi"
@@ -150,6 +178,10 @@ RDEPEND+="
 # only one of gstreamer and gstreamer-0 can be enabled at a time, so set 
REQUIRED_USE to signify this
 REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
 
+# only one of gtk3 or qt5 should be permitted to be selected, since only one 
will be used.
+[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
+       REQUIRED_USE+=" ?? ( gtk3 qt5 )"
+
 # @FUNCTION: mozconfig_config
 # @DESCRIPTION:
 # Set common configure options for mozilla packages.
@@ -175,12 +207,6 @@ mozconfig_config() {
                --enable-svg \
                --with-system-bz2
 
-       if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
-               mozconfig_annotate 'gtk3 use flag' 
--enable-default-toolkit=$(usex gtk3 cairo-gtk3 cairo-gtk2)
-       else
-               mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
-       fi
-
        if has bindist ${IUSE}; then
                mozconfig_use_enable !bindist official-branding
                if [[ ${PN} == firefox ]] && use bindist ; then
@@ -240,6 +266,32 @@ mozconfig_config() {
        mozconfig_annotate 'Gentoo default' --disable-skia
        mozconfig_annotate '' --disable-gconf
 
+       # default toolkit is cairo-gtk2, optional use flags can change this
+       local toolkit="cairo-gtk2"
+       local toolkit_comment=""
+       if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
+               if use gtk3; then
+                       toolkit="cairo-gtk3"
+                       toolkit_comment="gtk3 use flag"
+               fi
+       fi
+       if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
+               if use qt5; then
+                       toolkit="cairo-qt"
+                       toolkit_comment="qt5 use flag"
+                       # need to specify these vars because the qt5 versions 
are not found otherwise,
+                       # and setting --with-qtdir overrides the pkg-config 
include dirs
+                       local i
+                       for i in qmake moc rcc; do
+                               echo "export 
HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
+                                       >> "${S}"/.mozconfig || die
+                       done
+                       echo 'unset QTDIR' >> "${S}"/.mozconfig || die
+                       mozconfig_annotate '+qt5' --disable-gio
+               fi
+       fi
+       mozconfig_annotate "${toolkit_comment}" 
--enable-default-toolkit=${toolkit}
+
        # Use jemalloc unless libc is not glibc >= 2.4
        # at this time the minimum glibc in the tree is 2.9 so we should be 
safe.
        if use elibc_glibc && use jemalloc3; then
@@ -254,8 +306,10 @@ mozconfig_config() {
 
        use ffmpeg || mozconfig_annotate '-ffmpeg' --disable-ffmpeg
        if use gstreamer ; then
+               use ffmpeg && einfo "${PN} will not use ffmpeg unless 
gstreamer:1.0 is not available at runtime"
                mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
        elif use gstreamer-0 ; then
+               use ffmpeg && einfo "${PN} will not use ffmpeg unless 
gstreamer:0.10 is not available at runtime"
                mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
        else
                mozconfig_annotate '' --disable-gstreamer

diff --git a/profiles/package.use.mask b/profiles/package.use.mask
index 4cb05b8..86cea97 100644
--- a/profiles/package.use.mask
+++ b/profiles/package.use.mask
@@ -1,3 +1,8 @@
 # mask crypt flag until enigmail releases something compatible
 # we do not want to try and play with the enigmail nightlies
 =mail-client/thunderbird-31.0_beta1 crypt
+
+# cairo-qt builds but it's runtime support really isn't good enough for
+# normal usage; seems there is a very long list of fixes needed, probably
+# similar to the 'Port gtk2 to gtk3' list.
+www-client/firefox qt5

diff --git a/www-client/firefox/files/firefox-44-qt-widget-fix.patch 
b/www-client/firefox/files/firefox-44-qt-widget-fix.patch
new file mode 100644
index 0000000..2c5ad8b
--- /dev/null
+++ b/www-client/firefox/files/firefox-44-qt-widget-fix.patch
@@ -0,0 +1,21 @@
+--- a/widget/qt/nsWindow.cpp   2016-01-05 15:03:10.031102621 -0500
++++ b/widget/qt/nsWindow.cpp   2016-01-05 14:26:38.924597447 -0500
+@@ -592,17 +592,17 @@
+ }
+ 
+ NS_IMETHODIMP
+ nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& 
aConfigurations)
+ {
+     for (uint32_t i = 0; i < aConfigurations.Length(); ++i) {
+         const Configuration& configuration = aConfigurations[i];
+ 
+-        nsWindow* w = static_cast<nsWindow*>(configuration.mChild);
++        nsWindow* w = static_cast<nsWindow*>(configuration.mChild.get());
+         NS_ASSERTION(w->GetParent() == this,
+                      "Configured widget is not a child");
+ 
+         if (w->mBounds.Size() != configuration.mBounds.Size()) {
+             w->Resize(configuration.mBounds.x, configuration.mBounds.y,
+                       configuration.mBounds.width, 
configuration.mBounds.height,
+                       true);
+         } else if (w->mBounds.TopLeft() != configuration.mBounds.TopLeft()) {

diff --git a/www-client/firefox/firefox-44.0_beta4.ebuild 
b/www-client/firefox/firefox-44.0_beta4.ebuild
index e717dd1..8549e8e 100644
--- a/www-client/firefox/firefox-44.0_beta4.ebuild
+++ b/www-client/firefox/firefox-44.0_beta4.ebuild
@@ -31,6 +31,7 @@ PATCH="${PN}-44.0-patches-0.3"
 MOZ_HTTP_URI="http://archive.mozilla.org/pub/${PN}/releases";
 
 MOZCONFIG_OPTIONAL_GTK3=1
+MOZCONFIG_OPTIONAL_QT5=1
 MOZCONFIG_OPTIONAL_WIFI=1
 MOZCONFIG_OPTIONAL_JIT="enabled"
 
@@ -133,6 +134,7 @@ src_prepare() {
        EPATCH_SUFFIX="patch" \
        EPATCH_FORCE="yes" \
        epatch "${WORKDIR}/firefox"
+       epatch "${FILESDIR}"/${PN}-44-qt-widget-fix.patch
 
        # Allow user to apply any additional patches without modifing ebuild
        epatch_user

Reply via email to