summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x11-libs/qt-gui/ChangeLog8
-rw-r--r--x11-libs/qt-gui/Manifest30
-rw-r--r--x11-libs/qt-gui/files/CVE-2013-0254.patch143
-rw-r--r--x11-libs/qt-gui/qt-gui-4.8.4-r1.ebuild250
4 files changed, 416 insertions, 15 deletions
diff --git a/x11-libs/qt-gui/ChangeLog b/x11-libs/qt-gui/ChangeLog
index 0ae0feb8f807..145e16055b0b 100644
--- a/x11-libs/qt-gui/ChangeLog
+++ b/x11-libs/qt-gui/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-libs/qt-gui
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.219 2013/01/27 00:41:32 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/ChangeLog,v 1.220 2013/02/09 08:34:31 pesa Exp $
+
+*qt-gui-4.8.4-r1 (09 Feb 2013)
+
+ 09 Feb 2013; Davide Pesavento <pesa@gentoo.org> +files/CVE-2013-0254.patch,
+ +qt-gui-4.8.4-r1.ebuild:
+ Apply upstream patch for CVE-2013-0254 (Gentoo bug #455884)
27 Jan 2013; Davide Pesavento <pesa@gentoo.org> qt-gui-4.8.4.ebuild:
Add a few missing QCONFIG_ADD and QCONFIG_DEFINE.
diff --git a/x11-libs/qt-gui/Manifest b/x11-libs/qt-gui/Manifest
index cd2b9c7b6de2..63d3532d1e79 100644
--- a/x11-libs/qt-gui/Manifest
+++ b/x11-libs/qt-gui/Manifest
@@ -1,25 +1,27 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
+AUX CVE-2013-0254.patch 6449 SHA256 c25f54ed3fdfed4cc945e53f7a848f88be8bda899c8ebff904f241cf9096df3e SHA512 957d1f3e5ca9a8585e0e5c806cd0ea731e97a3b05cf60e84aef44912cbd9b8db80961f336f91734f9759d14d4e0de39a73becb45f58ca8af831c1780e5368739 WHIRLPOOL 633cba444159eb134ec2df8a4b4fbb145aea28012b75353c9684f3d47b1c50736ea7c5adbd4fa1fbb0bf285a1e517b122bb6b5edac1313f6578465c8381d60d9
AUX qt-gui-4.7.3-cups.patch 3297 SHA256 3ccfefb432015e4a4ea967b030c51b10dcdfb1f63445557908ddae5e75012d33 SHA512 4a8f828c79bde81ab1e39c9eaba4ef553582d85b62d6d182dda02820c4c8e046de6a25cc77d228955ed37fbc5b55f697a0a464af0bb3e171849851639e9ef4ee WHIRLPOOL 41d82843f91533a5cbb0c9945c9013d9c8f07be3f06fef1b52cf8d18483d9cdfd24fe1d53c18a2f1eebd7a504f1665f1859616ae460d6471dc1599cea63a7bda
DIST qt-everywhere-opensource-src-4.8.4.tar.gz 236593028 SHA256 33b0e38ba4c54a0cf8a4be8ca5a4584f1c2e0adfecb57b21d9d1d267b0093270 SHA512 472972b63b5cad83b4c4656b23e95b6d4923cc31a518138e25d5921982b14abc835883356c2b779a7972cb77cf73fe25b46630be7c6a86a917b364186aa17496 WHIRLPOOL 9d250ee9ddd0431eeabc22ea598eda2bc74ee7ee6c5329522c479143d6c38fa17ae545541b4e3220b05d493c1a5d407c70980d0d1ffa49d2f83dedc1774cfa79
+EBUILD qt-gui-4.8.4-r1.ebuild 8088 SHA256 73ccb8af930db847779c379383ad0a2b0ade1ba6ae95ab39bb9f64a57a628ae5 SHA512 bcd698887de53b227c02eea452cae2974ac70fa2d75ffbf0fb001b180fafda1883a4ec37b06bce0dd0795f8901c6a64ca6eb50ad36bbc82e2a1018f9e7069e30 WHIRLPOOL c3a2cbe935e2ed55a44df7907c7a39bd79fafcae42f31da13bc3e44aaff6366eb4537d95e12c40346b53434011d2de084ad9e2b65057a55c5c7ab7ea577c4fa1
EBUILD qt-gui-4.8.4.ebuild 8042 SHA256 6197fe45ef6b651cd36589bc8fb5b55cc49b5143f8264a4bbefbb3be07fc0649 SHA512 9832e9fcc2bcab5ddacfbdc5faceb68c30fff4b7863693fdf470f6f4c6dad12a452c592e9e48f430900c8920b5a05ad3c3d4a00a769d71448e27234f06b176f3 WHIRLPOOL a994f931794871ad0e15aee69c78ae6eb008717ebf18cfc8c6c470eb13f490a4e9801aaed0c7fdde89c3cbe94f8b24fd4c75493285cece21820d789dd37eac04
-MISC ChangeLog 32279 SHA256 69462e173b46be4f58355ac6251f926182e18d7035372dc86ab61d68f394b282 SHA512 ff3fd83db2cf57e6153b309d46f8f71c932142d471039729aba5cb0834667cd1443143ec2b468c36299be58e991f2eb0d08f38591b45ec093dab2ab1395465bf WHIRLPOOL 4bd8beef98b4e2eb5150e47f7bf33d44b265d486a0d1f5bc309d4a3976157d61e3b558a8cba239b348379b1232c05d603cbd6f4c2b40bb1b08520306f9f63c47
+MISC ChangeLog 32479 SHA256 ba394ce1bd75772fd46d0530ff2d20d4e2dae9e95323610f7606423c1d995eb8 SHA512 5213ea40796377a96c394bde79a79b0c70a7bc87b2c6febfb999929a768dabc53cab1d357c3f9097903dbf1755de2a23bf352bcbb72964264f5464e90b6a3e65 WHIRLPOOL c7731e4b4a9c07b849b3a655d54569f2905ea209c2fa63fb4842d9650ff13cdc547270e57db5b5b4a6ebe96004dd31a83197ac75c03ba689a4de2eb83a22dcac
MISC metadata.xml 1117 SHA256 fe5f2ec8d0a91fd48b7fb30f9d146c315812647477608bf303a13ee8ef91290e SHA512 18357a2905d6fed98173361c8b574bca5501844d11f3887f913fb9ce0d3dfce1e181188b93d2a21c9a4e24229afe4037a0c3a7877d521d2f43464d94dae1b7d0 WHIRLPOOL 76c441e8ba23e2067e76ed06ad3db061ab9e99647ad124b1f5ebcf14d6ebf6cd82cd11651a5a207ba97f39a00aee44b840deeae1e098e631fac99378008376fb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iQIcBAEBCAAGBQJRBHfKAAoJENXLsxwXqFxy8X0P/RTv5B4ROgrh7zXhyCdBjEY+
-Fm1GYBJTbc7pBpGPAG5o6LJsto+AtBes/OzeyIVjs8OspwXkBv7h5qLMmuNh7E6Y
-fTmEDCsvqj8tgwxKdTNFfSHG7SqnsBYAu0YTfTVHsfcJh8F13JtE8BAmq88j9yl7
-R8WfHK+LC34X4rIH5pm5ziwInrjRsENZFwo6BJiBT/zIMRqrFFWhwG5PZ2DoEi4J
-AoNCC0lhVWF4ThNx8HXoBIWJYLl449qL3P/bxqkNRIAun71+K9vTF2rlItDrIurH
-dCHW7s4/kVFbInOvb2yZN+SRlUpUVjhW6sCwiVufwhkcqKHKWbnaegI9ebTgguVL
-1J3Bl3l5sGW98qR27InyNTzqqn09CzGvfrSs196D+LQ2oMKaI777fWW8Ul7m+BBl
-7SbzDumYHM4yzUsvWd/C4JL8htLcYhNUWmtHi+QgpMUZgPDnwesbqraXgU8oHkUq
-0WExONx5yM/HvoYGIRwWqs2AFUovt1ltwYKXWMH1VIXlNa1nKCVLLhb+eQBDTZk4
-OF/NjuDY2za/QxLVff/laiMyC8YaSAGXvIyyaRNx1w7fF371w2HoRfeZQDLX+Twr
-bu5t019lRNQVQ2NKQDMWGgF2twnGFT/khv8J07irDQHw3xnnQ/t2u7PzeoTvyo66
-2mDbGln/m2JobPT24XFr
-=b9BU
+iQIcBAEBCAAGBQJRFgoZAAoJENXLsxwXqFxy+1cQALVj+dcVTAolHGKhI+d1BgVW
+KOdKkE4LRpQJCHFrtsF692DunzK0ntHBrqKxKTTX+Ko7vT/7WwTq1YGR9PDTS79t
+MAGKYipcZCSNFrhzECpwF4XmECSMRNiHep09nyTs2vEFkN2YqVB6NwW/ZaKnQ+bK
+NMCrgEX2gBWBV6t5LEPaF3JgfESeiaCt29hcAPEsYzu3fUVmMsN91lsV+RcEZY13
+f/GMjrFd/r2G7zU3oUF0RvB1UyTCIUzXGp7TM6A4ZWCGT1NMj/Hqh1pKh+T3a83m
+SYe9hC9zK98LVZ7ZccEi7tasFJzIiXBwPNd3iO5EYKW/oJhuIMyoIoE1zgSFlSMx
+1V5RULvoTkfAa8W197dau79TlZPcLPKebZ0A7zkcUX5YW8cuEgEWOnNOP6ZbIcfB
+tz8TP691Lqkzc6drdTQVuhgPzRnTOiNxJ834ojkknYdPvBx8kvbbKSyEBNz2CXnG
+tokAmtWR85op4h7tsEmO7lNdQamBWuNkh21C8khCVOy5SIM7onx3+vnMvrV8Kx+c
+KJ5PxoBqG6SigFKLqXf7FT53llFziewjvNU4Nz//k126DC0VqoIZVpoKEwItWRVX
+w79MfJBrNGY4rP0sJewPAP9kUI7EdjDuCorkCLP2fUY0ysL+R7/a5n03GCYsYFNw
+KKRCIrhARmddsh4LAG04
+=Lh3h
-----END PGP SIGNATURE-----
diff --git a/x11-libs/qt-gui/files/CVE-2013-0254.patch b/x11-libs/qt-gui/files/CVE-2013-0254.patch
new file mode 100644
index 000000000000..fa05da333257
--- /dev/null
+++ b/x11-libs/qt-gui/files/CVE-2013-0254.patch
@@ -0,0 +1,143 @@
+From 20b26bdb3dd5e46b01b9a7e1ce8342074df3c89c Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Sat, 22 Dec 2012 08:32:12 -0800
+Subject: [PATCH] Change all shmget calls to user-only memory
+
+Drop the read and write permissions for group and other users in the
+system.
+
+Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
+(cherry-picked from Qt 5 commit 856f209fb63ae336bfb389a12d2a75fa886dc1c5)
+Reviewed-by: Richard J. Moore <rich@kde.org>
+---
+ src/corelib/kernel/qsharedmemory_unix.cpp | 6 +++---
+ src/corelib/kernel/qsystemsemaphore_unix.cpp | 4 ++--
+ src/gui/image/qnativeimage.cpp | 2 +-
+ src/gui/image/qpixmap_x11.cpp | 2 +-
+ src/plugins/platforms/xcb/qxcbwindowsurface.cpp | 2 +-
+ src/plugins/platforms/xlib/qxlibwindowsurface.cpp | 2 +-
+ tools/qvfb/qvfbshmem.cpp | 4 ++--
+
+diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
+index 20d76e3..4cf3acf 100644
+--- a/src/corelib/kernel/qsharedmemory_unix.cpp
++++ b/src/corelib/kernel/qsharedmemory_unix.cpp
+@@ -238,7 +238,7 @@ bool QSharedMemoryPrivate::create(int size)
+ }
+
+ // create
+- if (-1 == shmget(unix_key, size, 0666 | IPC_CREAT | IPC_EXCL)) {
++ if (-1 == shmget(unix_key, size, 0600 | IPC_CREAT | IPC_EXCL)) {
+ QString function = QLatin1String("QSharedMemory::create");
+ switch (errno) {
+ case EINVAL:
+@@ -293,7 +293,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
+ {
+ #ifndef QT_POSIX_IPC
+ // grab the shared memory segment id
+- int id = shmget(unix_key, 0, (mode == QSharedMemory::ReadOnly ? 0444 : 0660));
++ int id = shmget(unix_key, 0, (mode == QSharedMemory::ReadOnly ? 0400 : 0600));
+ if (-1 == id) {
+ setErrorString(QLatin1String("QSharedMemory::attach (shmget)"));
+ return false;
+@@ -381,7 +381,7 @@ bool QSharedMemoryPrivate::detach()
+ size = 0;
+
+ // Get the number of current attachments
+- int id = shmget(unix_key, 0, 0444);
++ int id = shmget(unix_key, 0, 0400);
+ cleanHandle();
+
+ struct shmid_ds shmid_ds;
+diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp
+index fad9acc..e77456b 100644
+--- a/src/corelib/kernel/qsystemsemaphore_unix.cpp
++++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp
+@@ -153,10 +153,10 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
+ }
+
+ // Get semaphore
+- semaphore = semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL);
++ semaphore = semget(unix_key, 1, 0600 | IPC_CREAT | IPC_EXCL);
+ if (-1 == semaphore) {
+ if (errno == EEXIST)
+- semaphore = semget(unix_key, 1, 0666 | IPC_CREAT);
++ semaphore = semget(unix_key, 1, 0600 | IPC_CREAT);
+ if (-1 == semaphore) {
+ setErrorString(QLatin1String("QSystemSemaphore::handle"));
+ cleanHandle();
+diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
+index 9654afe..fef38c5 100644
+--- a/src/gui/image/qnativeimage.cpp
++++ b/src/gui/image/qnativeimage.cpp
+@@ -176,7 +176,7 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /*
+
+ bool ok;
+ xshminfo.shmid = shmget(IPC_PRIVATE, xshmimg->bytes_per_line * xshmimg->height,
+- IPC_CREAT | 0777);
++ IPC_CREAT | 0700);
+ ok = xshminfo.shmid != -1;
+ if (ok) {
+ xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
+diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
+index 280d8bd..88c9b7b 100644
+--- a/src/gui/image/qpixmap_x11.cpp
++++ b/src/gui/image/qpixmap_x11.cpp
+@@ -193,7 +193,7 @@ static bool qt_create_mitshm_buffer(const QPaintDevice* dev, int w, int h)
+ bool ok;
+ xshminfo.shmid = shmget(IPC_PRIVATE,
+ xshmimg->bytes_per_line * xshmimg->height,
+- IPC_CREAT | 0777);
++ IPC_CREAT | 0700);
+ ok = xshminfo.shmid != -1;
+ if (ok) {
+ xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
+diff --git a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
+index b6a42d8..0d56821 100644
+--- a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
++++ b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp
+@@ -98,7 +98,7 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
+ 0);
+
+ m_shm_info.shmid = shmget (IPC_PRIVATE,
+- m_xcb_image->stride * m_xcb_image->height, IPC_CREAT|0777);
++ m_xcb_image->stride * m_xcb_image->height, IPC_CREAT|0600);
+
+ m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);
+ m_shm_info.shmseg = xcb_generate_id(xcb_connection());
+diff --git a/src/plugins/platforms/xlib/qxlibwindowsurface.cpp b/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
+index bf003eb..46a2f97 100644
+--- a/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
++++ b/src/plugins/platforms/xlib/qxlibwindowsurface.cpp
+@@ -99,7 +99,7 @@ void QXlibWindowSurface::resizeShmImage(int width, int height)
+
+
+ image_info->shminfo.shmid = shmget (IPC_PRIVATE,
+- image->bytes_per_line * image->height, IPC_CREAT|0777);
++ image->bytes_per_line * image->height, IPC_CREAT|0700);
+
+ image_info->shminfo.shmaddr = image->data = (char*)shmat (image_info->shminfo.shmid, 0, 0);
+ image_info->shminfo.readOnly = False;
+diff --git a/tools/qvfb/qvfbshmem.cpp b/tools/qvfb/qvfbshmem.cpp
+index 7f9671f..84b6ebe 100644
+--- a/tools/qvfb/qvfbshmem.cpp
++++ b/tools/qvfb/qvfbshmem.cpp
+@@ -176,13 +176,13 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s,
+ uint data_offset_value = sizeof(QVFbHeader);
+
+ int dataSize = bpl * h + data_offset_value;
+- shmId = shmget(key, dataSize, IPC_CREAT | 0666);
++ shmId = shmget(key, dataSize, IPC_CREAT | 0600);
+ if (shmId != -1)
+ data = (unsigned char *)shmat(shmId, 0, 0);
+ else {
+ struct shmid_ds shm;
+ shmctl(shmId, IPC_RMID, &shm);
+- shmId = shmget(key, dataSize, IPC_CREAT | 0666);
++ shmId = shmget(key, dataSize, IPC_CREAT | 0600);
+ if (shmId == -1) {
+ perror("QShMemViewProtocol::QShMemViewProtocol");
+ qFatal("Cannot get shared memory 0x%08x", key);
+--
+1.7.1
+
diff --git a/x11-libs/qt-gui/qt-gui-4.8.4-r1.ebuild b/x11-libs/qt-gui/qt-gui-4.8.4-r1.ebuild
new file mode 100644
index 000000000000..8705bbff4500
--- /dev/null
+++ b/x11-libs/qt-gui/qt-gui-4.8.4-r1.ebuild
@@ -0,0 +1,250 @@
+# Copyright 1999-2013 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.8.4-r1.ebuild,v 1.1 2013/02/09 08:34:31 pesa Exp $
+
+EAPI=4
+
+inherit eutils qt4-build
+
+DESCRIPTION="The GUI module for the Qt toolkit"
+SLOT="4"
+if [[ ${QT4_BUILD_TYPE} == live ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+fi
+IUSE="+accessibility cups dbus egl gif +glib gtkstyle mng nas nis qt3support tiff trace xinerama +xv"
+
+REQUIRED_USE="
+ gtkstyle? ( glib )
+"
+
+RDEPEND="
+ app-admin/eselect-qtgraphicssystem
+ 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/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ xinerama? ( x11-libs/libXinerama )
+ xv? ( x11-libs/libXv )
+ )
+ cups? ( net-print/cups )
+ dbus? ( ~x11-libs/qt-dbus-${PV}[aqua=,debug=] )
+ egl? ( media-libs/mesa[egl] )
+ gtkstyle? ( x11-libs/gtk+:2[aqua=] )
+ mng? ( >=media-libs/libmng-1.0.9 )
+ nas? ( >=media-libs/nas-1.5 )
+ tiff? ( media-libs/tiff:0 )
+"
+DEPEND="${RDEPEND}
+ !aqua? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ xinerama? ( x11-proto/xineramaproto )
+ xv? ( x11-proto/videoproto )
+ )
+"
+PDEPEND="qt3support? ( ~x11-libs/qt-qt3support-${PV}[aqua=,debug=] )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.7.3-cups.patch"
+ "${FILESDIR}/CVE-2013-0254.patch"
+)
+
+pkg_setup() {
+ # this belongs to pkg_pretend, we have to upgrade to EAPI 4 :)
+ # was planning to use a dep, but to reproduce this you have to
+ # clean-emerge qt-gui[gtkstyle] while having cairo[qt4] installed.
+ # no need to restrict normal first time users for that :)
+ if use gtkstyle && ! has_version x11-libs/qt-gui && has_version x11-libs/cairo[qt4]; then
+ echo
+ eerror "When building qt-gui[gtkstyle] from scratch with cairo present,"
+ eerror "cairo must have the qt4 use flag disabled, otherwise the gtk"
+ eerror "style cannot be built."
+ ewarn
+ eerror "You have the following options:"
+ eerror " - rebuild cairo with -qt4 USE"
+ eerror " - build qt-gui with -gtkstyle USE"
+ ewarn
+ eerror "After you successfully install qt-gui, you'll be able to"
+ eerror "re-enable the disabled use flag and/or reinstall cairo."
+ ewarn
+ echo
+ die "can't build ${PN} with USE=gtkstyle if cairo has 'qt4' USE flag enabled"
+ fi
+
+ 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"
+
+ use accessibility && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/accessible/widgets"
+ 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 trace && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/graphicssystems/trace"
+
+ # mac version does not contain qtconfig?
+ [[ ${CHOST} == *-darwin* ]] || QT4_TARGET_DIRECTORIES+=" tools/qtconfig"
+
+ QT4_EXTRACT_DIRECTORIES="${QT4_TARGET_DIRECTORIES} ${QT4_EXTRACT_DIRECTORIES}"
+
+ qt4-build_pkg_setup
+}
+
+src_prepare() {
+ qt4-build_src_prepare
+
+ # Add -xvideo to the list of accepted configure options
+ sed -i -e 's:|-xinerama|:&-xvideo|:' configure
+
+ # Don't build plugins this go around, because they depend on qt3support lib
+ sed -i -e 's:CONFIG(shared:# &:g' 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)
+ $(use gif || echo -no-gif)
+ $(qt_use glib)
+ $(qt_use mng libmng system)
+ $(qt_use nas nas-sound 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)
+ $(qt_use xv xvideo)"
+
+ 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"
+
+ [[ ${CHOST} == *86*-apple-darwin* ]] && myconf+=" -no-ssse3" #367045
+
+ 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
+ sed -i -e "s:-I/usr/include/qt4/QtGui ::" src/gui/Makefile || die "sed failed"
+}
+
+src_install() {
+ QCONFIG_ADD="
+ mitshm tablet x11sm xcursor xfixes xinput xkb xrandr xrender xshape xsync
+ fontconfig 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-gif no-jpeg no-png"
+ QCONFIG_DEFINE="$(use accessibility && echo QT_ACCESSIBILITY)
+ $(use cups && echo QT_CUPS)
+ $(use egl && echo QT_EGL)
+ QT_FONTCONFIG
+ $(use gtkstyle && echo QT_STYLE_GTK)
+ QT_IMAGEFORMAT_JPEG QT_IMAGEFORMAT_PNG QT_MITSHM
+ $(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)"
+
+ qt4-build_src_install
+
+ # 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/*
+ doins "${S}"/tools/designer/src/lib/sdk/*
+
+ # install private headers
+ 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 {} +
+
+ if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
+ # rerun to get links to headers right
+ fix_includes
+ fi
+
+ # touch the available graphics systems
+ dodir /usr/share/qt4/graphicssystems
+ echo "default" > "${ED}"/usr/share/qt4/graphicssystems/raster || die
+ touch "${ED}"/usr/share/qt4/graphicssystems/native || die
+
+ doicon tools/designer/src/designer/images/designer.png
+ newicon tools/linguist/linguist/images/icons/linguist-128-32.png linguist.png
+ newicon tools/qtconfig/images/appicon.png qtconfig.png
+ use dbus && newicon tools/qdbus/qdbusviewer/images/qdbusviewer-128.png qdbusviewer.png
+ make_desktop_entry designer Designer designer 'Qt;Development;GUIDesigner'
+ make_desktop_entry linguist Linguist linguist 'Qt;Development;Translation'
+ make_desktop_entry qtconfig 'Qt Configuration Tool' qtconfig 'Qt;Settings;DesktopSettings'
+}
+
+pkg_postinst() {
+ qt4-build_pkg_postinst
+
+ # raster is the default graphicssystem, set it on first install
+ eselect qtgraphicssystem set raster --use-old
+
+ if use gtkstyle; then
+ # see bug 388551
+ elog "For Qt's GTK style to work, you need to either export"
+ elog "the following variable into your environment:"
+ elog ' GTK2_RC_FILES="$HOME/.gtkrc-2.0"'
+ elog "or alternatively install gnome-base/libgnomeui"
+ fi
+}