[mingw-qt] Rewritten the merge-static-and-shared patch

Erik van Pienbroek epienbro at fedoraproject.org
Sat Aug 2 20:53:45 UTC 2014


commit 02fa37fbf19684e0a893ee451636653e3236c512
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sat Aug 2 00:04:02 2014 +0200

    Rewritten the merge-static-and-shared patch

 mingw-qt.spec                                      |   52 +++-
 ...-set-shared-config-flag-for-lib-templates.patch |    8 -
 qt-merge-static-and-shared-library-trees.patch     |  313 ++------------------
 qt4-fix-linking-against-static-dbus.patch          |   14 +
 4 files changed, 83 insertions(+), 304 deletions(-)
---
diff --git a/mingw-qt.spec b/mingw-qt.spec
index 8a8bcff..d4e08d3 100644
--- a/mingw-qt.spec
+++ b/mingw-qt.spec
@@ -14,7 +14,7 @@
 
 Name:           mingw-qt
 Version:        4.8.6
-Release:        3%{?pre}%{?dist}
+Release:        4%{?pre}%{?dist}
 Summary:        Qt for Windows
 
 License:        GPLv3 with exceptions or LGPLv2 with exceptions
@@ -34,6 +34,9 @@ Source3:        qplatformdefs.h
 # linking against the static version of Qt work without any manual fiddling
 Patch0:         qt-merge-static-and-shared-library-trees.patch
 
+# When linking against the static dbus library, the #define DBUS_EXPORT must be set
+Patch1:         qt4-fix-linking-against-static-dbus.patch
+
 # Disable WebKit tests that are failing (as of Qt 4.8.0 rc1) with
 # out of source builds.
 Patch10:        mingw32-qt-4.8.0-no-webkit-tests.patch
@@ -66,10 +69,6 @@ Patch23:        qt-4.8.1-fix-activeqt-compilation.patch
 # lrelease-qt4 tries to run qmake not qmake-qt4 (http://bugzilla.redhat.com/820767)
 Patch24:        qt-everywhere-opensource-src-4.8.1-linguist_qmake-qt4.patch
 
-# When qmake .pro files contain 'TEMPLATE=lib' then the 'CONFIG+=shared'
-# flag should be set automatically
-Patch27:        qt-automatically-set-shared-config-flag-for-lib-templates.patch
-
 # When building static binaries, make sure the gcc argument -DQT_DLL isn't used
 Patch28:        qt-dont-set-qt-dll-define-for-static-builds.patch
 
@@ -93,6 +92,16 @@ BuildRequires:  mingw32-sqlite
 BuildRequires:  mingw32-dbus
 BuildRequires:  mingw32-pkg-config
 
+BuildRequires:  mingw32-dbus-static
+BuildRequires:  mingw32-libjpeg-turbo-static
+BuildRequires:  mingw32-libtiff-static
+BuildRequires:  mingw32-libpng-static
+BuildRequires:  mingw32-sqlite-static
+BuildRequires:  mingw32-zlib-static
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+BuildRequires:  mingw32-winpthreads-static
+%endif
+
 BuildRequires:  mingw64-filesystem >= 95
 BuildRequires:  mingw64-gcc
 BuildRequires:  mingw64-gcc-c++
@@ -107,6 +116,16 @@ BuildRequires:  mingw64-sqlite
 BuildRequires:  mingw64-dbus
 BuildRequires:  mingw64-pkg-config
 
+BuildRequires:  mingw64-dbus-static
+BuildRequires:  mingw64-libjpeg-turbo-static
+BuildRequires:  mingw64-libtiff-static
+BuildRequires:  mingw64-libpng-static
+BuildRequires:  mingw64-sqlite-static
+BuildRequires:  mingw64-zlib-static
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+BuildRequires:  mingw64-winpthreads-static
+%endif
+
 BuildRequires:  zip
 BuildRequires:  dos2unix
 
@@ -151,10 +170,15 @@ Various tools belonging to the mingw32-qt library.
 %package -n mingw32-qt-static
 Summary:       Static version of the mingw32-qt library
 Requires:      mingw32-qt = %{version}-%{release}
+Requires:      mingw32-dbus-static
 Requires:      mingw32-libjpeg-turbo-static
 Requires:      mingw32-libtiff-static
 Requires:      mingw32-libpng-static
+Requires:      mingw32-sqlite-static
 Requires:      mingw32-zlib-static
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+Requires:      mingw32-winpthreads-static
+%endif
 BuildArch:     noarch
 
 %description -n mingw32-qt-static
