summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2011-11-28 21:01:19 +0000
committerTheo Chatzimichos <tampakrap@gentoo.org>2011-11-28 21:01:19 +0000
commit19ceb9675410262ea9d77957f08d5e2ed5d7097d (patch)
treee3bd8ce5d94aac600e0745b2c978010df074ed0c /x11-libs
parentBackport patch from Qt 4.8 to fix crash in LibreOffice, as pointed out by sca... (diff)
downloadgentoo-2-19ceb9675410262ea9d77957f08d5e2ed5d7097d.tar.gz
gentoo-2-19ceb9675410262ea9d77957f08d5e2ed5d7097d.tar.bz2
gentoo-2-19ceb9675410262ea9d77957f08d5e2ed5d7097d.zip
Backport patch from Qt 4.8 to fix crash in LibreOffice, as pointed out by scarabeus. FreeDesktop bug 40298
(Portage version: 2.2.0_alpha77/cvs/Linux x86_64)
Diffstat (limited to 'x11-libs')
-rw-r--r--x11-libs/qt-gui/ChangeLog9
-rw-r--r--x11-libs/qt-gui/files/qt-gui-4.7.4-fix-libreoffice-crash.patch46
-rw-r--r--x11-libs/qt-gui/qt-gui-4.7.4-r1.ebuild195
3 files changed, 249 insertions, 1 deletions
diff --git a/x11-libs/qt-gui/ChangeLog b/x11-libs/qt-gui/ChangeLog
index 7e851607fc7c..8f8a476191e9 100644
--- a/x11-libs/qt-gui/ChangeLog
+++ b/x11-libs/qt-gui/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for x11-libs/qt-gui
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.154 2011/11/26 20:01:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.155 2011/11/28 21:01:19 tampakrap Exp $
+
+*qt-gui-4.7.4-r1 (28 Nov 2011)
+
+ 28 Nov 2011; Theo Chatzimichos <tampakrap@gentoo.org>
+ +qt-gui-4.7.4-r1.ebuild, +files/qt-gui-4.7.4-fix-libreoffice-crash.patch:
+ Backport patch from Qt 4.8 to fix crash in LibreOffice, as pointed out by
+ scarabeus. FreeDesktop bug 40298
26 Nov 2011; Robin H. Johnson <robbat2@gentoo.org> Manifest:
Bug 385719: upstream altered qt-everywhere-opensource-src-4.7.4.tar.gz, mass
diff --git a/x11-libs/qt-gui/files/qt-gui-4.7.4-fix-libreoffice-crash.patch b/x11-libs/qt-gui/files/qt-gui-4.7.4-fix-libreoffice-crash.patch
new file mode 100644
index 000000000000..0350183f8a95
--- /dev/null
+++ b/x11-libs/qt-gui/files/qt-gui-4.7.4-fix-libreoffice-crash.patch
@@ -0,0 +1,46 @@
+--- src/corelib/global/qnamespace.qdoc.sav 2011-08-23 14:02:27.000000000 +0200
++++ src/corelib/global/qnamespace.qdoc 2011-11-22 13:06:00.879288001 +0100
+@@ -167,6 +167,10 @@
+ attribute is true. This attribute must be set after QApplication is
+ constructed. This is only supported in Symbian^3 and later Symbian releases.
+
++ \value AA_X11InitThreads Calls XInitThreads() as part of the QApplication
++ construction in order to make Xlib calls thread-safe.
++
++
+ \omitvalue AA_AttributeCount
+ */
+
+--- src/corelib/global/qnamespace.h.sav 2011-08-23 14:02:27.000000000 +0200
++++ src/corelib/global/qnamespace.h 2011-11-22 13:07:35.925288002 +0100
+@@ -544,6 +544,7 @@ public:
+ AA_MacDontSwapCtrlAndMeta = 7,
+ AA_S60DontConstructApplicationPanes = 8,
+ AA_S60DisablePartialScreenInputMode = 9,
++ AA_X11InitThreads = 10,
+
+ // Add new attributes before this line
+ AA_AttributeCount
+--- src/gui/kernel/qapplication_x11.cpp.sav 2011-08-23 14:02:27.000000000 +0200
++++ src/gui/kernel/qapplication_x11.cpp 2011-11-22 13:06:00.881288001 +0100
+@@ -1739,6 +1739,9 @@ void qt_init(QApplicationPrivate *priv,
+ } else {
+ // Qt controls everything (default)
+
++ if (QApplication::testAttribute(Qt::AA_X11InitThreads))
++ XInitThreads();
++
+ // Set application name and class
+ char *app_class = 0;
+ if (argv && argv[0]) {
+--- src/gui/image/qpixmap.cpp.sav 2011-08-23 14:02:27.000000000 +0200
++++ src/gui/image/qpixmap.cpp 2011-11-22 13:06:39.723288001 +0100
+@@ -99,7 +99,7 @@ static bool qt_pixmap_thread_test()
+ return false;
+ }
+ #ifndef Q_WS_WIN
+- if (qApp->thread() != QThread::currentThread()) {
++ if (!QApplication::testAttribute(Qt::AA_X11InitThreads) && qApp->thread() != QThread::currentThread()) {
+ qWarning("QPixmap: It is not safe to use pixmaps outside the GUI thread");
+ return false;
+ }
diff --git a/x11-libs/qt-gui/qt-gui-4.7.4-r1.ebuild b/x11-libs/qt-gui/qt-gui-4.7.4-r1.ebuild
new file mode 100644
index 000000000000..7b9a59ce8fd1
--- /dev/null
+++ b/x11-libs/qt-gui/qt-gui-4.7.4-r1.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/qt-gui-4.7.4-r1.ebuild,v 1.1 2011/11/28 21:01:19 tampakrap Exp $
+
+EAPI="3"
+inherit confutils qt4-build
+
+DESCRIPTION="The GUI module for the Qt toolkit"
+SLOT="4"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 -sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+IUSE="+accessibility cups dbus egl +glib gtkstyle mng nas nis private-headers qt3support raster tiff trace xinerama"
+
+RDEPEND="media-libs/fontconfig
+ media-libs/freetype:2
+ media-libs/libpng:0
+ sys-libs/zlib
+ virtual/jpeg
+ ~x11-libs/qt-core-${PV}[aqua=,debug=,glib=,qt3support=]
+ ~x11-libs/qt-script-${PV}[aqua=,debug=]
+ !aqua? (
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXrandr
+ x11-libs/libXcursor
+ x11-libs/libXfont
+ x11-libs/libSM
+ x11-libs/libXi
+ )
+ cups? ( net-print/cups )
+ dbus? ( ~x11-libs/qt-dbus-${PV}[aqua=,debug=] )
+ gtkstyle? ( x11-libs/gtk+:2[aqua=] )
+ mng? ( >=media-libs/libmng-1.0.9 )
+ nas? ( >=media-libs/nas-1.5 )
+ tiff? ( media-libs/tiff:0 )
+ xinerama? ( x11-libs/libXinerama )"
+DEPEND="${RDEPEND}
+ !aqua? (
+ x11-proto/xextproto
+ x11-proto/inputproto
+ )
+ xinerama? ( x11-proto/xineramaproto )"
+RDEPEND="${RDEPEND}
+ !~x11-themes/qgtkstyle-4.7.2"
+PDEPEND="qt3support? ( ~x11-libs/qt-qt3support-${PV}[aqua=,debug=] )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.7.3-cups.patch"
+ "${FILESDIR}/${P}-fix-libreoffice-crash.patch"
+)
+
+pkg_setup() {
+ if ! use qt3support; then
+ ewarn "WARNING: if you need 'qtconfig', you _must_ enable qt3support."
+ fi
+
+ confutils_use_depend_all gtkstyle glib
+
+ QT4_TARGET_DIRECTORIES="
+ src/gui
+ src/scripttools
+ tools/designer
+ tools/linguist/linguist
+ src/plugins/imageformats/gif
+ src/plugins/imageformats/ico
+ src/plugins/imageformats/jpeg
+ src/plugins/inputmethods"
+
+ QT4_EXTRACT_DIRECTORIES="
+ include
+ src
+ tools/linguist/phrasebooks
+ tools/linguist/shared
+ tools/shared"
+
+ use dbus && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} tools/qdbus/qdbusviewer"
+ use mng && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/mng"
+ use tiff && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/tiff"
+ use accessibility && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/accessible/widgets"
+ use trace && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/graphicssystems/trace"
+
+ QT4_EXTRACT_DIRECTORIES="${QT4_TARGET_DIRECTORIES} ${QT4_EXTRACT_DIRECTORIES}"
+
+ qt4-build_pkg_setup
+}
+
+src_prepare() {
+ qt4-build_src_prepare
+
+ # Don't build plugins this go around, because they depend on qt3support lib
+ sed -i -e "s:CONFIG(shared:# &:g" "${S}"/tools/designer/src/src.pro
+}
+
+src_configure() {
+ export PATH="${S}/bin:${PATH}"
+ export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
+
+ myconf="$(qt_use accessibility)
+ $(qt_use cups)
+ $(qt_use glib)
+ $(qt_use mng libmng system)
+ $(qt_use nis)
+ $(qt_use tiff libtiff system)
+ $(qt_use dbus qdbus)
+ $(qt_use dbus)
+ $(qt_use egl)
+ $(qt_use qt3support)
+ $(qt_use gtkstyle)
+ $(qt_use xinerama)"
+
+ use nas && myconf="${myconf} -system-nas-sound"
+ use raster && myconf="${myconf} -graphicssystem raster"
+
+ myconf="${myconf} -qt-gif -system-libpng -system-libjpeg
+ -no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite -no-sql-sqlite2
+ -no-sql-odbc -xrender -xrandr -xkb -xshape -sm -no-svg -no-webkit
+ -no-phonon -no-opengl"
+
+ qt4-build_src_configure
+
+ if use gtkstyle; then
+ einfo "patching the Makefile to fix qgtkstyle compilation"
+ sed "s:-I/usr/include/qt4 ::" -i src/gui/Makefile ||
+ die "sed failed"
+ fi
+ einfo "patching the Makefile to fix bug #361277"
+ sed "s:-I/usr/include/qt4/QtGui ::" -i src/gui/Makefile ||
+ die "sed failed"
+}
+
+src_install() {
+ QCONFIG_ADD="x11sm xshape xcursor xfixes xrandr xrender xkb fontconfig
+ $(usev accessibility) $(usev xinerama) $(usev cups) $(usev nas)
+ gif png system-png system-jpeg
+ $(use mng && echo system-mng)
+ $(use tiff && echo system-tiff)"
+ QCONFIG_REMOVE="no-gif no-png"
+ QCONFIG_DEFINE="$(use accessibility && echo QT_ACCESSIBILITY)
+ $(use cups && echo QT_CUPS) QT_FONTCONFIG QT_IMAGEFORMAT_JPEG
+ $(use mng && echo QT_IMAGEFORMAT_MNG)
+ $(use nas && echo QT_NAS)
+ $(use nis && echo QT_NIS) QT_IMAGEFORMAT_PNG QT_SESSIONMANAGER QT_SHAPE
+ $(use tiff && echo QT_IMAGEFORMAT_TIFF) QT_XCURSOR
+ $(use xinerama && echo QT_XINERAMA) QT_XFIXES QT_XKB QT_XRANDR QT_XRENDER"
+
+ qt4-build_src_install
+
+ # remove unnecessary Windows headers
+ rm -f "${D}${QTHEADERDIR}"/{Qt,QtGui}/qwindowdefs_win.h
+ # remove Mac OS X headers
+ use aqua || rm -f \
+ "${D}${QTHEADERDIR}"/{Qt,QtGui}/qmacstyle_mac.h \
+ "${D}${QTHEADERDIR}"/QtGui/QMacStyle
+
+ # qt-creator
+ # some qt-creator headers are located
+ # under /usr/include/qt4/QtDesigner/private.
+ # those headers are just includes of the headers
+ # which are located under tools/designer/src/lib/*
+ # So instead of installing both, we create the private folder
+ # and drop tools/designer/src/lib/* headers in it.
+ if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then
+ insinto "${QTLIBDIR#${EPREFIX}}"/QtDesigner.framework/Headers/private/
+ else
+ insinto "${QTHEADERDIR#${EPREFIX}}"/QtDesigner/private/
+ fi
+ doins "${S}"/tools/designer/src/lib/shared/* || die
+ doins "${S}"/tools/designer/src/lib/sdk/* || die
+ #install private headers
+ if use private-headers; then
+ if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then
+ insinto "${QTLIBDIR#${EPREFIX}}"/QtGui.framework/Headers/private/
+ else
+ insinto "${QTHEADERDIR#${EPREFIX}}"/QtGui/private
+ fi
+ find "${S}"/src/gui -type f -name "*_p.h" -exec doins {} \;
+ fi
+ if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then
+ # rerun to get links to headers right
+ fix_includes
+ fi
+
+ # install correct designer and linguist icons, bug 241208
+ doicon tools/linguist/linguist/images/icons/linguist-128-32.png \
+ tools/designer/src/designer/images/designer.png \
+ || die "doicon failed"
+ # Note: absolute image path required here!
+ make_desktop_entry "${EPREFIX}"/usr/bin/linguist Linguist \
+ "${EPREFIX}"/usr/share/pixmaps/linguist-128-32.png \
+ 'Qt;Development;GUIDesigner' \
+ || die "linguist make_desktop_entry failed"
+ make_desktop_entry "${EPREFIX}"/usr/bin/designer Designer \
+ "${EPREFIX}"/usr/share/pixmaps/designer.png \
+ 'Qt;Development;GUIDesigner' \
+ || die "designer make_desktop_entry failed"
+}