summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2007-08-08 21:59:17 +0000
committerFathi Boudra <fabo@debian.org>2007-08-08 21:59:17 +0000
commit08f7131a957083eab3dbb778bc483a1306cc022d (patch)
treea590ecd5987a90b0f39040e769ce0c35199912e3
parentbe5c28475e6a3b41b5927720fef64f116b9caf4a (diff)
downloadqt4-x11-08f7131a957083eab3dbb778bc483a1306cc022d.tar.gz
* Switch to quilt patch system.
* Update copyright. Add Trolltech GPL Exception. * Update patches for Qt4.3.1. * Remove patches merged upstream: * 0177-qurl-clear-fix * 0183-qprocess-corruption * 42_alpha_fetch_and_add * TODO: workaround for 51_kfreebsd_mkspecs patch.
-rw-r--r--debian/changelog11
-rw-r--r--debian/control2
-rw-r--r--debian/copyright90
-rw-r--r--debian/patches/0163-fix-gcc43-support.diff156
-rw-r--r--debian/patches/0167-fix-group-reading.diff22
-rw-r--r--debian/patches/0172-prefer-xrandr-over-xinerama.diff42
-rw-r--r--debian/patches/0175-fix-s390-qatomic.diff27
-rw-r--r--debian/patches/0176-coverity-fixes.diff29
-rw-r--r--debian/patches/0178-transparency-window-types.diff327
-rw-r--r--debian/patches/0179-transient-hack.diff11
-rw-r--r--debian/patches/0180-window-role.diff81
-rw-r--r--debian/patches/0181-qdnd-x11-fix.diff84
-rw-r--r--debian/patches/0182-argb-visuals-default.diff124
-rw-r--r--debian/patches/0185-fix-format-strings.diff251
-rw-r--r--debian/patches/0186-fix-component-alpha-text.diff40
-rw-r--r--debian/patches/0187-fix-font-fixed-pitch.diff39
-rw-r--r--debian/patches/01_qmake_for_debian.diff26
-rw-r--r--debian/patches/02_launch_assistant-qt4.diff16
-rw-r--r--debian/patches/03_launch_moc-qt4.diff11
-rw-r--r--debian/patches/04_launch_uic-qt4.diff11
-rw-r--r--debian/patches/05_append_qt4_target.diff221
-rw-r--r--debian/patches/06_qtdemo_destdir.diff21
-rw-r--r--debian/patches/20_mips_atomic_ops.diff58
-rw-r--r--debian/patches/30_arm_ftbfs_fixes.diff11
-rw-r--r--debian/patches/31_arm_eabi_fix.diff11
-rw-r--r--debian/patches/40_alpha_ice.diff45
-rw-r--r--debian/patches/41_disable_opengl_visibility.diff10
-rw-r--r--debian/patches/50_kfreebsd_build_fix.diff69
-rw-r--r--debian/patches/60_m68k_inotify_fix.diff13
-rw-r--r--debian/patches/70_hppa_ldcw_fix.diff22
-rw-r--r--debian/patches/80_hurd_max_path.diff13
-rw-r--r--debian/patches/series31
-rwxr-xr-xdebian/rules5
33 files changed, 1924 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index ca878d9..777b688 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,15 @@
-qt4-x11 (4.3.1-1) UNRELEASED; urgency=low
+qt4-x11 (4.3.1-1) unstable; urgency=low
* New upstream release.
+ * Switch to quilt patch system.
+ * Update copyright. Add Trolltech GPL Exception.
+ * Update patches for Qt4.3.1.
+ * Remove patches merged upstream:
+ * 0177-qurl-clear-fix
+ * 0183-qprocess-corruption
+ * 42_alpha_fetch_and_add
+
+ * TODO: workaround for 51_kfreebsd_mkspecs patch.
-- Fathi Boudra <fboudra@free.fr> Wed, 08 Aug 2007 15:08:11 +0200
diff --git a/debian/control b/debian/control
index 5105844..2e44e1b 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: libs
Priority: optional
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Uploaders: Brian Nelson <pyro@debian.org>, Sune Vuorela <debian@pusling.com>, Fathi Boudra <fboudra@free.fr>, Ana Beatriz Guerrero Lopez <ana@debian.org>
-Build-Depends: debhelper (>= 5.0.0), libxext-dev (>= 4.3.0.dfsg.1-4), libxrandr-dev (>= 4.3.0.dfsg.1-4), x11proto-core-dev, libsm-dev (>= 4.3.0.dfsg.1-4), libxmu-dev (>= 4.3.0.dfsg.1-4), libice-dev (>= 4.3.0.dfsg.1-4), libx11-dev (>= 4.3.0.dfsg.1-4), libxt-dev (>= 4.3.0.dfsg.1-4), libjpeg62-dev, zlib1g-dev, libmng-dev (>= 1.0.3), libpng12-dev, libfreetype6-dev, libmysqlclient15-dev, flex, libpq-dev, libaudio-dev, libcupsys2-dev, xlibmesa-gl-dev | libgl-dev, libglu1-xorg-dev | libglu1-mesa-dev | libglu-dev, libxft-dev, libxrender-dev, libxcursor-dev, cdbs (>= 0.4.0), dpatch, libxinerama-dev, libsqlite0-dev, libsqlite3-dev, libdbus-1-dev, libglib2.0-dev, libxi-dev
+Build-Depends: cdbs, debhelper (>= 5), quilt, libxext-dev (>= 4.3.0.dfsg.1-4), libxrandr-dev (>= 4.3.0.dfsg.1-4), x11proto-core-dev, libsm-dev (>= 4.3.0.dfsg.1-4), libxmu-dev (>= 4.3.0.dfsg.1-4), libice-dev (>= 4.3.0.dfsg.1-4), libx11-dev (>= 4.3.0.dfsg.1-4), libxt-dev (>= 4.3.0.dfsg.1-4), libjpeg62-dev, zlib1g-dev, libmng-dev (>= 1.0.3), libpng12-dev, libfreetype6-dev, libmysqlclient15-dev, flex, libpq-dev, libaudio-dev, libcupsys2-dev, xlibmesa-gl-dev | libgl-dev, libglu1-xorg-dev | libglu1-mesa-dev | libglu-dev, libxft-dev, libxrender-dev, libxcursor-dev, libxinerama-dev, libsqlite0-dev, libsqlite3-dev, libdbus-1-dev, libglib2.0-dev, libxi-dev
Standards-Version: 3.7.2
Package: libqt4-dev
diff --git a/debian/copyright b/debian/copyright
index 3d0e793..f93552d 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -23,3 +23,93 @@ Copyright (C) 1994-2004 Trolltech AS.
On Debian systems, the complete text of the GNU General Public License
can be found in `/usr/share/common-licenses/GPL'.
+
+Since Qt4.3.1, a Trolltech GPL exception was added:
+
+ Trolltech GPL Exception version 1.0
+ ===================================
+
+ Additional rights granted beyond the GPL (the "Exception").
+
+ As a special exception to the terms and conditions of version 2.0 of the
+GPL, Trolltech hereby grants you the rights described below, provided you agree
+to the terms and conditions in this Exception, including its obligations and
+restrictions on use.
+
+ Nothing in this Exception gives you or anyone else the right to change
+the licensing terms of the Qt Open Source Edition.
+
+ Below, "Licensed Software" shall refer to the software licensed under
+the GPL and this exception.
+
+ 1) The right to use Open Source Licenses not compatible with the GNU
+ General Public License: You may link software (hereafter referred to as
+"Your Software") against the Licensed Software and/or distribute binaries of
+Your Software linked against the Licensed Software, provided that:
+
+ A) Your Software is licensed under one of the following licenses:
+
+
+ License name Version(s)/Copyright Date
+ Academic Free License 2.0 or 2.1
+ Apache Software License 1.0 or 1.1
+ Apache License 2.0
+ Apple Public Source License 2.0
+ Artistic license From Perl 5.8.0
+ BSD license "July 22 1999"
+ Common Public License 1.0
+ GNU Library or "Lesser"
+ General Public License (LGPL) 2.0 or 2.1
+ Jabber Open Source License 1.0
+ MIT License (as set forth in the addendum file)
+ Mozilla Public License (MPL) 1.0 or 1.1
+ Open Software License 2.0
+ OpenSSL license (with original
+ SSLeay license) "2003" ("1998")
+ PHP License 3.0
+ Python license (CNRI Python License) (as set forth in the addendum file)
+ Python Software Foundation License 2.1.1
+ Q Public License v1.0
+ Sleepycat License "1999"
+ W3C License "2001"
+ X11 License X11R6.6
+ Zlib/libpng License (as set forth in the addendum file)
+ Zope Public License 2.0
+
+
+ (Licenses without a specific version number or date are reproduced
+ in the file GPL_EXCEPTION_ADDENDUM.TXT in your source package).
+
+
+ and
+
+ B) You must, on request, make a complete package including
+ the complete source code of Your Software (as defined
+ in the GNU General Public License version 2, section 3,
+ but excluding anything excluded by the special
+ exception in the same section) available to Trolltech
+ under the same license as that granted to other
+ recipients of the source code of Your Software.
+
+ and
+
+ C) Your or any other contributor's rights to:
+
+ i) distribute the source code of Your Software to anyone for
+ any purpose;
+
+ and
+
+ ii) publicly discuss the development project for Your
+ Software and its goals in any form and in any forum
+
+ are not prohibited by any legal instrument, including but not limited to
+contracts, non-disclosure agreements, and employee contracts.
+
+
+ 2) The right to link non-Open Source applications with pre-installed
+versions of the Licensed Software: You may link applications with binary
+pre-installed versions of the Licensed Software, provided that such applications
+have been developed and are deployed in ac cordance with the terms and
+conditions of the Qt Commercial License Agreement.
+
diff --git a/debian/patches/0163-fix-gcc43-support.diff b/debian/patches/0163-fix-gcc43-support.diff
new file mode 100644
index 0000000..b3ec46e
--- /dev/null
+++ b/debian/patches/0163-fix-gcc43-support.diff
@@ -0,0 +1,156 @@
+--- qt4-x11-4.3.1.orig/config.tests/unix/endian.test
++++ qt4-x11-4.3.1/config.tests/unix/endian.test
+@@ -30,6 +30,7 @@
+ [ "$VERBOSE" = "yes" ] && echo " Found 'MostSignificantByteFirst' in binary"
+ ENDIAN="BIG"
+ fi
++[ "$VERBOSE" = "yes" ] && make clean || make clean >/dev/null 2>&1
+
+ # done
+ if [ "$ENDIAN" = "LITTLE" ]; then
+--- qt4-x11-4.3.1.orig/config.tests/x11/glib/glib.cpp
++++ qt4-x11-4.3.1/config.tests/x11/glib/glib.cpp
+@@ -6,7 +6,7 @@
+ {
+ GMainContext *context;
+ GSource *source;
+- GPollFD *pollfd;
++ GPollFD *pollfd = NULL;
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+ context = g_main_context_default();
+--- qt4-x11-4.3.1.orig/src/corelib/codecs/qtextcodec.cpp
++++ qt4-x11-4.3.1/src/corelib/codecs/qtextcodec.cpp
+@@ -432,7 +432,7 @@
+ localeMapper = checkForCodec(lang);
+
+ // 5. "@euro"
+- if (!localeMapper && ctype && strstr(ctype, "@euro") || lang && strstr(lang, "@euro"))
++ if ((!localeMapper && ctype && strstr(ctype, "@euro")) || (lang && strstr(lang, "@euro")))
+ localeMapper = checkForCodec("ISO 8859-15");
+
+ // 6. guess locale from ctype unless ctype is "C"
+--- qt4-x11-4.3.1.orig/src/corelib/io/qtextstream.cpp
++++ qt4-x11-4.3.1/src/corelib/io/qtextstream.cpp
+@@ -556,8 +556,8 @@
+ if (!codec || autoDetectUnicode) {
+ autoDetectUnicode = false;
+
+- if (bytesRead >= 2 && (uchar(buf[0]) == 0xff && uchar(buf[1]) == 0xfe
+- || uchar(buf[0]) == 0xfe && uchar(buf[1]) == 0xff)) {
++ if (bytesRead >= 2 && ((uchar(buf[0]) == 0xff && uchar(buf[1]) == 0xfe)
++ || (uchar(buf[0]) == 0xfe && uchar(buf[1]) == 0xff))) {
+ codec = QTextCodec::codecForName("UTF-16");
+ } else if (!codec) {
+ codec = QTextCodec::codecForLocale();
+--- qt4-x11-4.3.1.orig/src/corelib/io/qurl.cpp
++++ qt4-x11-4.3.1/src/corelib/io/qurl.cpp
+@@ -4740,9 +4740,9 @@
+ if (include.isEmpty()) {
+ for (int i = 0; i < len; ++i) {
+ unsigned char c = *inputData++;
+- if (c >= 0x61 && c <= 0x7A // ALPHA
+- || c >= 0x41 && c <= 0x5A // ALPHA
+- || c >= 0x30 && c <= 0x39 // DIGIT
++ if ((c >= 0x61 && c <= 0x7A) // ALPHA
++ || (c >= 0x41 && c <= 0x5A) // ALPHA
++ || (c >= 0x30 && c <= 0x39) // DIGIT
+ || c == 0x2D // -
+ || c == 0x2E // .
+ || c == 0x5F // _
+@@ -4759,9 +4759,9 @@
+ const char * alsoEncode = include.constData();
+ for (int i = 0; i < len; ++i) {
+ unsigned char c = *inputData++;
+- if ((c >= 0x61 && c <= 0x7A // ALPHA
+- || c >= 0x41 && c <= 0x5A // ALPHA
+- || c >= 0x30 && c <= 0x39 // DIGIT
++ if (((c >= 0x61 && c <= 0x7A) // ALPHA
++ || (c >= 0x41 && c <= 0x5A) // ALPHA
++ || (c >= 0x30 && c <= 0x39) // DIGIT
+ || c == 0x2D // -
+ || c == 0x2E // .
+ || c == 0x5F // _
+--- qt4-x11-4.3.1.orig/src/corelib/tools/qlocale.cpp
++++ qt4-x11-4.3.1/src/corelib/tools/qlocale.cpp
+@@ -2609,8 +2609,8 @@
+
+ QChar c1 = format.at(i);
+ QChar c2 = format.at(i + 1);
+- if (c1.unicode() == 'a' && c2.unicode() == 'p'
+- || c1.unicode() == 'A' && c2.unicode() == 'P')
++ if ((c1.unicode() == 'a' && c2.unicode() == 'p')
++ || (c1.unicode() == 'A' && c2.unicode() == 'P'))
+ return true;
+
+ ++i;
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qapplication.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qapplication.cpp
+@@ -2036,11 +2036,11 @@
+ #ifndef QT_NO_TRANSLATION
+ static bool qt_detectRTLLanguage()
+ {
+- return force_reverse ^
++ return (force_reverse ^
+ QApplication::tr("QT_LAYOUT_DIRECTION",
+ "Translate this string to the string 'LTR' in left-to-right"
+ " languages or to 'RTL' in right-to-left languages (such as Hebrew"
+- " and Arabic) to get proper widget layout.") == QLatin1String("RTL");
++ " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
+ }
+ #endif
+
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qkeymapper_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qkeymapper_x11.cpp
+@@ -1330,8 +1330,8 @@
+ }
+
+ if (directionKeyEvent && lastWinId == keyWidget->internalWinId()) {
+- if (keysym == XK_Shift_L && directionKeyEvent == XK_Control_L ||
+- keysym == XK_Control_L && directionKeyEvent == XK_Shift_L) {
++ if ((keysym == XK_Shift_L && directionKeyEvent == XK_Control_L) ||
++ (keysym == XK_Control_L && directionKeyEvent == XK_Shift_L)) {
+ directionKeyEvent = Qt::Key_Direction_L;
+ } else if (keysym == XK_Shift_R && directionKeyEvent == XK_Control_R ||
+ keysym == XK_Control_R && directionKeyEvent == XK_Shift_R) {
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget.cpp
+@@ -1830,7 +1830,7 @@
+
+ for (int i = 0; i < pd->children.size(); ++i) {
+ QWidget *w = qobject_cast<QWidget *>(pd->children.at(i));
+- if (w && !w->isWindow() && !w->testAttribute(Qt::WA_WState_Created))
++ if (w && !w->isWindow() && !w->testAttribute(Qt::WA_WState_Created)) {
+ if (w!=q) {
+ w->create();
+ } else {
+@@ -1840,6 +1840,7 @@
+ if (winid)
+ w->raise();
+ }
++ }
+ }
+ } else {
+ q->create();
+--- qt4-x11-4.3.1.orig/src/gui/painting/qregion_unix.cpp
++++ qt4-x11-4.3.1/src/gui/painting/qregion_unix.cpp
+@@ -1944,7 +1944,7 @@
+ else
+ --isInside;
+
+- if (!inside && !isInside || inside && isInside) {
++ if ((!inside && !isInside) || (inside && isInside)) {
+ pWETE->nextWETE = AET;
+ pWETE = AET;
+ inside = !inside;
+--- qt4-x11-4.3.1.orig/src/tools/uic/driver.cpp
++++ qt4-x11-4.3.1/src/tools/uic/driver.cpp
+@@ -175,7 +175,7 @@
+
+ static bool isAnsiCCharacter(const QChar& c)
+ {
+- return c.toUpper() >= QLatin1Char('A') && c.toUpper() <= QLatin1Char('Z')
++ return (c.toUpper() >= QLatin1Char('A') && c.toUpper() <= QLatin1Char('Z'))
+ || c.isDigit() || c == QLatin1Char('_');
+ }
+
diff --git a/debian/patches/0167-fix-group-reading.diff b/debian/patches/0167-fix-group-reading.diff
new file mode 100644
index 0000000..9a0e8f2
--- /dev/null
+++ b/debian/patches/0167-fix-group-reading.diff
@@ -0,0 +1,22 @@
+--- qt4-x11-4.3.1.orig/src/corelib/io/qfsfileengine_unix.cpp
++++ qt4-x11-4.3.1/src/corelib/io/qfsfileengine_unix.cpp
+@@ -845,9 +845,16 @@
+ } else if (own == OwnerGroup) {
+ struct group *gr = 0;
+ #if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
+- buf.resize(sysconf(_SC_GETGR_R_SIZE_MAX));
+- struct group entry;
+- getgrgid_r(ownerId(own), &entry, buf.data(), buf.size(), &gr);
++ for (unsigned size = sysconf(_SC_GETGR_R_SIZE_MAX); size < 256000; size += size)
++ {
++ buf.resize(size);
++ struct group entry;
++ // ERANGE indicates that the buffer was too small
++ if (!getgrgid_r(ownerId(own), &entry, buf.data(), buf.size(), &gr)
++ || errno != ERANGE)
++ break;
++ }
++
+ #else
+ gr = getgrgid(ownerId(own));
+ #endif
diff --git a/debian/patches/0172-prefer-xrandr-over-xinerama.diff b/debian/patches/0172-prefer-xrandr-over-xinerama.diff
new file mode 100644
index 0000000..d8d5be7
--- /dev/null
+++ b/debian/patches/0172-prefer-xrandr-over-xinerama.diff
@@ -0,0 +1,42 @@
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qdesktopwidget_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qdesktopwidget_x11.cpp
+@@ -124,11 +124,38 @@
+ int unused;
+ use_xinerama = (XineramaQueryExtension(X11->display, &unused, &unused) && XineramaIsActive(X11->display));
+
++ // only use xinerama for old Xrandr versions
++#ifndef QT_NO_XRANDR
++ int ncrtc = 0;
++ if (X11->use_xrandr) {
++ int major, minor;
++
++#if RANDR_MAJOR > 1 || RANDR_MINOR > 1
++ XRRQueryVersion(QPaintDevice::x11AppDisplay(), &major, &minor);
++ if (major > 1 || (major == 1 && minor >= 2)) {
++ XRRScreenResources* res;
++ res = XRRGetScreenResources(QPaintDevice::x11AppDisplay(),
++ QPaintDevice::x11AppRootWindow( 0 ));
++ if (res) {
++ ncrtc = res->ncrtc;
++ XRRFreeScreenResources(res);
++ }
++ }
++#endif
++ }
++#endif
++
+ if (use_xinerama) {
+ xinerama_screeninfo =
+ XineramaQueryScreens(X11->display, &screenCount);
+ defaultScreen = 0;
+- } else
++ }
++#ifndef QT_NO_XRANDR
++ if (use_xinerama && screenCount <= ncrtc) {
++ use_xinerama = FALSE;
++ }
++#endif
++ else
+ #endif // QT_NO_XINERAMA
+ {
+ defaultScreen = DefaultScreen(X11->display);
diff --git a/debian/patches/0175-fix-s390-qatomic.diff b/debian/patches/0175-fix-s390-qatomic.diff
new file mode 100644
index 0000000..60ab8fa
--- /dev/null
+++ b/debian/patches/0175-fix-s390-qatomic.diff
@@ -0,0 +1,27 @@
+--- qt4-x11-4.3.1.orig/src/corelib/arch/qatomic_s390.h
++++ qt4-x11-4.3.1/src/corelib/arch/qatomic_s390.h
+@@ -197,10 +197,20 @@
+ #endif
+ }
+
+-#error "fetch-and-add not implemented"
+-// int q_atomic_fetch_and_add_int(volatile int *ptr, int value);
+-// int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value);
+-// int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value);
++inline int q_atomic_fetch_and_add_int(volatile int *ptr, int value)
++{
++ return __sync_fetch_and_add(ptr, value);
++}
++
++inline int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value)
++{
++ return __sync_fetch_and_add(ptr, value);
++}
++
++inline int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value)
++{
++ return __sync_fetch_and_add(ptr, value);
++}
+
+ QT_END_HEADER
+
diff --git a/debian/patches/0176-coverity-fixes.diff b/debian/patches/0176-coverity-fixes.diff
new file mode 100644
index 0000000..e97c80f
--- /dev/null
+++ b/debian/patches/0176-coverity-fixes.diff
@@ -0,0 +1,29 @@
+--- qt4-x11-4.3.1.orig/src/gui/painting/qimagescale.cpp
++++ qt4-x11-4.3.1/src/gui/painting/qimagescale.cpp
+@@ -1020,6 +1020,7 @@
+ buffer = QImage(dw, dh, src.format());
+ if (buffer.isNull()) {
+ qWarning("QImage: out of memory, returning null");
++ qimageFreeScaleInfo(scaleinfo);
+ return QImage();
+ }
+
+--- qt4-x11-4.3.1.orig/src/svg/qsvghandler.cpp
++++ qt4-x11-4.3.1/src/svg/qsvghandler.cpp
+@@ -1136,15 +1136,9 @@
+ if (!size.isEmpty()) {
+ QSvgHandler::LengthType type;
+ qreal len = parseLength(size, type, handler);
+- //len = convertToPixels(len, false, type);
+ // ### org_module.svg shows that font size
+ // seems to be always in px...
+- type = QSvgHandler::PX;
+- if (type == QSvgHandler::PX ||
+- type == QSvgHandler::OTHER)
+- font.setPixelSize(int(len));
+- else
+- font.setPointSizeF(len);
++ font.setPixelSize(int(len));
+ }
+ if (!style.isEmpty()) {
+ if (style == QLatin1String("normal")) {
diff --git a/debian/patches/0178-transparency-window-types.diff b/debian/patches/0178-transparency-window-types.diff
new file mode 100644
index 0000000..2f3c188
--- /dev/null
+++ b/debian/patches/0178-transparency-window-types.diff
@@ -0,0 +1,327 @@
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qapplication_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qapplication_x11.cpp
+@@ -214,6 +214,11 @@
+ "_NET_WM_WINDOW_TYPE_SPLASH\0"
+ "_NET_WM_WINDOW_TYPE_TOOLBAR\0"
+ "_NET_WM_WINDOW_TYPE_UTILITY\0"
++ "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU\0"
++ "_NET_WM_WINDOW_TYPE_POPUP_MENU\0"
++ "_NET_WM_WINDOW_TYPE_COMBO\0"
++ "_NET_WM_WINDOW_TYPE_DND\0"
++ "_NET_WM_WINDOW_TYPE_TOOLTIP\0"
+
+ "_KDE_NET_WM_FRAME_STRUT\0"
+
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qdnd_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qdnd_x11.cpp
+@@ -270,6 +270,7 @@
+ QWidget(QApplication::desktop()->screen(screen),
+ Qt::Tool | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint)
+ {
++ x11SetWindowType( X11WindowTypeDND );
+ }
+
+ void setPixmap(const QPixmap &pm)
+@@ -1438,6 +1439,7 @@
+ // recreate the pixmap on the new screen...
+ delete xdnd_data.deco;
+ xdnd_data.deco = new QShapedPixmapWidget(screen);
++ xdnd_data.deco->x11SetWindowTransient( object->source()->topLevelWidget());
+ if (!QWidget::mouseGrabber()) {
+ updatePixmap();
+ xdnd_data.deco->grabMouse();
+@@ -1899,6 +1901,7 @@
+ object = o;
+ object->d_func()->target = 0;
+ xdnd_data.deco = new QShapedPixmapWidget();
++ xdnd_data.deco->x11SetWindowTransient( object->source()->topLevelWidget());
+
+ willDrop = false;
+
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qt_x11_p.h
++++ qt4-x11-4.3.1/src/gui/kernel/qt_x11_p.h
+@@ -530,6 +530,11 @@
+ _NET_WM_WINDOW_TYPE_SPLASH,
+ _NET_WM_WINDOW_TYPE_TOOLBAR,
+ _NET_WM_WINDOW_TYPE_UTILITY,
++ _NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
++ _NET_WM_WINDOW_TYPE_POPUP_MENU,
++ _NET_WM_WINDOW_TYPE_COMBO,
++ _NET_WM_WINDOW_TYPE_DND,
++ _NET_WM_WINDOW_TYPE_TOOLTIP,
+
+ _KDE_NET_WM_FRAME_STRUT,
+
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qtooltip.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qtooltip.cpp
+@@ -149,6 +149,9 @@
+ setMouseTracking(true);
+ fadingOut = false;
+ reuseTip(text);
++#ifdef Q_WS_X11
++ x11SetWindowType( X11WindowTypeTooltip );
++#endif
+ }
+
+ void QTipLabel::restartHideTimer()
+@@ -369,6 +372,10 @@
+ // that is showing (removes flickering)
+ if (QTipLabel::instance->tipChanged(pos, text, w)){
+ QTipLabel::instance->reuseTip(text);
++#ifdef Q_WS_X11
++ if (w)
++ QTipLabel::instance->x11SetWindowTransient( w->topLevelWidget());
++#endif
+ QTipLabel::instance->setTipRect(w, rect);
+ QTipLabel::instance->placeTip(pos, w);
+ }
+@@ -378,6 +385,10 @@
+
+ if (!text.isEmpty()){ // no tip can be reused, create new tip:
+ new QTipLabel(pos, text, w); // sets QTipLabel::instance to itself
++#ifdef Q_WS_X11
++ if (w)
++ QTipLabel::instance->x11SetWindowTransient( w->topLevelWidget());
++#endif
+ QTipLabel::instance->setTipRect(w, rect);
+ QTipLabel::instance->placeTip(pos, w);
+ QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label"));
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget.h
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget.h
+@@ -354,6 +354,19 @@
+
+ void setWindowOpacity(qreal level);
+ qreal windowOpacity() const;
++#if defined(Q_WS_X11)
++ enum X11WindowType {
++ X11WindowTypeSelect,
++ X11WindowTypeCombo,
++ X11WindowTypeDND,
++ X11WindowTypeTooltip,
++ X11WindowTypeMenu, // torn-off
++ X11WindowTypeDropdown,
++ X11WindowTypePopup
++ };
++ void x11SetWindowType( X11WindowType type = X11WindowTypeSelect );
++ void x11SetWindowTransient( QWidget* parent );
++#endif
+
+ bool isWindowModified() const;
+ #ifndef QT_NO_TOOLTIP
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget_x11.cpp
+@@ -562,10 +562,6 @@
+ }
+ #endif // QT_NO_XRENDER
+
+- // NET window types
+- long net_wintypes[7] = { 0, 0, 0, 0, 0, 0, 0 };
+- int curr_wintype = 0;
+-
+ QtMWMHints mwmhints;
+ mwmhints.flags = 0L;
+ mwmhints.functions = MWM_FUNC_ALL;
+@@ -576,15 +572,11 @@
+ if (topLevel) {
+ ulong wsa_mask = 0;
+ if (type == Qt::SplashScreen) {
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_SPLASH);
+ } else { // if (customize) {
+ mwmhints.decorations = 0L;
+ mwmhints.flags |= MWM_HINTS_DECORATIONS;
+
+- if (flags & Qt::FramelessWindowHint) {
+- // override netwm type - quick and easy for KDE noborder
+- net_wintypes[curr_wintype++] = ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE);
+- } else {
++ if ((flags & Qt::FramelessWindowHint) == 0 ) {
+ mwmhints.decorations |= MWM_DECOR_BORDER;
+ mwmhints.decorations |= MWM_DECOR_RESIZEH;
+
+@@ -606,22 +598,6 @@
+ wsa.save_under = True;
+ wsa_mask |= CWSaveUnder;
+ }
+- // ### need a better way to do this
+- if (q->inherits("QMenu")) {
+- // menu netwm type
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_MENU);
+- } else if (q->inherits("QToolBar")) {
+- // toolbar netwm type
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_TOOLBAR);
+- } else if (type == Qt::Tool || type == Qt::Drawer) {
+- // utility netwm type
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_UTILITY);
+- }
+-
+- if (dialog) // dialog netwm type
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_DIALOG);
+- // normal netwm type - default
+- net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
+
+ if (flags & Qt::X11BypassWindowManagerHint) {
+ wsa.override_redirect = True;
+@@ -640,6 +616,7 @@
+ wsa.save_under = True;
+ XChangeWindowAttributes(dpy, id, CWOverrideRedirect | CWSaveUnder,
+ &wsa);
++ q->x11SetWindowType();
+ } else if (topLevel && !desktop) { // top-level widget
+ if (!X11->wm_client_leader)
+ create_wm_client_leader();
+@@ -684,12 +661,7 @@
+ // set mwm hints
+ SetMWMHints(dpy, id, mwmhints);
+
+- // set _NET_WM_WINDOW_TYPE
+- if (curr_wintype > 0)
+- XChangeProperty(dpy, id, ATOM(_NET_WM_WINDOW_TYPE), XA_ATOM, 32, PropModeReplace,
+- (unsigned char *) net_wintypes, curr_wintype);
+- else
+- XDeleteProperty(dpy, id, ATOM(_NET_WM_WINDOW_TYPE));
++ q->x11SetWindowType(); // set _NET_WM_WINDOW_TYPE
+
+ // set _NET_WM_PID
+ long curr_pid = getpid();
+@@ -785,6 +757,63 @@
+ q->setAttribute(Qt::WA_OutsideWSRange, true);
+ }
+
++// Sets the EWMH (netwm) window type. Needed as a separate function
++// because create() may be too soon in some cases.
++void QWidget::x11SetWindowType( X11WindowType type )
++{
++ Display* dpy = X11->display;
++ // NET window types
++ long net_wintypes[7] = { 0, 0, 0, 0, 0, 0, 0 };
++ int curr_wintype = 0;
++ if( type == X11WindowTypeSelect ) {
++ if ( windowType() == Qt::SplashScreen ) {
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_SPLASH);
++ } else if (inherits("QToolBar")) {
++ // toolbar netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_TOOLBAR);
++ } else if (windowType() == Qt::Tool || windowType() == Qt::Drawer) {
++ // utility netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_UTILITY);
++ } else if (windowType() == Qt::Dialog || windowType() == Qt::Sheet
++ || (windowFlags() & Qt::MSWindowsFixedSizeDialogHint)) {
++ // dialog netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_DIALOG);
++ }
++ } else if( type == X11WindowTypeCombo ) {
++ // combo netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_COMBO);
++ } else if( type == X11WindowTypeDND ) {
++ // dnd netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_DND);
++ } else if( type == X11WindowTypeDropdown ) {
++ // dropdown netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU);
++ } else if( type == X11WindowTypePopup ) {
++ // popup netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_POPUP_MENU);
++ } else if( type == X11WindowTypeMenu ) {
++ // menu netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_MENU);
++ } else if( type == X11WindowTypeTooltip ) {
++ // tooltip netwm type
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_TOOLTIP);
++ }
++
++ // normal netwm type - default
++ net_wintypes[curr_wintype++] = ATOM(_NET_WM_WINDOW_TYPE_NORMAL);
++ // set _NET_WM_WINDOW_TYPE
++ if (curr_wintype > 0)
++ XChangeProperty(dpy, winId(), ATOM(_NET_WM_WINDOW_TYPE), XA_ATOM, 32, PropModeReplace,
++ (unsigned char *) net_wintypes, curr_wintype);
++ else
++ XDeleteProperty(dpy, winId(), ATOM(_NET_WM_WINDOW_TYPE));
++}
++
++void QWidget::x11SetWindowTransient( QWidget* parent )
++{
++ XSetTransientForHint( X11->display, winId(), parent->window()->winId());
++}
++
+ /*!
+ Frees up window system resources. Destroys the widget window if \a
+ destroyWindow is true.
+--- qt4-x11-4.3.1.orig/src/gui/widgets/qcombobox.cpp
++++ qt4-x11-4.3.1/src/gui/widgets/qcombobox.cpp
+@@ -333,6 +333,10 @@
+ combo->update();
+ }
+ }
++#ifdef Q_WS_X11
++ x11SetWindowType( X11WindowTypeCombo );
++ x11SetWindowTransient( combo->topLevelWidget());
++#endif
+ }
+
+ void QComboBoxPrivateContainer::leaveEvent(QEvent *)
+--- qt4-x11-4.3.1.orig/src/gui/widgets/qmenu.cpp
++++ qt4-x11-4.3.1/src/gui/widgets/qmenu.cpp
+@@ -99,6 +99,9 @@
+ QTornOffMenu(QMenu *p) : QMenu(*(new QTornOffMenuPrivate(p)))
+ {
+ setParent(p, Qt::Window | Qt::Tool);
++#ifdef Q_WS_X11
++ x11SetWindowType( X11WindowTypeMenu );
++#endif
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(p->windowTitle());
+ setEnabled(p->isEnabled());
+@@ -145,6 +148,9 @@
+ }
+ defaultMenuAction = menuAction = new QAction(q);
+ menuAction->d_func()->menu = q;
++#ifdef Q_WS_X11
++ q->x11SetWindowType( QWidget::X11WindowTypePopup );
++#endif
+ }
+
+ //Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
+@@ -1669,6 +1675,32 @@
+ }
+ setGeometry(QRect(pos, size));
+
++#ifdef Q_WS_X11
++ QWidget* top = this;
++ for(;;) {
++ if( QMenu* m = qobject_cast< QMenu* >( top )) {
++ if( m->d_func()->causedPopup.widget == NULL )
++ break; // --->
++ top = m->d_func()->causedPopup.widget;
++ } else
++ break; // -->
++ }
++ if( QMenu* m = qobject_cast< QMenu* >( top ))
++ x11SetWindowType( X11WindowTypePopup );
++ else
++ x11SetWindowType( X11WindowTypeDropdown );
++ // hackish ... try to find the main window related to this popup
++ QWidget* parent = d_func()->causedPopup.widget;
++ if( parent == NULL )
++ parent = parentWidget() ? parentWidget()->topLevelWidget() : NULL;
++ if( parent == NULL )
++ parent = QApplication::widgetAt( pos );
++ if( parent == NULL )
++ parent = qApp->activeWindow();
++ if( parent != NULL )
++ x11SetWindowTransient( parent );
++#endif
++
+ #ifndef QT_NO_EFFECTS
+ int hGuess = qApp->layoutDirection() == Qt::RightToLeft ? QEffects::LeftScroll : QEffects::RightScroll;
+ int vGuess = QEffects::DownScroll;
+@@ -1865,6 +1897,9 @@
+ if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
+ mb->d_func()->setCurrentAction(0);
+ #endif
++#ifdef Q_WS_X11
++ x11SetWindowType( X11WindowTypePopup ); // reset
++#endif
+ d->mouseDown = 0;
+ d->hasHadMouse = false;
+ d->causedPopup.widget = 0;
diff --git a/debian/patches/0179-transient-hack.diff b/debian/patches/0179-transient-hack.diff
new file mode 100644
index 0000000..6689a99
--- /dev/null
+++ b/debian/patches/0179-transient-hack.diff
@@ -0,0 +1,11 @@
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget_x11.cpp
+@@ -1650,7 +1650,7 @@
+ do_size_hints(q, extra);
+
+ // udpate WM_TRANSIENT_FOR
+- if (isTransient(q)) {
++ if (isTransient(q) && !( q->windowFlags() & Qt::X11BypassWindowManagerHint)) {
+ QWidget *p = q->parentWidget();
+ if (p)
+ p = p->window();
diff --git a/debian/patches/0180-window-role.diff b/debian/patches/0180-window-role.diff
new file mode 100644
index 0000000..8d26609
--- /dev/null
+++ b/debian/patches/0180-window-role.diff
@@ -0,0 +1,81 @@
+--- qt4-x11-4.3.1.orig/src/corelib/kernel/qobject.cpp
++++ qt4-x11-4.3.1/src/corelib/kernel/qobject.cpp
+@@ -1008,9 +1008,18 @@
+ {
+ Q_D(QObject);
+ d->objectName = name;
++#if defined(Q_WS_X11)
++ d->checkWindowRole();
++#endif
+ }
+
+
++#if defined(Q_WS_X11)
++void QObjectPrivate::checkWindowRole()
++{
++}
++#endif
++
+ #ifdef QT3_SUPPORT
+ /*! \internal
+ QObject::child is compat but needs to call itself recursively,
+--- qt4-x11-4.3.1.orig/src/corelib/kernel/qobject_p.h
++++ qt4-x11-4.3.1/src/corelib/kernel/qobject_p.h
+@@ -139,6 +139,9 @@
+ mutable quint32 connectedSignals;
+
+ QString objectName;
++#if defined(Q_WS_X11)
++ virtual void checkWindowRole();
++#endif
+ };
+
+ class QSemaphore;
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget_p.h
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget_p.h
+@@ -305,6 +305,7 @@
+
+ #if defined(Q_WS_X11)
+ void setWindowRole(const char *role);
++ virtual void checkWindowRole();
+ void sendStartupMessage(const char *message) const;
+ #endif
+
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget_x11.cpp
+@@ -671,11 +671,8 @@
+ // when we create a toplevel widget, the frame strut should be dirty
+ data.fstrut_dirty = 1;
+
+- // declare the widget's object name as window role
+- QByteArray objName = q->objectName().toLocal8Bit();
+- XChangeProperty(dpy, id,
+- ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace,
+- (unsigned char *)objName.constData(), objName.length());
++ // declare the widget's object name as window role if not set
++ setWindowRole( !q->windowRole().isEmpty() ? q->windowRole().toUtf8() : q->objectName().toUtf8());
+
+ // set client leader property
+ XChangeProperty(dpy, id, ATOM(WM_CLIENT_LEADER),
+@@ -2669,12 +2666,20 @@
+ void QWidgetPrivate::setWindowRole(const char *role)
+ {
+ Q_Q(QWidget);
+- Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
++ if( !q->testAttribute(Qt::WA_WState_Created))
++ return;
+ XChangeProperty(X11->display, q->internalWinId(),
+ ATOM(WM_WINDOW_ROLE), XA_STRING, 8, PropModeReplace,
+ (unsigned char *)role, qstrlen(role));
+ }
+
++void QWidgetPrivate::checkWindowRole()
++{
++ Q_Q(QWidget);
++ if( q->windowRole().isEmpty())
++ setWindowRole( objectName.toUtf8());
++}
++
+ Q_GLOBAL_STATIC(QX11PaintEngine, qt_widget_paintengine)
+ QPaintEngine *QWidget::paintEngine() const
+ {
diff --git a/debian/patches/0181-qdnd-x11-fix.diff b/debian/patches/0181-qdnd-x11-fix.diff
new file mode 100644
index 0000000..c2e07c3
--- /dev/null
+++ b/debian/patches/0181-qdnd-x11-fix.diff
@@ -0,0 +1,84 @@
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qdnd_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qdnd_x11.cpp
+@@ -58,6 +58,7 @@
+ #include "qimagewriter.h"
+ #include "qbuffer.h"
+ #include "qtextcodec.h"
++#include "qstack.h"
+
+ #include "qdnd_p.h"
+ #include "qt_x11_p.h"
+@@ -715,7 +716,44 @@
+ }
+
+
+-static QWidget *find_child(QWidget *tlw, QPoint & p)
++static QWidget *find_next_child(QWidget *child, QPoint &p, QStack<int> &chosenLine)
++{
++ p = child->mapToParent(p);
++ QWidget *widget = child->parentWidget();
++ if (!widget) {
++ return widget;
++ }
++
++ bool done = false;
++ bool backwards = true;
++ while (!done) {
++ done = true;
++ if (((QExtraWidget*)widget)->extraData() &&
++ ((QExtraWidget*)widget)->extraData()->xDndProxy != 0)
++ break; // stop searching for widgets under the mouse cursor if found widget is a proxy.
++ QObjectList children = widget->children();
++ if (!chosenLine.isEmpty() && !children.isEmpty()) {
++ for(int i = backwards ? chosenLine.pop() : children.size(); i > 0;) {
++ --i;
++ QWidget *w = qobject_cast<QWidget *>(children.at(i));
++ if (!w)
++ continue;
++ if (w->isVisible() &&
++ w->geometry().contains(p) &&
++ !w->isWindow()) {
++ widget = w;
++ done = false;
++ backwards = false;
++ p = widget->mapFromParent(p);
++ chosenLine << i;
++ break;
++ }
++ }
++ }
++ }
++ return widget;
++}
++static QWidget *find_child(QWidget *tlw, QPoint & p, QStack<int> &chosenLine)
+ {
+ QWidget *widget = tlw;
+
+@@ -739,6 +777,7 @@
+ widget = w;
+ done = false;
+ p = widget->mapFromParent(p);
++ chosenLine.push(i);
+ break;
+ }
+ }
+@@ -827,7 +866,8 @@
+ const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
+
+ QPoint p((l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff);
+- QWidget * c = find_child(w, p); // changes p to to c-local coordinates
++ QStack<int> chosenLine;
++ QWidget * c = find_child(w, p, chosenLine); // changes p to to c-local coordinates
+
+ if (!passive && checkEmbedded(c, xe))
+ return;
+@@ -861,8 +901,7 @@
+
+ if (!passive) { // otherwise just reject
+ while (c && !c->acceptDrops() && !c->isWindow()) {
+- p = c->mapToParent(p);
+- c = c->parentWidget();
++ c = find_next_child(c, p, chosenLine);
+ }
+ QWidget *target_widget = c && c->acceptDrops() ? c : 0;
+
diff --git a/debian/patches/0182-argb-visuals-default.diff b/debian/patches/0182-argb-visuals-default.diff
new file mode 100644
index 0000000..dc440d4
--- /dev/null
+++ b/debian/patches/0182-argb-visuals-default.diff
@@ -0,0 +1,124 @@
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qapplication_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qapplication_x11.cpp
+@@ -1567,6 +1567,30 @@
+ / (DisplayHeightMM(X11->display, s)*10);
+ }
+
++
++#ifndef QT_NO_XRENDER
++ int xrender_eventbase, xrender_errorbase;
++ // See if XRender is supported on the connected display
++ if (XQueryExtension(X11->display, "RENDER", &X11->xrender_major,
++ &xrender_eventbase, &xrender_errorbase)
++ && XRenderQueryExtension(X11->display, &xrender_eventbase,
++ &xrender_errorbase)) {
++ // Check the version as well - we need v0.4 or higher
++ int major = 0;
++ int minor = 0;
++ XRenderQueryVersion(X11->display, &major, &minor);
++ if (qgetenv("QT_X11_NO_XRENDER").isNull()) {
++ X11->use_xrender = (major >= 0 && minor >= 5);
++ X11->xrender_version = major*100+minor;
++ // workaround for broken XServer on Ubuntu Breezy (6.8 compiled with 7.0
++ // protocol headers)
++ if (X11->xrender_version == 10
++ && VendorRelease(X11->display) < 60900000
++ && QByteArray(ServerVendor(X11->display)).contains("X.Org"))
++ X11->xrender_version = 9;
++ }
++ }
++#endif // QT_NO_XRENDER
+ QColormap::initialize();
+
+ // Support protocols
+@@ -1590,30 +1614,15 @@
+ #endif // QT_NO_XRANDR
+
+ #ifndef QT_NO_XRENDER
+- int xrender_eventbase, xrender_errorbase;
+- // See if XRender is supported on the connected display
+- if (XQueryExtension(X11->display, "RENDER", &X11->xrender_major,
+- &xrender_eventbase, &xrender_errorbase)
+- && XRenderQueryExtension(X11->display, &xrender_eventbase,
+- &xrender_errorbase)) {
++ if (X11->use_xrender) {
+ // XRender is supported, let's see if we have a PictFormat for the
+ // default visual
+ XRenderPictFormat *format =
+ XRenderFindVisualFormat(X11->display,
+ (Visual *) QX11Info::appVisual(X11->defaultScreen));
+- // Check the version as well - we need v0.4 or higher
+- int major = 0;
+- int minor = 0;
+- XRenderQueryVersion(X11->display, &major, &minor);
+- if (qgetenv("QT_X11_NO_XRENDER").isNull() && format != 0) {
+- X11->use_xrender = (major >= 0 && minor >= 5);
+- X11->xrender_version = major*100+minor;
+- // workaround for broken XServer on Ubuntu Breezy (6.8 compiled with 7.0
+- // protocol headers)
+- if (X11->xrender_version == 10
+- && VendorRelease(X11->display) < 60900000
+- && QByteArray(ServerVendor(X11->display)).contains("X.Org"))
+- X11->xrender_version = 9;
++
++ if (!format) {
++ X11->use_xrender = false;
+ }
+ }
+ #endif // QT_NO_XRENDER
+--- qt4-x11-4.3.1.orig/src/gui/kernel/qwidget_x11.cpp
++++ qt4-x11-4.3.1/src/gui/kernel/qwidget_x11.cpp
+@@ -555,7 +555,7 @@
+ picture = 0;
+ }
+
+- if (X11->use_xrender) {
++ if (X11->use_xrender && !desktop) {
+ XRenderPictFormat *format = XRenderFindVisualFormat(dpy, (Visual *) xinfo.visual());
+ if (format)
+ picture = XRenderCreatePicture(dpy, id, format, 0, 0);
+--- qt4-x11-4.3.1.orig/src/gui/painting/qcolormap_x11.cpp
++++ qt4-x11-4.3.1/src/gui/painting/qcolormap_x11.cpp
+@@ -401,7 +401,33 @@
+ } else if (!X11->custom_cmap) {
+ XStandardColormap *stdcmap = 0;
+ int ncmaps = 0;
+- if (XGetRGBColormaps(display, RootWindow(display, i),
++
++ bool foundArgbVisual = false;
++#ifndef QT_NO_XRENDER
++ if (X11->use_xrender) {
++ int nvi;
++ XVisualInfo templ;
++ templ.screen = i;
++ templ.depth = 32;
++ templ.c_class = TrueColor;
++ XVisualInfo *xvi = XGetVisualInfo(X11->display, VisualScreenMask |
++ VisualDepthMask |
++ VisualClassMask, &templ, &nvi);
++ for (int idx = 0; idx < nvi; ++idx) {
++ XRenderPictFormat *format = XRenderFindVisualFormat(X11->display,
++ xvi[idx].visual);
++ if (format->type == PictTypeDirect && format->direct.alphaMask) {
++ d->visual = xvi[idx].visual;
++ d->depth = 32;
++ d->defaultVisual = false;
++ foundArgbVisual = true;
++ break;
++ }
++ }
++ }
++#endif
++ if (!foundArgbVisual &&
++ XGetRGBColormaps(display, RootWindow(display, i),
+ &stdcmap, &ncmaps, XA_RGB_DEFAULT_MAP)) {
+ if (stdcmap) {
+ for (int c = 0; c < ncmaps; ++c) {
+@@ -459,7 +485,6 @@
+ }
+ }
+ }
+-
+ if (!use_stdcmap) {
+ switch (d->visual->c_class) {
+ case StaticGray:
diff --git a/debian/patches/0185-fix-format-strings.diff b/debian/patches/0185-fix-format-strings.diff
new file mode 100644
index 0000000..a664127
--- /dev/null
+++ b/debian/patches/0185-fix-format-strings.diff
@@ -0,0 +1,251 @@
+--- qt4-x11-4.3.1.orig/src/corelib/global/qglobal.h
++++ qt4-x11-4.3.1/src/corelib/global/qglobal.h
+@@ -1276,8 +1276,16 @@
+ #ifdef QT3_SUPPORT
+ Q_CORE_EXPORT QT3_SUPPORT void qSystemWarning(const char *msg, int code = -1);
+ #endif /* QT3_SUPPORT */
+-Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...);
+-Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
++Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 2, 3)))
++#endif
++ ;
++Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 1, 2)))
++#endif
++ ;
+
+ #if (defined(QT_NO_DEBUG_OUTPUT) || defined(QT_NO_TEXTSTREAM)) && !defined(QT_NO_DEBUG_STREAM)
+ #define QT_NO_DEBUG_STREAM
+--- qt4-x11-4.3.1.orig/src/corelib/tools/qbytearray.h
++++ qt4-x11-4.3.1/src/corelib/tools/qbytearray.h
+@@ -86,8 +86,16 @@
+ Q_CORE_EXPORT int qstrnicmp(const char *, const char *, uint len);
+
+ // implemented in qvsnprintf.cpp
+-Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
+-Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...);
++Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 3, 0)))
++#endif
++ ;
++Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 3, 4)))
++#endif
++ ;
+
+ #ifdef QT3_SUPPORT
+ inline QT3_SUPPORT void *qmemmove(void *dst, const void *src, uint len)
+--- qt4-x11-4.3.1.orig/src/gui/painting/qprintengine_pdf.cpp
++++ qt4-x11-4.3.1/src/gui/painting/qprintengine_pdf.cpp
+@@ -401,9 +401,8 @@
+ object = addXrefEntry(-1);
+ QByteArray alphaDef;
+ QPdf::ByteStream s(&alphaDef);
+- s << "<< /ca " << (alpha/qreal(255.)) << ">>\n";
+- xprintf(alphaDef.constData());
+- xprintf("endobj\n");
++ s << "<< /ca " << (alpha/qreal(255.)) << ">>";
++ xprintf("%s\nendobj\n", alphaDef.constData());
+ }
+ currentPage->graphicStates.append(object);
+ return object;
+--- qt4-x11-4.3.1.orig/src/gui/painting/qprintengine_pdf_p.h
++++ qt4-x11-4.3.1/src/gui/painting/qprintengine_pdf_p.h
+@@ -163,7 +163,11 @@
+ void writePage();
+
+ int addXrefEntry(int object, bool printostr = true);
+- void xprintf(const char* fmt, ...);
++ void xprintf(const char* fmt, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 2, 3)))
++#endif
++ ;
+ inline void write(const QByteArray &data) {
+ stream->writeRawData(data.constData(), data.size());
+ streampos += data.size();
+--- qt4-x11-4.3.1.orig/src/qt3support/tools/q3cstring.h
++++ qt4-x11-4.3.1/src/qt3support/tools/q3cstring.h
+@@ -72,7 +72,11 @@
+ }
+
+ Q3CString copy() const { return *this; }
+- Q3CString &sprintf(const char *format, ...);
++ Q3CString &sprintf(const char *format, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 2, 3)))
++#endif
++ ;
+
+ Q3CString left(uint len) const { return QByteArray::left(len); }
+ Q3CString right(uint len) const { return QByteArray::right(len); }
+--- qt4-x11-4.3.1.orig/src/qt3support/tools/q3gcache.cpp
++++ qt4-x11-4.3.1/src/qt3support/tools/q3gcache.cpp
+@@ -637,7 +637,7 @@
+ #if defined(QT_DEBUG)
+ QString line;
+ line.fill(QLatin1Char('*'), 80);
+- qDebug(line.ascii());
++ qDebug("%s", line.ascii());
+ qDebug("CACHE STATISTICS:");
+ qDebug("cache contains %d item%s, with a total cost of %d",
+ count(), count() != 1 ? "s" : "", tCost);
+@@ -658,7 +658,7 @@
+ lruList->dumps != 1 ? "have" : "has", lruList->dumpCosts);
+ qDebug("Statistics from internal dictionary class:");
+ dict->statistics();
+- qDebug(line.ascii());
++ qDebug("%s", line.ascii());
+ #endif
+ }
+
+--- qt4-x11-4.3.1.orig/src/qt3support/tools/q3gdict.cpp
++++ qt4-x11-4.3.1/src/qt3support/tools/q3gdict.cpp
+@@ -843,11 +843,11 @@
+ QString line;
+ line.fill(QLatin1Char('-'), 60);
+ double real, ideal;
+- qDebug(line.ascii());
++ qDebug("%s", line.ascii());
+ qDebug("DICTIONARY STATISTICS:");
+ if (count() == 0) {
+ qDebug("Empty!");
+- qDebug(line.ascii());
++ qDebug("%s", line.ascii());
+ return;
+ }
+ real = 0.0;
+@@ -868,7 +868,7 @@
+ while (b--)
+ *pbuf++ = '*';
+ *pbuf = '\0';
+- qDebug(buf);
++ qDebug("%s", buf);
+ i++;
+ }
+ qDebug("Array size = %d", size());
+@@ -876,7 +876,7 @@
+ qDebug("Real dist = %g", real);
+ qDebug("Rand dist = %g", ideal);
+ qDebug("Real/Rand = %g", real/ideal);
+- qDebug(line.ascii());
++ qDebug("%s", line.ascii());
+ #endif // QT_DEBUG
+ }
+
+--- qt4-x11-4.3.1.orig/tools/assistant/config.cpp
++++ qt4-x11-4.3.1/tools/assistant/config.cpp
+@@ -88,12 +88,12 @@
+
+ QFile file(profileFileName);
+ if (!file.exists()) {
+- qWarning( (QLatin1String("File does not exist: ") + profileFileName).toAscii().constData() );
++ qWarning( "File does not exist: %s", qPrintable(profileFileName) );
+ return 0;
+ }
+ DocuParser *parser = DocuParser::createParser( profileFileName );
+ if (!parser) {
+- qWarning( (QLatin1String("Failed to create parser for file: ") + profileFileName).toAscii().constData() );
++ qWarning( "Failed to create parser for file: %s", qPrintable(profileFileName) );
+ return 0;
+ }
+ if (parser->parserVersion() < DocuParser::Qt320) {
+@@ -104,7 +104,7 @@
+ parser->parse(&file);
+ config->profil = profileParser->profile();
+ if (!config->profil) {
+- qWarning( (QLatin1String("Config::loadConfig(), no profile in: ") + profileFileName).toAscii().constData() );
++ qWarning( "Config::loadConfig(), no profile in: %s", qPrintable(profileFileName) );
+ return 0;
+ }
+ config->profil->setProfileType(Profile::UserProfile);
+--- qt4-x11-4.3.1.orig/tools/assistant/index.cpp
++++ qt4-x11-4.3.1/tools/assistant/index.cpp
+@@ -195,7 +195,7 @@
+ {
+ QFile file( filename );
+ if ( !file.open(QFile::ReadOnly) ) {
+- qWarning( (QLatin1String("can not open file ") + filename).toAscii().constData() );
++ qWarning( "can not open file %s", qPrintable(filename) );
+ return;
+ }
+
+@@ -367,7 +367,7 @@
+
+ QFile file( fileName );
+ if ( !file.open( QFile::ReadOnly ) ) {
+- qWarning( (QLatin1String("cannot open file ") + fileName).toAscii().constData() );
++ qWarning( "cannot open file %s", qPrintable(fileName) );
+ return fileName;
+ }
+ QTextStream s( &file );
+@@ -489,7 +489,7 @@
+ QString fName = url.toLocalFile();
+ QFile file( fName );
+ if ( !file.open( QFile::ReadOnly ) ) {
+- qWarning( (QLatin1String("cannot open file ") + fName).toAscii().constData() );
++ qWarning( "cannot open file %s", qPrintable(fName) );
+ return false;
+ }
+
+--- qt4-x11-4.3.1.orig/tools/designer/src/lib/shared/qdesigner_utils.cpp
++++ qt4-x11-4.3.1/tools/designer/src/lib/shared/qdesigner_utils.cpp
+@@ -55,9 +55,7 @@
+ {
+ QDESIGNER_SHARED_EXPORT void designerWarning(const QString &message)
+ {
+- QString prefixedMessage = QLatin1String("Designer: ");
+- prefixedMessage += message;
+- qWarning(prefixedMessage.toUtf8().constData());
++ qWarning("Designer: %s", qPrintable(message));
+ }
+
+ QString EnumType::id() const
+--- qt4-x11-4.3.1.orig/tools/designer/src/lib/uilib/formbuilderextra.cpp
++++ qt4-x11-4.3.1/tools/designer/src/lib/uilib/formbuilderextra.cpp
+@@ -48,9 +48,7 @@
+ #endif
+
+ void uiLibWarning(const QString &message) {
+- QString prefixedMessage = QLatin1String("Designer: ");
+- prefixedMessage += message;
+- qWarning(prefixedMessage.toUtf8().constData());
++ qWarning("Designer: %s", qPrintable(message));
+ }
+
+ QFormBuilderExtra::QFormBuilderExtra() :
+--- qt4-x11-4.3.1.orig/tools/linguist/shared/profileevaluator.h
++++ qt4-x11-4.3.1/tools/linguist/shared/profileevaluator.h
+@@ -103,7 +103,11 @@
+
+ private:
+ void logMessage(const QString &msg, MessageType mt = MT_DebugLevel2);
+- void logMessage(MessageType mt, const char *msg, ...);
++ void logMessage(MessageType mt, const char *msg, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 3, 4)))
++#endif
++ ;
+ QString expandVariableReferences(const QString &value);
+ QString evaluateExpandFunction(const QByteArray &func, const QString &arguments);
+
+--- qt4-x11-4.3.1.orig/tools/qtestlib/src/qtest_global.h
++++ qt4-x11-4.3.1/tools/qtestlib/src/qtest_global.h
+@@ -74,7 +74,11 @@
+ enum SkipMode { SkipSingle = 1, SkipAll = 2 };
+ enum TestFailMode { Abort = 1, Continue = 2 };
+
+- int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format, ...);
++ int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format, ...)
++#if defined(Q_CC_GNU) && !defined(__INSURE__)
++ __attribute__ ((format (printf, 3, 4)))
++#endif
++ ;
+ }
+
+ QT_END_HEADER
diff --git a/debian/patches/0186-fix-component-alpha-text.diff b/debian/patches/0186-fix-component-alpha-text.diff
new file mode 100644
index 0000000..0f63254
--- /dev/null
+++ b/debian/patches/0186-fix-component-alpha-text.diff
@@ -0,0 +1,40 @@
+--- qt4-x11-4.3.1.orig/src/gui/text/qfontengine_ft.cpp
++++ qt4-x11-4.3.1/src/gui/text/qfontengine_ft.cpp
+@@ -716,7 +716,8 @@
+ uint red = src[x];
+ uint green = src[x+1];
+ uint blue = src[x+2];
+- uint res = (red << 16) + (green << 8) + blue;
++ uint alpha = green;
++ uint res = (alpha << 24) + (red << 16) + (green << 8) + blue;
+ *dd = res;
+ ++dd;
+ }
+@@ -730,7 +731,8 @@
+ uint blue = src[x];
+ uint green = src[x+1];
+ uint red = src[x+2];
+- uint res = (red << 16) + (green << 8) + blue;
++ uint alpha = green;
++ uint res = (alpha << 24) + (red << 16) + (green << 8) + blue;
+ *dd = res;
+ ++dd;
+ }
+@@ -754,7 +756,7 @@
+ uint high = (red*subpixel_filter[0][0] + green*subpixel_filter[0][1] + blue*subpixel_filter[0][2]) >> 8;
+ uint mid = (red*subpixel_filter[1][0] + green*subpixel_filter[1][1] + blue*subpixel_filter[1][2]) >> 8;
+ uint low = (red*subpixel_filter[2][0] + green*subpixel_filter[2][1] + blue*subpixel_filter[2][2]) >> 8;
+- uint res = (high << 16) + (mid << 8) + low;
++ uint res = (mid << 24) + (high << 16) + (mid << 8) + low;
+ dst[x] = res;
+ }
+ dst += info.width;
+@@ -769,7 +771,7 @@
+ uint high = (red*subpixel_filter[0][0] + green*subpixel_filter[0][1] + blue*subpixel_filter[0][2]) >> 8;
+ uint mid = (red*subpixel_filter[1][0] + green*subpixel_filter[1][1] + blue*subpixel_filter[1][2]) >> 8;
+ uint low = (red*subpixel_filter[2][0] + green*subpixel_filter[2][1] + blue*subpixel_filter[2][2]) >> 8;
+- uint res = (high << 16) + (mid << 8) + low;
++ uint res = (mid << 24) + (high << 16) + (mid << 8) + low;
+ dst[x] = res;
+ }
+ dst += info.width;
diff --git a/debian/patches/0187-fix-font-fixed-pitch.diff b/debian/patches/0187-fix-font-fixed-pitch.diff
new file mode 100644
index 0000000..f82eb1a
--- /dev/null
+++ b/debian/patches/0187-fix-font-fixed-pitch.diff
@@ -0,0 +1,39 @@
+--- qt4-x11-4.3.1.orig/src/gui/text/qfont.cpp
++++ qt4-x11-4.3.1/src/gui/text/qfont.cpp
+@@ -2093,7 +2093,6 @@
+ {
+ QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
+ Q_ASSERT(engine != 0);
+-#ifdef Q_OS_MAC
+ if (!engine->fontDef.fixedPitchComputed) {
+ QChar ch[2] = { QLatin1Char('i'), QLatin1Char('m') };
+ QGlyphLayout g[2];
+@@ -2102,7 +2101,6 @@
+ engine->fontDef.fixedPitch = g[0].advance.x == g[1].advance.x;
+ engine->fontDef.fixedPitchComputed = true;
+ }
+-#endif
+ return engine->fontDef.fixedPitch;
+ }
+
+--- qt4-x11-4.3.1.orig/src/gui/text/qfont_p.h
++++ qt4-x11-4.3.1/src/gui/text/qfont_p.h
+@@ -66,9 +66,7 @@
+ styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
+ weight(50), fixedPitch(false), style(QFont::StyleNormal), stretch(100),
+ ignorePitch(true)
+-#ifdef Q_WS_MAC
+ ,fixedPitchComputed(false)
+-#endif
+ {
+ }
+
+@@ -90,7 +88,7 @@
+ uint stretch : 12; // 0-400
+
+ uint ignorePitch : 1;
+- uint fixedPitchComputed : 1; // for Mac OS X only
++ uint fixedPitchComputed : 1;
+ uint reserved : 16; // for future extensions
+
+ bool exactMatch(const QFontDef &other) const;
diff --git a/debian/patches/01_qmake_for_debian.diff b/debian/patches/01_qmake_for_debian.diff
new file mode 100644
index 0000000..667ea46
--- /dev/null
+++ b/debian/patches/01_qmake_for_debian.diff
@@ -0,0 +1,26 @@
+--- qt4-x11-4.3.1.orig/mkspecs/common/linux.conf
++++ qt4-x11-4.3.1/mkspecs/common/linux.conf
+@@ -23,8 +23,8 @@
+ QMAKE_LIBS_OPENGL_QT = -lGL
+ QMAKE_LIBS_THREAD = -lpthread
+
+-QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
+-QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
++QMAKE_MOC = $$[QT_INSTALL_BINS]/moc-qt4
++QMAKE_UIC = $$[QT_INSTALL_BINS]/uic-qt4
+
+ QMAKE_AR = ar cqs
+ QMAKE_RANLIB =
+--- qt4-x11-4.3.1.orig/mkspecs/linux-g++/qmake.conf
++++ qt4-x11-4.3.1/mkspecs/linux-g++/qmake.conf
+@@ -4,8 +4,9 @@
+
+ MAKEFILE_GENERATOR = UNIX
+ TEMPLATE = app
+-CONFIG += qt warn_on release incremental link_prl
++CONFIG += qt warn_on release incremental
+ QT += core gui
++DEFINES += QT_SHARED
+ QMAKE_INCREMENTAL_STYLE = sublib
+
+ include(../common/g++.conf)
diff --git a/debian/patches/02_launch_assistant-qt4.diff b/debian/patches/02_launch_assistant-qt4.diff
new file mode 100644
index 0000000..2bbf41b
--- /dev/null
+++ b/debian/patches/02_launch_assistant-qt4.diff
@@ -0,0 +1,16 @@
+--- qt4-x11-4.3.1.orig/tools/assistant/lib/qassistantclient.cpp
++++ qt4-x11-4.3.1/tools/assistant/lib/qassistantclient.cpp
+@@ -187,11 +187,11 @@
+ : QObject( parent ), host ( QLatin1String("localhost") )
+ {
+ if ( path.isEmpty() )
+- assistantCommand = QLatin1String("assistant");
++ assistantCommand = QLatin1String("assistant-qt4");
+ else {
+ QFileInfo fi( path );
+ if ( fi.isDir() )
+- assistantCommand = path + QLatin1String("/assistant");
++ assistantCommand = path + QLatin1String("/assistant-qt4");
+ else
+ assistantCommand = path;
+ }
diff --git a/debian/patches/03_launch_moc-qt4.diff b/debian/patches/03_launch_moc-qt4.diff
new file mode 100644
index 0000000..9322c4f
--- /dev/null
+++ b/debian/patches/03_launch_moc-qt4.diff
@@ -0,0 +1,11 @@
+--- qt4-x11-4.3.1.orig/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
++++ qt4-x11-4.3.1/tools/qdbus/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
+@@ -391,7 +391,7 @@
+ else {
+ // run moc on this file
+ QProcess proc;
+- proc.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/moc"), QStringList() << QFile::decodeName(argv[i]), QIODevice::ReadOnly | QIODevice::Text);
++ proc.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/moc-qt4"), QStringList() << QFile::decodeName(argv[i]), QIODevice::ReadOnly | QIODevice::Text);
+
+ if (!proc.waitForStarted()) {
+ fprintf(stderr, PROGRAMNAME ": could not execute moc! Aborting.\n");
diff --git a/debian/patches/04_launch_uic-qt4.diff b/debian/patches/04_launch_uic-qt4.diff
new file mode 100644
index 0000000..a44ed6a
--- /dev/null
+++ b/debian/patches/04_launch_uic-qt4.diff
@@ -0,0 +1,11 @@
+--- qt4-x11-4.3.1.orig/tools/designer/src/lib/shared/qdesigner_utils.cpp
++++ qt4-x11-4.3.1/tools/designer/src/lib/shared/qdesigner_utils.cpp
+@@ -133,7 +133,7 @@
+ binary += QDir::separator();
+ switch (mode) {
+ case UIC_GenerateCode:
+- binary += QLatin1String("uic");
++ binary += QLatin1String("uic-qt4");
+ break;
+ case UIC_ConvertV3:
+ binary += QLatin1String("uic3");
diff --git a/debian/patches/05_append_qt4_target.diff b/debian/patches/05_append_qt4_target.diff
new file mode 100644
index 0000000..c1726e2
--- /dev/null
+++ b/debian/patches/05_append_qt4_target.diff
@@ -0,0 +1,221 @@
+--- qt4-x11-4.3.1.orig/config.tests/unix/compile.test
++++ qt4-x11-4.3.1/config.tests/unix/compile.test
+@@ -51,7 +51,7 @@
+ cd "$OUTDIR/$TEST"
+
+ make distclean >/dev/null 2>&1
+-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
++"$OUTDIR/bin/qmake-qt4" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
+
+ if [ "$VERBOSE" = "yes" ]; then
+ make
+--- qt4-x11-4.3.1.orig/config.tests/unix/doubleformat.test
++++ qt4-x11-4.3.1/config.tests/unix/doubleformat.test
+@@ -10,7 +10,7 @@
+
+ # build and run a test program
+ test -d "$OUTDIR/config.tests/unix/doubleformat" || mkdir -p "$OUTDIR/config.tests/unix/doubleformat"
+-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1
++"$OUTDIR/bin/qmake-qt4" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1
+ cd "$OUTDIR/config.tests/unix/doubleformat"
+
+ DOUBLEFORMAT="UNKNOWN"
+--- qt4-x11-4.3.1.orig/config.tests/unix/endian.test
++++ qt4-x11-4.3.1/config.tests/unix/endian.test
+@@ -10,7 +10,7 @@
+
+ # build and run a test program
+ test -d "$OUTDIR/config.tests/unix/endian" || mkdir -p "$OUTDIR/config.tests/unix/endian"
+-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/endian/endiantest.pro" -o "$OUTDIR/config.tests/unix/endian/Makefile" >/dev/null 2>&1
++"$OUTDIR/bin/qmake-qt4" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/endian/endiantest.pro" -o "$OUTDIR/config.tests/unix/endian/Makefile" >/dev/null 2>&1
+ cd "$OUTDIR/config.tests/unix/endian"
+
+ ENDIAN="UNKNOWN"
+--- qt4-x11-4.3.1.orig/config.tests/unix/ptrsize.test
++++ qt4-x11-4.3.1/config.tests/unix/ptrsize.test
+@@ -10,7 +10,7 @@
+
+ # build and run a test program
+ test -d "$OUTDIR/config.tests/unix/ptrsize" || mkdir -p "$OUTDIR/config.tests/unix/ptrsize"
+-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
++"$OUTDIR/bin/qmake-qt4" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
+ cd "$OUTDIR/config.tests/unix/ptrsize"
+
+ if [ "$VERBOSE" = "yes" ]; then
+--- qt4-x11-4.3.1.orig/config.tests/x11/notype.test
++++ qt4-x11-4.3.1/config.tests/x11/notype.test
+@@ -27,7 +27,7 @@
+ NOTYPE=yes
+
+ test -d "$OUTDIR/config.tests/x11/notype" || mkdir -p "$OUTDIR/config.tests/x11/notype"
+- "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/x11/notype/notypetest.pro" -o "$OUTDIR/config.tests/x11/notype/Makefile" >/dev/null 2>&1
++ "$OUTDIR/bin/qmake-qt4" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/x11/notype/notypetest.pro" -o "$OUTDIR/config.tests/x11/notype/Makefile" >/dev/null 2>&1
+ cd "$OUTDIR/config.tests/x11/notype"
+
+ if [ "$VERBOSE" = "yes" ]; then
+--- qt4-x11-4.3.1.orig/configure
++++ qt4-x11-4.3.1/configure
+@@ -3412,7 +3412,7 @@
+ }
+
+ # build qmake
+-if true; then ###[ '!' -f "$outpath/bin/qmake" ];
++if true; then ###[ '!' -f "$outpath/bin/qmake-qt4" ];
+ echo "Creating qmake. Please wait..."
+
+ OLD_QCONFIG_H=
+@@ -5328,8 +5328,8 @@
+ QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc
+
+ #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
+-QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc
+-QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic
++QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc-qt4
++QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic-qt4
+ QMAKE_UIC3 = \$\$QT_BUILD_TREE/bin/uic3
+ QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc
+ QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
+@@ -5593,11 +5593,11 @@
+ #-------------------------------------------------------------------------------
+
+ echo "Finding project files. Please wait..."
+-"$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
++"$outpath/bin/qmake-qt4" -prl -r "${relpath}/projects.pro"
+ if [ -f "${relpath}/projects.pro" ]; then
+ mkfile="${outpath}/Makefile"
+ [ -f "$mkfile" ] && chmod +w "$mkfile"
+- QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
++ QTDIR="$outpath" "$outpath/bin/qmake-qt4" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
+ fi
+
+ # .projects -> projects to process
+@@ -5770,7 +5770,7 @@
+ echo " for $a\c"
+ fi
+
+- QMAKE="$outpath/bin/qmake"
++ QMAKE="$outpath/bin/qmake-qt4"
+ QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
+ if [ "$file" = ".projects.3" ]; then
+ if echo '\c' | grep '\c' >/dev/null; then
+--- qt4-x11-4.3.1.orig/projects.pro
++++ qt4-x11-4.3.1/projects.pro
+@@ -115,7 +115,7 @@
+ win32 {
+ qmake.files=$$QT_BUILD_TREE/bin/qmake.exe
+ } else {
+- qmake.files=$$QT_BUILD_TREE/bin/qmake
++ qmake.files=$$QT_BUILD_TREE/bin/qmake-qt4
+ }
+ INSTALLS += qmake
+
+--- qt4-x11-4.3.1.orig/qmake/Makefile.unix
++++ qt4-x11-4.3.1/qmake/Makefile.unix
+@@ -89,17 +89,17 @@
+
+ CXXFLAGS = @QMAKE_CXXFLAGS@ $(CPPFLAGS)
+
+-first all: $(BUILD_PATH)/bin/qmake
+-qmake: $(BUILD_PATH)/bin/qmake
++first all: $(BUILD_PATH)/bin/qmake-qt4
++qmake: $(BUILD_PATH)/bin/qmake-qt4
+
+-$(BUILD_PATH)/bin/qmake: $(OBJS) $(QOBJS)
++$(BUILD_PATH)/bin/qmake-qt4: $(OBJS) $(QOBJS)
+ $(CXX) -o "$@" $(OBJS) $(QOBJS) $(LFLAGS)
+
+ clean::
+ rm -f $(OBJS) $(QOBJS)
+
+ distclean:: clean
+- rm -rf $(BUILD_PATH)/bin/qmake .deps
++ rm -rf $(BUILD_PATH)/bin/qmake-qt4 .deps
+
+ depend:
+ makedepend -D__MAKEDEPEND__ $(CPPFLAGS) $(DEPEND_SRC)
+--- qt4-x11-4.3.1.orig/src/tools/moc/moc.pro
++++ qt4-x11-4.3.1/src/tools/moc/moc.pro
+@@ -1,5 +1,5 @@
+ TEMPLATE = app
+-TARGET = moc
++TARGET = moc-qt4
+
+ CONFIG += console qtinc
+ CONFIG -= qt
+--- qt4-x11-4.3.1.orig/src/tools/uic/uic.pro
++++ qt4-x11-4.3.1/src/tools/uic/uic.pro
+@@ -9,7 +9,7 @@
+
+ unix:!contains(QT_CONFIG, zlib):LIBS += -lz
+
+-TARGET = uic
++TARGET = uic-qt4
+ DESTDIR = ../../../bin
+
+ DEFINES += QT_BOOTSTRAPPED QT_UIC QT_LITE_UNICODE QT_NO_DATASTREAM \
+--- qt4-x11-4.3.1.orig/tools/assistant/assistant.pro
++++ qt4-x11-4.3.1/tools/assistant/assistant.pro
+@@ -2,7 +2,7 @@
+
+ TEMPLATE = app
+ LANGUAGE = C++
+-TARGET = assistant
++TARGET = assistant-qt4
+
+ CONFIG += qt warn_on
+
+--- qt4-x11-4.3.1.orig/tools/designer/src/designer/designer.pro
++++ qt4-x11-4.3.1/tools/designer/src/designer/designer.pro
+@@ -25,7 +25,7 @@
+ DEFINES += QT_DESIGNER_STATIC
+ }
+
+-TARGET = designer
++TARGET = designer-qt4
+
+ include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri)
+
+--- qt4-x11-4.3.1.orig/tools/linguist/linguist/linguist.pro
++++ qt4-x11-4.3.1/tools/linguist/linguist/linguist.pro
+@@ -50,7 +50,7 @@
+ DEFINES += QT_KEYWORDS
+
+ DESTDIR = ../../../bin
+-TARGET = linguist
++TARGET = linguist-qt4
+
+ win32:RC_FILE = linguist.rc
+
+--- qt4-x11-4.3.1.orig/tools/linguist/lrelease/lrelease.pro
++++ qt4-x11-4.3.1/tools/linguist/lrelease/lrelease.pro
+@@ -29,7 +29,7 @@
+ SOURCES += $$PROPARSERPATH/proitems.cpp \
+ $$PROPARSERPATH/proreader.cpp
+
+-TARGET = lrelease
++TARGET = lrelease-qt4
+ INCLUDEPATH += ../shared
+ DESTDIR = ../../../bin
+
+--- qt4-x11-4.3.1.orig/tools/linguist/lupdate/lupdate.pro
++++ qt4-x11-4.3.1/tools/linguist/lupdate/lupdate.pro
+@@ -39,7 +39,7 @@
+ $$PROPARSERPATH/proreader.cpp
+
+
+-TARGET = lupdate
++TARGET = lupdate-qt4
+ INCLUDEPATH += ../shared
+ DESTDIR = ../../../bin
+
+--- qt4-x11-4.3.1.orig/tools/qtconfig/qtconfig.pro
++++ qt4-x11-4.3.1/tools/qtconfig/qtconfig.pro
+@@ -16,7 +16,7 @@
+ RESOURCES = qtconfig.qrc
+
+ PROJECTNAME = Qt Configuration
+-TARGET = qtconfig
++TARGET = qtconfig-qt4
+ DESTDIR = ../../bin
+
+ target.path=$$[QT_INSTALL_BINS]
diff --git a/debian/patches/06_qtdemo_destdir.diff b/debian/patches/06_qtdemo_destdir.diff
new file mode 100644
index 0000000..862a59e
--- /dev/null
+++ b/debian/patches/06_qtdemo_destdir.diff
@@ -0,0 +1,21 @@
+--- qt4-x11-4.3.1.orig/demos/arthurplugin/arthurplugin.pro
++++ qt4-x11-4.3.1/demos/arthurplugin/arthurplugin.pro
+@@ -3,7 +3,7 @@
+
+ CONFIG += designer plugin debug_and_release
+ TEMPLATE = lib
+-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
++QTDIR_build:DESTDIR = plugins/designer
+
+ contains(QT_CONFIG, opengl) {
+ DEFINES += QT_OPENGL_SUPPORT
+--- qt4-x11-4.3.1.orig/demos/qtdemo/qtdemo.pro
++++ qt4-x11-4.3.1/demos/qtdemo/qtdemo.pro
+@@ -1,6 +1,6 @@
+ CONFIG += assistant x11inc
+ TARGET = qtdemo
+-DESTDIR = $$QT_BUILD_TREE/bin
++DESTDIR = bin
+ OBJECTS_DIR = .obj
+ MOC_DIR = .moc
+ INSTALLS += target sources
diff --git a/debian/patches/20_mips_atomic_ops.diff b/debian/patches/20_mips_atomic_ops.diff
new file mode 100644
index 0000000..ac7fe36
--- /dev/null
+++ b/debian/patches/20_mips_atomic_ops.diff
@@ -0,0 +1,58 @@
+--- qt4-x11-4.3.1.orig/src/corelib/arch/mips/qatomic32.s
++++ qt4-x11-4.3.1/src/corelib/arch/mips/qatomic32.s
+@@ -6,10 +6,12 @@
+ .globl q_atomic_test_and_set_int
+ .ent q_atomic_test_and_set_int
+ q_atomic_test_and_set_int:
++ .set mips2
+ 1: ll $8,0($4)
+ bne $8,$5,2f
+ move $2,$6
+ sc $2,0($4)
++ .set mips0
+ beqz $2,1b
+ nop
+ jr $31
+@@ -21,6 +23,7 @@
+ .globl q_atomic_test_and_set_acquire_int
+ .ent q_atomic_test_and_set_acquire_int
+ q_atomic_test_and_set_acquire_int:
++ .set mips2
+ 1: ll $8,0($4)
+ bne $8,$5,2f
+ move $2,$6
+@@ -30,6 +33,7 @@
+ jr $31
+ nop
+ 2: sync
++ .set mips0
+ jr $31
+ move $2,$0
+ .end q_atomic_test_and_set_acquire_int
+@@ -37,11 +41,13 @@
+ .globl q_atomic_test_and_set_release_int
+ .ent q_atomic_test_and_set_release_int
+ q_atomic_test_and_set_release_int:
++ .set mips2
+ sync
+ 1: ll $8,0($4)
+ bne $8,$5,2f
+ move $2,$6
+ sc $2,0($4)
++ .set mips0
+ beqz $2,1b
+ nop
+ jr $31
+@@ -53,10 +59,12 @@
+ .globl q_atomic_test_and_set_ptr
+ .ent q_atomic_test_and_set_ptr
+ q_atomic_test_and_set_ptr:
++ .set mips2
+ 1: ll $8,0($4)
+ bne $8,$5,2f
+ move $2,$6
+ sc $2,0($4)
++ .set mips0
+ beqz $2,1b
+ nop
+ jr $31
diff --git a/debian/patches/30_arm_ftbfs_fixes.diff b/debian/patches/30_arm_ftbfs_fixes.diff
new file mode 100644
index 0000000..b26ce77
--- /dev/null
+++ b/debian/patches/30_arm_ftbfs_fixes.diff
@@ -0,0 +1,11 @@
+--- qt4-x11-4.3.1.orig/tools/qtestlib/src/qtestcase.h
++++ qt4-x11-4.3.1/tools/qtestlib/src/qtestcase.h
+@@ -210,7 +210,7 @@
+ template <typename T1, typename T2>
+ bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int);
+
+-#if defined(QT_COORD_TYPE) || defined(__arm__)
++#if defined(QT_COORD_TYPE) || defined(QT_ARCH_ARM)
+ template <>
+ inline bool qCompare<qreal, double>(qreal const &t1, double const &t2, const char *actual,
+ const char *expected, const char *file, int line)
diff --git a/debian/patches/31_arm_eabi_fix.diff b/debian/patches/31_arm_eabi_fix.diff
new file mode 100644
index 0000000..0931fb1
--- /dev/null
+++ b/debian/patches/31_arm_eabi_fix.diff
@@ -0,0 +1,11 @@
+--- qt4-x11-4.3.1.orig/src/corelib/global/qglobal.h
++++ qt4-x11-4.3.1/src/corelib/global/qglobal.h
+@@ -331,7 +331,7 @@
+ # if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
+ # define Q_BROKEN_DEBUG_STREAM
+ # endif
+-# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
++# if (defined(__arm__) || defined(__ARMEL__)) && !defined(__ARM_EABI__) && !defined(QT_MOC_CPP)
+ # define Q_PACKED __attribute__ ((__packed__))
+ # define Q_NO_PACKED_REFERENCE
+ # endif
diff --git a/debian/patches/40_alpha_ice.diff b/debian/patches/40_alpha_ice.diff
new file mode 100644
index 0000000..3dc94d2
--- /dev/null
+++ b/debian/patches/40_alpha_ice.diff
@@ -0,0 +1,45 @@
+--- qt4-x11-4.3.1.orig/src/corelib/global/qlibraryinfo.cpp
++++ qt4-x11-4.3.1/src/corelib/global/qlibraryinfo.cpp
+@@ -69,14 +69,7 @@
+ {
+ public:
+ static QSettings *findConfiguration();
+- static void cleanup()
+- {
+- QLibrarySettings *ls = qt_library_settings();
+- if (ls) {
+- delete static_cast<QSettings *>(ls->settings);
+- ls->settings = 0;
+- }
+- }
++ static void cleanup();
+ static QSettings *configuration()
+ {
+ #ifdef QT_NO_THREAD
+@@ -95,6 +88,15 @@
+ }
+ };
+
++void QLibraryInfoPrivate::cleanup()
++{
++ QLibrarySettings *ls = qt_library_settings();
++ if (ls) {
++ delete static_cast<QSettings *>(ls->settings);
++ ls->settings = 0;
++ }
++}
++
+ QLibrarySettings::QLibrarySettings()
+ {
+ settings = QLibraryInfoPrivate::findConfiguration();
+--- qt4-x11-4.3.1.orig/src/corelib/tools/qhash.h
++++ qt4-x11-4.3.1/src/corelib/tools/qhash.h
+@@ -479,7 +479,7 @@
+ }
+
+ template <class Key, class T>
+-Q_INLINE_TEMPLATE void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
++void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
+ {
+ Node *concreteNode = concrete(node);
+ if (QTypeInfo<T>::isDummy) {
diff --git a/debian/patches/41_disable_opengl_visibility.diff b/debian/patches/41_disable_opengl_visibility.diff
new file mode 100644
index 0000000..51d6dbe
--- /dev/null
+++ b/debian/patches/41_disable_opengl_visibility.diff
@@ -0,0 +1,10 @@
+--- qt4-x11-4.3.1.orig/src/opengl/opengl.pro
++++ qt4-x11-4.3.1/src/opengl/opengl.pro
+@@ -5,6 +5,7 @@
+ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000
+ solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
+
++QMAKE_CXXFLAGS_HIDESYMS -= -fvisibility-inlines-hidden
+
+ include(../qbase.pri)
+
diff --git a/debian/patches/50_kfreebsd_build_fix.diff b/debian/patches/50_kfreebsd_build_fix.diff
new file mode 100644
index 0000000..52b2d70
--- /dev/null
+++ b/debian/patches/50_kfreebsd_build_fix.diff
@@ -0,0 +1,69 @@
+--- qt4-x11-4.3.1.orig/src/corelib/global/qglobal.h
++++ qt4-x11-4.3.1/src/corelib/global/qglobal.h
+@@ -125,6 +125,12 @@
+ # define Q_OS_RELIANT
+ #elif defined(__linux__) || defined(__linux)
+ # define Q_OS_LINUX
++# define Q_OS_GLIBC
++#elif defined(__GNU_HURD__) || defined(__GNU__)
++# define Q_OS_HURD
++# define Q_OS_GLIBC
++#elif defined(__GLIBC__)
++# define Q_OS_GLIBC
+ #elif defined(__FreeBSD__) || defined(__DragonFly__)
+ # define Q_OS_FREEBSD
+ # define Q_OS_BSD4
+@@ -145,8 +151,6 @@
+ # define Q_OS_AIX
+ #elif defined(__Lynx__)
+ # define Q_OS_LYNX
+-#elif defined(__GNU__)
+-# define Q_OS_HURD
+ #elif defined(__DGUX__)
+ # define Q_OS_DGUX
+ #elif defined(__QNXNTO__)
+--- qt4-x11-4.3.1.orig/src/corelib/plugin/qlibrary.cpp
++++ qt4-x11-4.3.1/src/corelib/plugin/qlibrary.cpp
+@@ -293,11 +293,11 @@
+
+ #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+
+-#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX)
++#if defined(Q_OS_FREEBSD) || defined(Q_OS_GLIBC)
+ # define USE_MMAP
+ # include <sys/types.h>
+ # include <sys/mman.h>
+-#endif // Q_OS_FREEBSD || Q_OS_LINUX
++#endif // Q_OS_FREEBSD || Q_OS_GLIBC
+
+ static long qt_find_pattern(const char *s, ulong s_len,
+ const char *pattern, ulong p_len)
+--- qt4-x11-4.3.1.orig/src/corelib/tools/qlocale.cpp
++++ qt4-x11-4.3.1/src/corelib/tools/qlocale.cpp
+@@ -63,7 +63,7 @@
+ #include <qdebug.h>
+ #include <time.h>
+
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+ # include <fenv.h>
+ #endif
+
+@@ -5930,7 +5930,7 @@
+ _control87(MCW_EM, MCW_EM);
+ #endif
+
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+ fenv_t envp;
+ feholdexcept(&envp);
+ #endif
+@@ -5946,7 +5946,7 @@
+ #endif //_M_X64
+ #endif //Q_OS_WIN
+
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_GLIBC) && !defined(__UCLIBC__)
+ fesetenv(&envp);
+ #endif
+
diff --git a/debian/patches/60_m68k_inotify_fix.diff b/debian/patches/60_m68k_inotify_fix.diff
new file mode 100644
index 0000000..956dd95
--- /dev/null
+++ b/debian/patches/60_m68k_inotify_fix.diff
@@ -0,0 +1,13 @@
+--- qt4-x11-4.3.1.orig/src/corelib/io/qfilesystemwatcher_inotify.cpp
++++ qt4-x11-4.3.1/src/corelib/io/qfilesystemwatcher_inotify.cpp
+@@ -103,6 +103,10 @@
+ # define __NR_inotify_init 269
+ # define __NR_inotify_add_watch 270
+ # define __NR_inotify_rm_watch 271
++#elif defined (__mc68000__)
++# define __NR_inotify_init 284
++# define __NR_inotify_add_watch 285
++# define __NR_inotify_rm_watch 286
+ #else
+ # error "This architecture is not supported. Please talk to qt-bugs@trolltech.com"
+ #endif
diff --git a/debian/patches/70_hppa_ldcw_fix.diff b/debian/patches/70_hppa_ldcw_fix.diff
new file mode 100644
index 0000000..d4f1680
--- /dev/null
+++ b/debian/patches/70_hppa_ldcw_fix.diff
@@ -0,0 +1,22 @@
+--- qt4-x11-4.3.1.orig/src/corelib/arch/parisc/q_ldcw.s
++++ qt4-x11-4.3.1/src/corelib/arch/parisc/q_ldcw.s
+@@ -1,17 +1,7 @@
+- .SPACE $PRIVATE$
+- .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+- .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+- .SPACE $TEXT$
+- .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+- .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+- .IMPORT $global$,DATA
+- .IMPORT $$dyncall,MILLICODE
+- .SPACE $TEXT$
+- .SUBSPA $CODE$
+-
++ .text
+ .align 4
+ .EXPORT q_ldcw,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR
+-q_ldcw
++ .label q_ldcw
+ .PROC
+ .CALLINFO FRAME=0,CALLS,SAVE_RP
+ .ENTRY
diff --git a/debian/patches/80_hurd_max_path.diff b/debian/patches/80_hurd_max_path.diff
new file mode 100644
index 0000000..3fa639c
--- /dev/null
+++ b/debian/patches/80_hurd_max_path.diff
@@ -0,0 +1,13 @@
+--- qt4-x11-4.3.1.orig/src/corelib/io/qfsfileengine_unix.cpp
++++ qt4-x11-4.3.1/src/corelib/io/qfsfileengine_unix.cpp
+@@ -55,6 +55,10 @@
+ # include <private/qcore_mac_p.h>
+ #endif
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ /*!
+ \internal
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..81dc3f6
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,31 @@
+# qt-copy patches
+0163-fix-gcc43-support.diff
+0167-fix-group-reading.diff
+0172-prefer-xrandr-over-xinerama.diff
+0175-fix-s390-qatomic.diff
+0176-coverity-fixes.diff
+0178-transparency-window-types.diff
+0179-transient-hack.diff
+0180-window-role.diff
+0181-qdnd-x11-fix.diff
+0182-argb-visuals-default.diff
+0185-fix-format-strings.diff
+0186-fix-component-alpha-text.diff
+0187-fix-font-fixed-pitch.diff
+
+# debian patches
+01_qmake_for_debian.diff
+02_launch_assistant-qt4.diff
+03_launch_moc-qt4.diff
+04_launch_uic-qt4.diff
+05_append_qt4_target.diff
+06_qtdemo_destdir.diff
+20_mips_atomic_ops.diff
+30_arm_ftbfs_fixes.diff
+31_arm_eabi_fix.diff
+40_alpha_ice.diff
+41_disable_opengl_visibility.diff
+50_kfreebsd_build_fix.diff
+60_m68k_inotify_fix.diff
+70_hppa_ldcw_fix.diff
+80_hurd_max_path.diff
diff --git a/debian/rules b/debian/rules
index e8fbec1..6460dca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@ export LD_LIBRARY_PATH := $(QTDIR)/lib:$(LD_LIBRARY_PATH)
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
-include /usr/share/cdbs/1/rules/dpatch.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/utils.mk
DEB_MAKE_INVOKE := $(MAKE)
@@ -97,9 +97,6 @@ clean::
-o -name Makefile.Release -print0 \
| xargs -0r rm -f
-# Hack to fix dpatch-edit-patch
-unpatch: deapply-dpatches
-
PKGCONFIGDIR := $(DEB_DESTDIR)/usr/lib/pkgconfig
common-install-arch::
# Fix wrong path in pkgconfig files