File mingw32-libqt5-qtwebkit.spec of Package mingw32-libqt5-qtwebkit

#
# spec file for package mingw32-libqt5-qtwebkit
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
%define __os_install_post %{_mingw32_debug_install_post} \
                          %{_mingw32_install_post}
%global qt_module qtwebkit
# first two digits of version
%global release_version %(echo %{version} | awk -F. '{print $1"."$2}')
%if 0%{?snapshot_date}
%global source_folder qt-%{qt_module}
%else
%global source_folder %{qt_module}-opensource-src-%{version}%{?pre:-%pre}
%endif
Name:           mingw32-libqt5-%{qt_module}
Version:        5.2.1
Release:        0
Summary:        Qt5 for Windows - QtWebKit component
License:        GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
Group:          Development/Libraries
Url:            http://qt-project.org/
Source0:        %{source_folder}.tar.xz
# The ICU libraries used for cross-compilation are named exactly the same as their native Linux counterpart
Patch0:         qt5-qtwebkit-use-correct-icu-libs.patch
# By default the build system assumes that pkg-config isn't used for the win32 target
# However, we're using it in the Fedora MinGW toolchain so make sure it is used automatically
Patch2:         qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch
# Make sure the bundled copy of the ANGLE library isn't used
Patch3:         qtwebkit-dont-use-bundled-angle-libraries.patch
# WebKit svn commit 136242 implemented a split into QtWebKit and QtWebKitWidgets
# Due to this change a static library named WebKit1.a is created first.
# After this a shared library is created named Qt5WebKit.dll which contains
# the contents of this static library and some other object files.
# However, various symbols in the static library are expected to be exported
# in the Qt5WebKit.dll shared library. As static libraries normally don't care
# about exported symbols (everything is exported after all) the decoration
# attribute Q_DECL_EXPORT won't be set.
# This results in undefined references when trying to link the QtWebKitWidgets
# shared library (which depends on various symbols which aren't exported properly
# in the Qt5WebKit.dll shared library)
Patch6:         qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch
# Fix detection of native tools which started to fail as of QtWebkit 5.1.0
# Caused by upstream commit 150223, so revert it for now
Patch9:         changeset-150223.patch
# smaller debuginfo s/-g/-g1/ (debian uses -gstabs) to avoid 4gb size limit
Patch10:        qtwebkit-opensource-src-5.0.1-debuginfo.patch
Patch1000:      mingw32-libqt5-qtwebkit-rpmlintrc
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gperf
BuildRequires:  mingw32-angleproject-devel
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-libqt5-qmake
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-filesystem >= 96
BuildRequires:  mingw32-fontconfig-devel
BuildRequires:  mingw32-gcc-c++
BuildRequires:  mingw32-libicu-devel
BuildRequires:  mingw32-libjpeg-devel
BuildRequires:  mingw32-libpng-devel
BuildRequires:  mingw32-libqt5-qmldevtools
BuildRequires:  mingw32-libqt5-qtbase
BuildRequires:  mingw32-libqt5-qtbase-devel
BuildRequires:  mingw32-libqt5-qtmultimedia
BuildRequires:  mingw32-libqt5-qtsensors-devel
BuildRequires:  mingw32-libqt5-qtxmlpatterns
BuildRequires:  mingw32-libqt5-qtxmlpatterns-devel
BuildRequires:  mingw32-libwebp-devel
BuildRequires:  mingw32-libxml2-devel
BuildRequires:  mingw32-libxslt-devel
BuildRequires:  mingw32-pcre-devel
BuildRequires:  mingw32-sqlite
BuildRequires:  mingw32-sqlite-devel
BuildRequires:  mingw32-zlib-devel
BuildRequires:  perl
BuildRequires:  python
BuildRequires:  ruby
BuildRequires:  xz

%description
This package contains the Qt software toolkit for developing
cross-platform applications.

This is the Windows version of Qt, for use in conjunction with the
Fedora Windows cross-compiler.

%_mingw32_debug_package

%prep
%setup -q -n %{source_folder}
%patch0
%patch2
%patch3 -p1
%patch6
%patch9 -p1 -R
%patch10 -p1

%build
mingw32-qmake-qt5 WebKit.pro
%{_mingw32_make} %{?_smp_mflags}
sleep 5

%install
%{_mingw32_make} install INSTALL_ROOT=%{buildroot}

# .prl files aren't interesting for us
find %{buildroot} -name "*.prl" -delete

# The .dll's are installed in both %%{_mingw32_bindir} and %%{_mingw32_libdir}
# One copy of the .dll's is sufficient
rm -f %{buildroot}%{_mingw32_libdir}/*.dll

# The QtWebProcess executable is placed in the wrong folder, move it manually
mv %{buildroot}%{_mingw32_datadir}/qt5/bin/QtWebProcess.exe %{buildroot}%{_mingw32_bindir}/

%files
%defattr(-, root, root)
%doc Source/WebCore/LICENSE*
%doc VERSION
%{_mingw32_bindir}/QtWebProcess.exe
%{_mingw32_bindir}/Qt5WebKit.dll
%{_mingw32_bindir}/Qt5WebKitWidgets.dll
%{_mingw32_includedir}/qt5/QtWebKit/
%{_mingw32_includedir}/qt5/QtWebKitWidgets/
%{_mingw32_libdir}/libQt5WebKit.dll.a
%{_mingw32_libdir}/libQt5WebKitWidgets.dll.a
%{_mingw32_libdir}/cmake/Qt5WebKit/
%{_mingw32_libdir}/cmake/Qt5WebKitWidgets/
%{_mingw32_libdir}/pkgconfig/Qt5WebKit.pc
%{_mingw32_libdir}/pkgconfig/Qt5WebKitWidgets.pc
# Caution: the directory pull below must not include debug files:
# /usr/i686-w64-mingw32/sys-root/mingw/share/qt5/qml/QtWebKit/experimental/qmlwebkitexperimentalplugin.dll.debug
# /usr/i686-w64-mingw32/sys-root/mingw/share/qt5/qml/QtWebKit/qmlwebkitplugin.dll.debug
%exclude %{_mingw32_datadir}/qt5/qml/QtWebKit/experimental/*.debug
%exclude %{_mingw32_datadir}/qt5/qml/QtWebKit/*.debug
%{_mingw32_datadir}/qt5/qml/QtWebKit/
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_webkit.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_webkit_private.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri
%{_mingw32_datadir}/qt5/mkspecs/modules/qt_lib_webkitwidgets_private.pri

%changelog
openSUSE Build Service is sponsored by