[mingw-qt5-qtdeclarative] Added -static subpackages (RHBZ #1123776)
Erik van Pienbroek
epienbro at fedoraproject.org
Wed Dec 31 10:05:02 UTC 2014
commit 854706d8add229c279777c0df23923e27bf6e4bc
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date: Wed Dec 31 11:05:03 2014 +0100
Added -static subpackages (RHBZ #1123776)
mingw-qt5-qtdeclarative.spec | 53 ++++++++++++++++++-
...arative-workaround-static-compile-failure.patch | 11 ++++
2 files changed, 61 insertions(+), 3 deletions(-)
---
diff --git a/mingw-qt5-qtdeclarative.spec b/mingw-qt5-qtdeclarative.spec
index 2005ec2..49876ab 100644
--- a/mingw-qt5-qtdeclarative.spec
+++ b/mingw-qt5-qtdeclarative.spec
@@ -44,6 +44,9 @@ Source0: http://download.qt-project.org/official_releases/qt/%{release_ve
# a shared library instead of a static library
Patch0: qt5-build-qmldevtools-as-shared-library.patch
+# Workaround a build failure when trying to perform a static build
+Patch1: qt5-qtdeclarative-workaround-static-compile-failure.patch
+
BuildRequires: mingw32-filesystem >= 96
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-qt5-qtbase >= 5.4.0
@@ -93,6 +96,14 @@ Requires: mingw32-qt5-qmldevtools = %{version}-%{release}
Contains the files required to get various Qt tools built
which are part of the mingw-qt5-qttools package
+%package -n mingw32-qt5-%{qt_module}-static
+Summary: Static version of the mingw32-qt5-qtdeclarative library
+Requires: mingw32-qt5-qtdeclarative = %{version}-%{release}
+BuildArch: noarch
+
+%description -n mingw32-qt5-%{qt_module}-static
+Static version of the mingw32-qt5-qtdeclarative library.
+
# Win64
%package -n mingw64-qt5-%{qt_module}
@@ -122,6 +133,14 @@ Requires: mingw64-qt5-qmldevtools = %{version}-%{release}
Contains the files required to get various Qt tools built
which are part of the mingw-qt5-qttools package
+%package -n mingw64-qt5-%{qt_module}-static
+Summary: Static version of the mingw64-qt5-qtdeclarative library
+Requires: mingw64-qt5-qtdeclarative = %{version}-%{release}
+BuildArch: noarch
+
+%description -n mingw64-qt5-%{qt_module}-static
+Static version of the mingw64-qt5-qtdeclarative library.
+
%?mingw_debug_package
@@ -129,15 +148,27 @@ which are part of the mingw-qt5-qttools package
%prep
%setup -q -n %{source_folder}
%patch0 -p1
+%patch1 -p1
%build
-%mingw_qmake_qt5 ../%{qt_module}.pro
-%mingw_make %{?_smp_mflags}
+MINGW_BUILDDIR_SUFFIX=_static %mingw_qmake_qt5 ../%{qt_module}.pro CONFIG+=static DEFINES+=QT_OPENGL_ES_2_ANGLE_STATIC
+MINGW_BUILDDIR_SUFFIX=_static %mingw_make %{?_smp_mflags}
+
+MINGW_BUILDDIR_SUFFIX=_shared %mingw_qmake_qt5 ../%{qt_module}.pro
+MINGW_BUILDDIR_SUFFIX=_shared %mingw_make %{?_smp_mflags}
%install
-%mingw_make install INSTALL_ROOT=$RPM_BUILD_ROOT
+MINGW_BUILDDIR_SUFFIX=_static %mingw_make install INSTALL_ROOT=$RPM_BUILD_ROOT/static
+MINGW_BUILDDIR_SUFFIX=_shared %mingw_make install INSTALL_ROOT=$RPM_BUILD_ROOT
+
+# 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}
+
+# Clean up the static trees as we've now merged all interesting pieces
+rm -rf $RPM_BUILD_ROOT/static
# .prl files aren't interesting for us
find $RPM_BUILD_ROOT -name "*.prl" -delete
@@ -233,6 +264,14 @@ find $RPM_BUILD_ROOT%{mingw64_datadir}/qt5 | grep .dll| sed s@"^$RPM_BUILD_ROOT"
%files -n mingw32-qt5-qmldevtools-devel
%{_prefix}/%{mingw32_target}/lib/libQt5QmlDevTools.so.5*
+%files -n mingw32-qt5-%{qt_module}-static
+%{mingw32_libdir}/libQt5Qml.a
+%{mingw32_libdir}/libQt5Quick.a
+%{mingw32_libdir}/libQt5QuickParticles.a
+%{mingw32_libdir}/libQt5QuickTest.a
+%{mingw32_libdir}/libQt5QuickWidgets.a
+
+
# Win64
%files -n mingw64-qt5-%{qt_module} -f mingw64-qt5-%{qt_module}.excludes
%{mingw64_bindir}/Qt5Qml.dll
@@ -301,10 +340,18 @@ find $RPM_BUILD_ROOT%{mingw64_datadir}/qt5 | grep .dll| sed s@"^$RPM_BUILD_ROOT"
%files -n mingw64-qt5-qmldevtools-devel
%{_prefix}/%{mingw64_target}/lib/libQt5QmlDevTools.so.5*
+%files -n mingw64-qt5-%{qt_module}-static
+%{mingw64_libdir}/libQt5Qml.a
+%{mingw64_libdir}/libQt5Quick.a
+%{mingw64_libdir}/libQt5QuickParticles.a
+%{mingw64_libdir}/libQt5QuickTest.a
+%{mingw64_libdir}/libQt5QuickWidgets.a
+
%changelog
* Mon Dec 29 2014 Erik van Pienbroek <epienbro at fedoraproject.org> - 5.4.0-1
- Update to 5.4.0
+- Added -static subpackages (RHBZ #1123776)
* Sat Sep 20 2014 Erik van Pienbroek <epienbro at fedoraproject.org> - 5.3.2-1
- Update to 5.3.2
diff --git a/qt5-qtdeclarative-workaround-static-compile-failure.patch b/qt5-qtdeclarative-workaround-static-compile-failure.patch
new file mode 100644
index 0000000..8e0a5f1
--- /dev/null
+++ b/qt5-qtdeclarative-workaround-static-compile-failure.patch
@@ -0,0 +1,11 @@
+--- qtdeclarative-opensource-src-5.4.0/src/qml/debugger/qqmldebugserver.cpp.orig 2014-12-30 22:32:49.618649782 +0100
++++ qtdeclarative-opensource-src-5.4.0/src/qml/debugger/qqmldebugserver.cpp 2014-12-30 22:32:58.162737785 +0100
+@@ -286,7 +286,7 @@
+ QQmlDebugServerInstanceWrapper *wrapper = debugServerInstance();
+ Q_ASSERT_X(wrapper != 0, Q_FUNC_INFO, "There should always be a debug server available here.");
+ QQmlDebugServer *server = &wrapper->m_instance;
+-#if defined(QT_STATIC) && ! defined(QT_QML_NO_DEBUGGER)
++#if defined(QT_STATIC) && ! defined(QT_QML_NO_DEBUGGER) && 0
+ QQmlDebugServerConnection *connection
+ = new QTcpServerConnection;
+ server->d_func()->connection = connection;
More information about the scm-commits
mailing list