[mingw-qt] Merge the static patches

Erik van Pienbroek epienbro at fedoraproject.org
Thu Apr 19 17:26:40 UTC 2012


commit 4bb83b8162f71e1fc56a558725fd6b3bfb27e5a5
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Thu Apr 19 19:24:02 2012 +0200

    Merge the static patches
    
    It turned out the mkspecs changes break the regular
    build, so apply the patch after the build has completed

 mingw-qt.spec                                  |    9 +--
 qt-make-linking-against-static-qt-work.patch   |   42 ------------
 qt-merge-static-and-shared-library-trees.patch |   84 ++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 48 deletions(-)
---
diff --git a/mingw-qt.spec b/mingw-qt.spec
index c0c6210..019ae70 100644
--- a/mingw-qt.spec
+++ b/mingw-qt.spec
@@ -29,7 +29,9 @@ Source2:        qmake.conf.win64
 Source3:        qplatformdefs.h
 
 # When building Qt as static library some files have a different content
-# when compared to the static library. Merge those changes manually
+# when compared to the static library. Merge those changes manually.
+# This patch also applies some additional changes which are required to make
+# linking against the static version of Qt work without any manual fiddling
 Patch0:         qt-merge-static-and-shared-library-trees.patch
 
 # Disable WebKit tests that are failing (as of Qt 4.8.0 rc1) with
@@ -66,10 +68,6 @@ Patch22:        qt-fix-javascript-jit-on-mingw-x86_64.patch
 # Workaround this for now until a proper fix has been found
 Patch23:        qt-4.8.1-fix-activeqt-compilation.patch
 
-# Some additional changes are required to make linking against
-# the static version of Qt work without any manual fiddling
-Patch24:        qt-make-linking-against-static-qt-work.patch
-
 BuildRequires:  mingw32-filesystem >= 95
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-gcc-c++
@@ -200,7 +198,6 @@ Static version of the mingw64-qt library.
 %patch21 -p1
 %patch22 -p1
 %patch23 -p1
-%patch24 -p0
 
 # Patch 19 (openssl) needs an additional change
 # qt loads openssl libraries (ssleay32, libeay32)  at runtime, but they are called libssl-OPENSSL_SONAME
diff --git a/qt-merge-static-and-shared-library-trees.patch b/qt-merge-static-and-shared-library-trees.patch
index 02cc3d3..6f55722 100644
--- a/qt-merge-static-and-shared-library-trees.patch
+++ b/qt-merge-static-and-shared-library-trees.patch
@@ -109,6 +109,48 @@
  
  #versioning
  QT_VERSION = 4.8.1
+--- 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 @@
+         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)
 --- 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 @@
@@ -220,3 +262,45 @@
  
  #versioning
  QT_VERSION = 4.8.1
+--- 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 @@
+     }
+ }
+ 
++contains(CONFIG, static) {
++    QMAKE_LFLAGS += -static
++}
++
+ # 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)


More information about the scm-commits mailing list