@@ -192,10 +216,15 @@ Various tools belonging to the mingw32-qt library.
 %package -n mingw64-qt-static
 Summary:       Static version of the mingw64-qt library
 Requires:      mingw64-qt = %{version}-%{release}
+Requires:      mingw64-dbus-static
 Requires:      mingw64-libjpeg-turbo-static
 Requires:      mingw64-libtiff-static
 Requires:      mingw64-libpng-static
+Requires:      mingw64-sqlite-static
 Requires:      mingw64-zlib-static
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+Requires:      mingw64-winpthreads-static
+%endif
 BuildArch:     noarch
 
 %description -n mingw64-qt-static
@@ -208,6 +237,8 @@ Static version of the mingw64-qt library.
 %prep
 %setup -q -n qt-everywhere-opensource-src-%{version}
 
+%patch0 -p0
+%patch1 -p0 -b .dbus_static
 %patch10 -p1 -b .no_webkit_tests
 %patch17 -p0
 %patch19 -p1
@@ -216,7 +247,6 @@ Static version of the mingw64-qt library.
 %patch22 -p1
 %patch23 -p1
 %patch24 -p1 -b .linguist_qtmake-qt4
-%patch27 -p0 -b .lib_template
 %patch28 -p1 -b .qt_dll_define
 %patch29 -p1 -b .QTBUG-38367
 %patch30 -p1 -b .out_of_tree
@@ -423,12 +453,6 @@ for FN in $RPM_BUILD_ROOT%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}/
     mv $FN $FN_NEW
 done
 
-# Apply a patch which incorporates all the differences between
-# the static and the shared library build while staying compatible
-pushd $RPM_BUILD_ROOT
-patch -Np0 -i %{PATCH0}
-popd
-
 # Move the static libraries from the static tree to the main tree
 mv $RPM_BUILD_ROOT/static%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw32_libdir}
 mv $RPM_BUILD_ROOT/static%{mingw64_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}
