[mingw32-qt/f15] Make QSSL work (patch from Dominik Schmidt)

Erik van Pienbroek epienbro at fedoraproject.org
Tue May 1 15:05:13 UTC 2012


commit 213c47c082112ba4634ebb1c2e027dec3d293e04
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Tue May 1 17:04:55 2012 +0200

    Make QSSL work (patch from Dominik Schmidt)

 mingw32-qt.spec                    |   17 ++++++++++++++++-
 qt-4.7.3-fix-loading-openssl.patch |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/mingw32-qt.spec b/mingw32-qt.spec
index 3069a13..480bc41 100644
--- a/mingw32-qt.spec
+++ b/mingw32-qt.spec
@@ -6,9 +6,12 @@
 
 %global platform win32-g++-cross
 
+# Helper macro to retrieve the name of the openssl library
+%global openssl_soname %(rpm -ql mingw32-openssl | grep -Eo 'libssl.*$' | grep -Eo '[0-9]+')
+
 Name:           mingw32-qt
 Version:        4.7.4
-Release:        1%{?pre}%{?dist}
+Release:        2%{?pre}%{?dist}
 Summary:        Qt for Windows
 
 License:        GPLv3 with exceptions or LGPLv2 with exceptions
@@ -30,6 +33,9 @@ Patch13:        qt-libjpeg-7-compatibility.patch
 # The debug build tries to link against libdbus-1d which doesn't exist
 Patch15:        qt-dbus-dont-link-to-dbus-1d.patch
 
+# Openssl is loaded at runtime
+Patch19:         qt-4.7.3-fix-loading-openssl.patch
+
 BuildArch:      noarch
 
 BuildRequires:  mingw32-filesystem >= 68
@@ -69,6 +75,12 @@ Fedora Windows cross-compiler.
 %patch11 -p1
 %patch13 -p0
 %patch15 -p0
+%patch19 -p1
+
+# Patch 19 (openssl) needs an additional change
+# qt loads openssl libraries (ssleay32, libeay32)  at runtime, but they are called libssl-OPENSSL_SONAME
+# and libcrypto-OPENSSL_SONAME in our cross build, so qt is patched to look for them additionally
+sed -i "s/OPENSSL_SONAME/%{openssl_soname}/" src/network/ssl/qsslsocket_openssl_symbols.cpp
 
 # Cross-compilation qmake target.
 mkdir mkspecs/%{platform}
@@ -324,6 +336,9 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/imports
 
 
 %changelog
+* Fri Apr 20 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.7.4-2
+- Make QSSL work (patch from Dominik Schmidt), RHBZ #813064
+
 * Sat Sep  3 2011 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.7.4-1
 - Update to 4.7.4
 
diff --git a/qt-4.7.3-fix-loading-openssl.patch b/qt-4.7.3-fix-loading-openssl.patch
new file mode 100644
index 0000000..26fb386
--- /dev/null
+++ b/qt-4.7.3-fix-loading-openssl.patch
@@ -0,0 +1,35 @@
+diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
+index a4cc3c4..5e052ac 100644
+--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
++++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
+@@ -369,14 +369,27 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
+     if (!ssleay32->load(false)) {
+         // Cannot find ssleay32.dll
+         delete ssleay32;
+-        return pair;
++        ssleay32 = new QSystemLibrary(QLatin1String("libssl-OPENSSL_SONAME"));
++        if (!ssleay32->load(false)) {
++            // Cannot find libssl-OPENSSL_SONAME.dll
++            // in our cross-build that's the same as ssleay32.dll
++            delete ssleay32;
++            return pair;
++        }
+     }
+
+     QSystemLibrary *libeay32 = new QSystemLibrary(QLatin1String("libeay32"));
+     if (!libeay32->load(false)) {
+-        delete ssleay32;
++        // Cannot find libeay32.dll
+         delete libeay32;
+-        return pair;
++        libeay32 = new QSystemLibrary(QLatin1String("libcrypto-OPENSSL_SONAME"));
++        if (!libeay32->load(false)) {
++            // Cannot find libcrypto-OPENSSL_SONAME.dll
++            // in our cross-build that's the same as libeay32.dll
++            delete libeay32;
++            delete ssleay32;
++            return pair;
++        }
+     }
+
+     pair.first = ssleay32;


More information about the scm-commits mailing list