From f1d9deaa4fc1d1d7dba8558e179c52c8287ba992 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 9 May 2015 06:14:15 +0200 Subject: [PATCH] qt: portability fixes from Alpine; remove unused stuff. --- .../qsettings-recursive-global-mutex.patch | 17 ++++++ srcpkgs/qt/patches/qt-clucene-timeb.patch | 17 ++++++ srcpkgs/qt/patches/qt-gtk-theme-fix.patch | 59 +++++++++++++++++++ srcpkgs/qt/patches/qt-musl-iconv-no-bom.patch | 11 ++++ srcpkgs/qt/patches/qt-musl.patch | 14 +++++ srcpkgs/qt/template | 5 +- 6 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/qt/patches/qsettings-recursive-global-mutex.patch create mode 100644 srcpkgs/qt/patches/qt-clucene-timeb.patch create mode 100644 srcpkgs/qt/patches/qt-gtk-theme-fix.patch create mode 100644 srcpkgs/qt/patches/qt-musl-iconv-no-bom.patch create mode 100644 srcpkgs/qt/patches/qt-musl.patch diff --git a/srcpkgs/qt/patches/qsettings-recursive-global-mutex.patch b/srcpkgs/qt/patches/qsettings-recursive-global-mutex.patch new file mode 100644 index 00000000000..8c66b7a9fa6 --- /dev/null +++ b/srcpkgs/qt/patches/qsettings-recursive-global-mutex.patch @@ -0,0 +1,17 @@ +Calling qsettings before constructing qapplications causes a dead-lock. + +http://sourceforge.net/tracker/?func=detail&aid=3168620&group_id=4932&atid=104932 +http://developer.qt.nokia.com/forums/viewthread/10365 + + +--- a/src/corelib/io/qsettings.cpp.orig ++++ b/src/corelib/io/qsettings.cpp +@@ -122,7 +122,7 @@ + Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc) + Q_GLOBAL_STATIC(PathHash, pathHashFunc) + Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc) +-Q_GLOBAL_STATIC(QMutex, globalMutex) ++Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive)) + static QSettings::Format globalDefaultFormat = QSettings::NativeFormat; + + #ifndef Q_OS_WIN diff --git a/srcpkgs/qt/patches/qt-clucene-timeb.patch b/srcpkgs/qt/patches/qt-clucene-timeb.patch new file mode 100644 index 00000000000..e3f478fc631 --- /dev/null +++ b/srcpkgs/qt/patches/qt-clucene-timeb.patch @@ -0,0 +1,17 @@ +--- a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp.orig ++++ b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp +@@ -20,11 +20,11 @@ + # endif + #endif + +-#ifdef _CL_HAVE_SYS_TIMEB_H ++#ifndef UNDER_CE ++#ifdef _defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) || defined(__BORLANDC__) + # include + #endif +- +-#ifdef UNDER_CE ++#else + #include + #endif + diff --git a/srcpkgs/qt/patches/qt-gtk-theme-fix.patch b/srcpkgs/qt/patches/qt-gtk-theme-fix.patch new file mode 100644 index 00000000000..ee2045ac502 --- /dev/null +++ b/srcpkgs/qt/patches/qt-gtk-theme-fix.patch @@ -0,0 +1,59 @@ +Author: Timo Teräs + +Fix QT GTK style to use GTK API to get the active theme name. This fixes +things for non-GNOME setups, as well as realtime theme change detection. + +It still tries to detect if GTK-Qt is in use and refuse to run with that +as it would cause obvious recursion, however that might be not always +possible. + +--- a/src/gui/styles/qgtkstyle_p.cpp 2013-06-07 05:16:59.000000000 +0000 ++++ b/src/gui/styles/qgtkstyle_p.cpp 2013-09-25 16:37:34.703506640 +0000 +@@ -505,7 +505,7 @@ void QGtkStylePrivate::initGtkWidgets() + + static QString themeName; + if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) { +- themeName = getThemeName(); ++ themeName = getThemeNameGuess(); + + if (themeName == QLS("Qt") || themeName == QLS("Qt4")) { + // Due to namespace conflicts with Qt3 and obvious recursion with Qt4, +@@ -648,7 +648,7 @@ bool QGtkStylePrivate::getGConfBool(cons + return retVal; + } + +-QString QGtkStylePrivate::getThemeName() ++QString QGtkStylePrivate::getThemeNameGuess() + { + QString themeName; + // We try to parse the gtkrc file first +@@ -685,6 +685,19 @@ QString QGtkStylePrivate::getThemeName() + + return themeName; + } ++ ++QString QGtkStylePrivate::getThemeName() ++{ ++ QString themeName; ++ gchar *theme_name; ++ ++ GtkSettings *settings = gtk_settings_get_default(); ++ g_object_get(settings, "gtk-theme-name", &theme_name, NULL); ++ themeName = QString::fromUtf8(theme_name); ++ g_free(theme_name); ++ ++ return themeName; ++} + + // Get size of the arrow controls in a GtkSpinButton + int QGtkStylePrivate::getSpinboxArrowSize() const +--- a/src/gui/styles/qgtkstyle_p.h 2013-06-07 05:16:59.000000000 +0000 ++++ b/src/gui/styles/qgtkstyle_p.h 2013-09-25 16:29:11.310167033 +0000 +@@ -338,6 +338,7 @@ public: + static bool getGConfBool(const QString &key, bool fallback = 0); + static QString getGConfString(const QString &key, const QString &fallback = QString()); + ++ static QString getThemeNameGuess(); + static QString getThemeName(); + virtual int getSpinboxArrowSize() const; + diff --git a/srcpkgs/qt/patches/qt-musl-iconv-no-bom.patch b/srcpkgs/qt/patches/qt-musl-iconv-no-bom.patch new file mode 100644 index 00000000000..35380ad6714 --- /dev/null +++ b/srcpkgs/qt/patches/qt-musl-iconv-no-bom.patch @@ -0,0 +1,11 @@ +--- qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp.orig ++++ qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp +@@ -62,7 +62,7 @@ + #elif defined(Q_OS_AIX) + # define NO_BOM + # define UTF16 "UCS-2" +-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) ++#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__)) + # define NO_BOM + # if Q_BYTE_ORDER == Q_BIG_ENDIAN + # define UTF16 "UTF-16BE" diff --git a/srcpkgs/qt/patches/qt-musl.patch b/srcpkgs/qt/patches/qt-musl.patch new file mode 100644 index 00000000000..90b9ccda08c --- /dev/null +++ b/srcpkgs/qt/patches/qt-musl.patch @@ -0,0 +1,14 @@ +--- qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h.orig ++++ qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h +@@ -86,11 +86,7 @@ + + #undef QT_SOCKLEN_T + +-#if defined(__GLIBC__) && (__GLIBC__ >= 2) + #define QT_SOCKLEN_T socklen_t +-#else +-#define QT_SOCKLEN_T int +-#endif + + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) + #define QT_SNPRINTF ::snprintf diff --git a/srcpkgs/qt/template b/srcpkgs/qt/template index dee29fb4013..6a3b7e65b20 100644 --- a/srcpkgs/qt/template +++ b/srcpkgs/qt/template @@ -1,7 +1,7 @@ # Template file for 'qt' pkgname=qt version=4.8.6 -revision=13 +revision=14 _distname=qt-everywhere-opensource-src patch_args="-Np1" wrksrc=${_distname}-${version} @@ -80,6 +80,9 @@ do_install() { for f in ${DESTDIR}/usr/lib/qt/bin/*; do ln -s /usr/lib/qt/bin/$(basename $f) ${DESTDIR}/usr/bin/$(basename $f)-qt4 done + + # Remove wrong stuff + rm -rf ${DESTDIR}/usr/{examples,demos} } qt-doc_package() {