@@ -1084,6 +1108,10 @@ sed -i s@'$${QT_LIBINFIX}d'@'d$${QT_LIBINFIX}'@ $RPM_BUILD_ROOT%{mingw64_datadir
 
 
 %changelog
+* Sat Aug 02 2014 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.8.6-4
+- Rewritten the merge-static-and-shared patch
+  Fixed FTBFS on environments where std::thread support is available
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.8.6-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/qt-merge-static-and-shared-library-trees.patch b/qt-merge-static-and-shared-library-trees.patch
index aa9eb63..cebbd1f 100644
--- a/qt-merge-static-and-shared-library-trees.patch
+++ b/qt-merge-static-and-shared-library-trees.patch
@@ -1,142 +1,10 @@
---- usr/i686-w64-mingw32/sys-root/mingw/include/QtCore/qconfig.h.orig	2011-12-25 21:03:37.022018831 +0100
-+++ usr/i686-w64-mingw32/sys-root/mingw/include/QtCore/qconfig.h	2011-12-25 21:13:50.704976445 +0100
-@@ -26,6 +26,14 @@
- 
- #ifndef QT_BOOTSTRAPPED
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_BUILTIN_GIF_READER) && defined(QT_NO_BUILTIN_GIF_READER)
-+# undef QT_BUILTIN_GIF_READER
-+#elif !defined(QT_BUILTIN_GIF_READER) && !defined(QT_NO_BUILTIN_GIF_READER)
-+# define QT_BUILTIN_GIF_READER 1
-+#endif
-+#endif
-+
- #if defined(QT_NO_ALSA) && defined(QT_ALSA)
- # undef QT_NO_ALSA
- #elif !defined(QT_NO_ALSA) && !defined(QT_ALSA)
-@@ -80,6 +88,7 @@
- # define QT_NO_ICD
- #endif
- 
-+#if !defined(QT_NODLL)
- #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG)
- # undef QT_NO_IMAGEFORMAT_JPEG
- #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG)
-@@ -97,6 +106,7 @@
- #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF)
- # define QT_NO_IMAGEFORMAT_TIFF
- #endif
-+#endif
- 
- #if defined(QT_NO_INOTIFY) && defined(QT_INOTIFY)
- # undef QT_NO_INOTIFY
-@@ -176,6 +186,14 @@
- # define QT_NO_SYSTEMSEMAPHORE
- #endif
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT)
-+# undef QT_NO_WEBKIT
-+#elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT)
-+# define QT_NO_WEBKIT
-+#endif
-+#endif
-+
- #if defined(QT_NO_ZLIB) && defined(QT_ZLIB)
- # undef QT_NO_ZLIB
- #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB)
---- usr/i686-w64-mingw32/sys-root/mingw/include/Qt/qconfig.h.orig	2011-12-25 21:03:13.349289762 +0100
-+++ usr/i686-w64-mingw32/sys-root/mingw/include/Qt/qconfig.h	2011-12-25 21:06:37.386579371 +0100
-@@ -26,6 +26,14 @@
- 
- #ifndef QT_BOOTSTRAPPED
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_BUILTIN_GIF_READER) && defined(QT_NO_BUILTIN_GIF_READER)
-+# undef QT_BUILTIN_GIF_READER
-+#elif !defined(QT_BUILTIN_GIF_READER) && !defined(QT_NO_BUILTIN_GIF_READER)
-+# define QT_BUILTIN_GIF_READER 1
-+#endif
-+#endif
-+
- #if defined(QT_NO_ALSA) && defined(QT_ALSA)
- # undef QT_NO_ALSA
- #elif !defined(QT_NO_ALSA) && !defined(QT_ALSA)
-@@ -80,6 +88,7 @@
- # define QT_NO_ICD
- #endif
- 
-+#if !defined(QT_NODLL)
- #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG)
- # undef QT_NO_IMAGEFORMAT_JPEG
- #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG)
-@@ -97,6 +106,7 @@
- #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF)
- # define QT_NO_IMAGEFORMAT_TIFF
- #endif
-+#endif
- 
- #if defined(QT_NO_INOTIFY) && defined(QT_INOTIFY)
- # undef QT_NO_INOTIFY
-@@ -176,6 +186,14 @@
- # define QT_NO_SYSTEMSEMAPHORE
- #endif
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT)
-+# undef QT_NO_WEBKIT
-+#elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT)
-+# define QT_NO_WEBKIT
-+#endif
-+#endif
-+
- #if defined(QT_NO_ZLIB) && defined(QT_ZLIB)
- # undef QT_NO_ZLIB
- #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB)
---- usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/qconfig.pri.orig	2011-12-25 21:09:01.616032758 +0100
-+++ usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/qconfig.pri	2011-12-25 21:12:14.685003350 +0100
-@@ -2,7 +2,11 @@
- CONFIG +=  cross_compile shared def_files_disabled exceptions rtti no_mocdepend release stl qt_no_framework
- QT_ARCH = windows
- QT_EDITION = OpenSource
--QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl shared ipv6 getaddrinfo system-jpeg system-png png system-tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
-+contains(CONFIG, static) {
-+   QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl static ipv6 getaddrinfo system-jpeg jpeg mng system-png png gif system-tiff tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
-+} else {
-+   QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl shared ipv6 getaddrinfo system-jpeg system-png png system-tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
-+}
- 
- #versioning
- QT_VERSION = 4.8.6
---- usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/win32/default_post.prf.orig	2011-12-26 02:29:56.365208473 +0100
-+++ usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/win32/default_post.prf	2011-12-26 02:31:03.650208601 +0100
-@@ -6,6 +6,10 @@
-     }
- }
- 
-+contains(CONFIG, static) {
-+    QMAKE_LFLAGS += -static
-+}
-+
- # Now load the global default_post
- load(default_post)
- 
---- usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/qt_functions.prf.orig	2011-12-26 21:24:32.448207664 +0100
-+++ usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/qt_functions.prf	2012-04-19 16:21:25.437111396 +0200
-@@ -71,7 +71,7 @@
-         export(TARGET.CAPABILITY)
-     }
-     isEmpty(LINKAGE) {
--       if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
-+       if(!debug_and_release|build_pass):!static:CONFIG(debug, debug|release) {
-            win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
-            mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
-        }
-@@ -83,6 +83,17 @@
+--- mkspecs/features/qt_functions.prf.orig	2014-08-01 23:54:20.441986402 +0200
++++ mkspecs/features/qt_functions.prf	2014-08-01 23:55:33.603172013 +0200
+@@ -83,6 +83,19 @@
          QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
      }
      LIBS += $$LINKAGE
++
 +    win32:CONFIG(static) {
 +        isEqual(LIB_NAME, QtCore) {
 +            LIBS += $$QMAKE_LIBS_CORE
@@ -148,159 +16,36 @@
 +            LIBS += $$QMAKE_LIBS_OPENGL
 +        }
 +    }
++
      export(LIBS)
      export(INCLUDEPATH)
      export(QMAKE_FRAMEWORKPATH)
---- usr/x86_64-w64-mingw32/sys-root/mingw/include/QtCore/qconfig.h.orig	2011-12-25 21:03:37.022018831 +0100
-+++ usr/x86_64-w64-mingw32/sys-root/mingw/include/QtCore/qconfig.h	2011-12-25 21:13:50.704976445 +0100
-@@ -26,6 +26,14 @@
- 
- #ifndef QT_BOOTSTRAPPED
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_BUILTIN_GIF_READER) && defined(QT_NO_BUILTIN_GIF_READER)
-+# undef QT_BUILTIN_GIF_READER
-+#elif !defined(QT_BUILTIN_GIF_READER) && !defined(QT_NO_BUILTIN_GIF_READER)
-+# define QT_BUILTIN_GIF_READER 1
-+#endif
-+#endif
-+
- #if defined(QT_NO_ALSA) && defined(QT_ALSA)
- # undef QT_NO_ALSA
- #elif !defined(QT_NO_ALSA) && !defined(QT_ALSA)
-@@ -80,6 +88,7 @@
- # define QT_NO_ICD
- #endif
- 
-+#if !defined(QT_NODLL)
- #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG)
- # undef QT_NO_IMAGEFORMAT_JPEG
- #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG)
-@@ -97,6 +106,7 @@
- #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF)
- # define QT_NO_IMAGEFORMAT_TIFF
- #endif
-+#endif
- 
- #if defined(QT_NO_INOTIFY) && defined(QT_INOTIFY)
- # undef QT_NO_INOTIFY
-@@ -176,6 +186,14 @@
- # define QT_NO_SYSTEMSEMAPHORE
- #endif
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT)
-+# undef QT_NO_WEBKIT
-+#elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT)
-+# define QT_NO_WEBKIT
-+#endif
-+#endif
-+
- #if defined(QT_NO_ZLIB) && defined(QT_ZLIB)
- # undef QT_NO_ZLIB
- #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB)
---- usr/x86_64-w64-mingw32/sys-root/mingw/include/Qt/qconfig.h.orig	2011-12-25 21:03:13.349289762 +0100
-+++ usr/x86_64-w64-mingw32/sys-root/mingw/include/Qt/qconfig.h	2011-12-25 21:06:37.386579371 +0100
-@@ -26,6 +26,14 @@
- 
- #ifndef QT_BOOTSTRAPPED
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_BUILTIN_GIF_READER) && defined(QT_NO_BUILTIN_GIF_READER)
-+# undef QT_BUILTIN_GIF_READER
-+#elif !defined(QT_BUILTIN_GIF_READER) && !defined(QT_NO_BUILTIN_GIF_READER)
-+# define QT_BUILTIN_GIF_READER 1
-+#endif
-+#endif
-+
- #if defined(QT_NO_ALSA) && defined(QT_ALSA)
- # undef QT_NO_ALSA
- #elif !defined(QT_NO_ALSA) && !defined(QT_ALSA)
-@@ -80,6 +88,7 @@
- # define QT_NO_ICD
- #endif
- 
-+#if !defined(QT_NODLL)
- #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG)
- # undef QT_NO_IMAGEFORMAT_JPEG
- #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG)
-@@ -97,6 +106,7 @@
- #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF)
- # define QT_NO_IMAGEFORMAT_TIFF
- #endif
-+#endif
- 
- #if defined(QT_NO_INOTIFY) && defined(QT_INOTIFY)
- # undef QT_NO_INOTIFY
-@@ -176,6 +186,14 @@
- # define QT_NO_SYSTEMSEMAPHORE
- #endif
- 
-+#if defined(QT_NODLL)
-+#if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT)
-+# undef QT_NO_WEBKIT
-+#elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT)
-+# define QT_NO_WEBKIT
-+#endif
-+#endif
-+
- #if defined(QT_NO_ZLIB) && defined(QT_ZLIB)
- # undef QT_NO_ZLIB
- #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB)
---- usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/qconfig.pri.orig	2011-12-25 21:09:01.616032758 +0100
-+++ usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/qconfig.pri	2011-12-25 21:12:14.685003350 +0100
-@@ -2,7 +2,11 @@
- CONFIG +=  cross_compile shared def_files_disabled exceptions rtti no_mocdepend release stl qt_no_framework
- QT_ARCH = windows
- QT_EDITION = OpenSource
--QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl shared ipv6 getaddrinfo system-jpeg system-png png system-tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
-+contains(CONFIG, static) {
-+   QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl static ipv6 getaddrinfo system-jpeg jpeg mng system-png png gif system-tiff tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
-+} else {
-+   QT_CONFIG +=  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl shared ipv6 getaddrinfo system-jpeg system-png png system-tiff no-freetype system-zlib iconv dbus dbus-linked openssl concurrent xmlpatterns multimedia audio-backend svg script scripttools declarative release
+--- mkspecs/features/default_post.prf.orig	2014-08-01 23:51:16.864011435 +0200
++++ mkspecs/features/default_post.prf	2014-08-01 23:51:29.830221559 +0200
+@@ -96,6 +96,11 @@
+ QMAKE_INCDIR += $$QMAKE_INCDIR_POST
+ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
+ 
++win32:contains(CONFIG, static) {
++    DEFINES += QT_STATIC
++    QMAKE_LFLAGS += -static
 +}
- 
- #versioning
- QT_VERSION = 4.8.6
---- usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/win32/default_post.prf.orig	2011-12-26 02:29:56.365208473 +0100
-+++ usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/win32/default_post.prf	2011-12-26 02:31:03.650208601 +0100
-@@ -6,6 +6,10 @@
-     }
- }
++
+ # Let every project have a standard GNU `check' target
+ !contains(QMAKE_EXTRA_TARGETS, check) {
+     # `make check' should iterate through all subdirs
+--- configure.orig	2012-12-10 23:51:02.920255366 +0100
++++ configure	2012-12-10 23:55:58.101753703 +0100
+@@ -6032,6 +6032,12 @@
+ QT_EDITION = $Edition
+ QT_CONFIG += $QT_CONFIG
  
 +contains(CONFIG, static) {
-+    QMAKE_LFLAGS += -static
++    CONFIG -= shared
++    QT_CONFIG += static jpeg gif
++    QT_CONFIG -= shared
 +}
 +
- # Now load the global default_post
- load(default_post)
- 
---- usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/qt_functions.prf.orig        2011-12-26 21:24:32.448207664 +0100
-+++ usr/x86_64-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/features/qt_functions.prf     2012-04-19 16:21:25.437111396 +0200
-@@ -71,7 +71,7 @@
-         export(TARGET.CAPABILITY)
-     }
-     isEmpty(LINKAGE) {
--       if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
-+       if(!debug_and_release|build_pass):!static:CONFIG(debug, debug|release) {
-            win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
-            mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
-        }
-@@ -83,6 +83,17 @@
-         QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
-     }
-     LIBS += $$LINKAGE
-+    win32:CONFIG(static) {
-+        isEqual(LIB_NAME, QtCore) {
-+            LIBS += $$QMAKE_LIBS_CORE
-+        } else:isEqual(LIB_NAME, QtGui) {
-+            LIBS += $$QMAKE_LIBS_GUI
-+        } else:isEqual(LIB_NAME, QtNetwork) {
-+            LIBS += $$QMAKE_LIBS_NETWORK
-+        } else:isEqual(LIB_NAME, QtOpenGL) {
-+            LIBS += $$QMAKE_LIBS_OPENGL
-+        }
-+    }
-     export(LIBS)
-     export(INCLUDEPATH)
-     export(QMAKE_FRAMEWORKPATH)
+ #versioning
+ QT_VERSION = $QT_VERSION
+ QT_MAJOR_VERSION = $QT_MAJOR_VERSION
diff --git a/qt4-fix-linking-against-static-dbus.patch b/qt4-fix-linking-against-static-dbus.patch
new file mode 100644
index 0000000..fe768ad
--- /dev/null
+++ b/qt4-fix-linking-against-static-dbus.patch
@@ -0,0 +1,14 @@
+--- src/dbus/qdbus_symbols_p.h.orig	2014-08-02 12:32:15.112000000 +0200
++++ src/dbus/qdbus_symbols_p.h	2014-08-02 12:33:33.286000000 +0200
+@@ -55,6 +55,11 @@
+ #define QDBUS_SYMBOLS_P_H
+ 
+ #include <QtCore/qglobal.h>
++
++#ifdef QT_STATIC
++#define DBUS_STATIC_BUILD
++#endif
++
+ #include <dbus/dbus.h>
+ 
+ #ifndef QT_NO_DBUS


More information about the scm-commits mailing list