File libQtWebKit4.spec of Package libQtWebKit4

#
# spec file for package libQtWebKit4
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Asterios Dramis <asterios.dramis@gmail.com>.
#
# 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/
#


Name:           libQtWebKit4
%define tar_version 2.3.4
%define qt_version 4.8.7
Version:        %{qt_version}+%{tar_version}
Release:        lp150.124.12
Summary:        Open source Web Browser engine based on Qt4
License:        LGPL-2.1+ and BSD-3-Clause and MPL-1.1 and GPL-2.0+
Group:          Development/Libraries/C and C++
Url:            http://trac.webkit.org/wiki/QtWebKit
Source:         http://download.kde.org/stable/qtwebkit-2.3/%{tar_version}/src/qtwebkit-%{tar_version}.tar.gz
Source1:        qwebview-%{qt_version}.tar.gz
Source99:       baselibs.conf
# PATCH-FIX-OPENSUSE webkit-qtwebkit-2.2-tp1-pluginpath.patch asterios.dramis@gmail.com -- Search /usr/lib{,64}/mozilla/plugins-wrapped for browser plugins too (taken from Fedora)
Patch0:         webkit-qtwebkit-2.2-tp1-pluginpath.patch
Patch1:         04_enable_debug_information.diff
# PATCH-FIX-OPENSUSE 03_hide_std_symbols.diff asterios.dramis@gmail.com -- Do not make the std:: symbols in webkit public (taken from Ubuntu)
Patch2:         03_hide_std_symbols.diff
# PATCH-FIX-OPENSUSE 02_add_nostrip_for_debug_packages.diff asterios.dramis@gmail.com -- Set CONFIG += nostrip to avoid stripping (taken from Ubuntu)
Patch3:         02_add_nostrip_for_debug_packages.diff
# PATCH-FIX-OPENSUSE defines_qt_webkit.diff asterios.dramis@gmail.com -- Defines QT_WEBKIT to display correctly documentation in Qt Creator Help plugin (taken from Ubuntu)
Patch4:         defines_qt_webkit.diff
Patch5:         do-not-force-optimization-level.diff
Patch6:         reduce-link-optimization.diff
Patch7:         libQtWebKit4-gcc47.patch
Patch8:         qwebview-buildfixes.diff
# PATCH-FIX-UPSTREAM hrvoje.senjan@gmail.com -- Call gst_object_ref_sink() on the playbin object to take ownership of it
Patch10:        MediaPlayerPrivateGStreamer-should-take-ownership-of-the-playbin.patch
# PATCH-FIX-UPSTREAM buffer-ranges.patch hrvoje.senjan@gmail.com -- Use different method for buffering with gstreamer 1.0
Patch11:        buffer-ranges.patch
# PATCH-FIX-UPSTREAM lowlevelinterpreter-bigendian.patch -- Fix LLInt for big endian, webkit#103128
Patch15:        lowlevelinterpreter-bigendian.patch
# PATCH-FIX-UPSTREAM fix-g++5-build.patch
Patch16:        fix-g++5-build.patch
BuildRequires:  bison
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  fontconfig-devel
BuildRequires:  gperf
BuildRequires:  libicu-devel
BuildRequires:  libqt4-devel
BuildRequires:  libwebp-devel
BuildRequires:  libxslt-devel
BuildRequires:  pcre-devel
BuildRequires:  perl
BuildRequires:  python-devel
BuildRequires:  python-xml
BuildRequires:  ruby
%if 0%{?suse_version} > 1140
BuildRequires:  perl-Switch
%endif
%if 0%{?suse_version} > 1120
%if 0%{?suse_version} > 1310
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-app-1.0)
BuildRequires:  pkgconfig(gstreamer-base-1.0)
BuildRequires:  pkgconfig(gstreamer-pbutils-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(gstreamer-video-1.0)
%else
BuildRequires:  pkgconfig(gstreamer-0.10)
BuildRequires:  pkgconfig(gstreamer-app-0.10)
BuildRequires:  pkgconfig(gstreamer-base-0.10)
BuildRequires:  pkgconfig(gstreamer-interfaces-0.10)
BuildRequires:  pkgconfig(gstreamer-pbutils-0.10)
BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
BuildRequires:  pkgconfig(gstreamer-video-0.10)
%endif
%endif
BuildRequires:  sqlite-devel
%requires_ge libqt4-x11
Provides:       qtwebkit = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
WebKit is an open source web browser engine. WebKit's HTML and JavaScript code
began as a branch of the KHTML and KJS libraries from KDE. As part of KDE
framework KHTML was based on Qt but during their porting efforts Apple's
engineers made WebKit toolkit independent. QtWebKit is a project aiming at
porting this fabulous engine back to Qt.

%package -n libQtWebKit-devel
Summary:        Development files for qtwebkit
Group:          Development/Libraries/C and C++
Requires:       libQtWebKit4 = %{version}
%requires_ge libqt4-devel

%description -n libQtWebKit-devel
This package contains development files for qtwebkit.

%prep
%setup -q -c -n qtwebkit-%{tar_version} -a 1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8
%if 0%{?suse_version} > 1310
%patch10 -p1
%patch11 -p1
%endif
%patch15 -p1
%patch16 -p1

%build
# runs out of memory or creates static archives > 2/4GB boundary otherwise
%ifarch %arm aarch64
RPM_OPT_FLAGS="$RPM_OPT_FLAGS "
export RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-g / }
%endif

%ifnarch x86_64
jitopts="DEFINES+=ENABLE_JIT=0 DEFINES+=ENABLE_YARR_JIT=0 DEFINES+=ENABLE_ASSEMBLER=0"
%else
jitopts=""
%endif

export QTDIR=%{_prefix}

Tools/Scripts/build-webkit \
  --qt \
  --makeargs="%{?_smp_mflags}" \
  --prefix=%{_prefix} \
  --no-webkit2 \
  --release \
%ifnarch x86_64
  --no-force-sse2 \
%endif
  --qmakearg="CONFIG+=production_build CONFIG+=use_system_icu QMAKE_CFLAGS+=\"${RPM_OPT_FLAGS} $(getconf LFS_CFLAGS) -Wno-extra\" QMAKE_CXXFLAGS+=\"${RPM_OPT_FLAGS} $(getconf LFS_CFLAGS) -Wno-extra\" QMAKE_LFLAGS+="-Wl,--as-needed" DEFINES+=USE_GSTREAMER=1 DEFINES+=HAVE_LIBWEBP=1 $jitopts"

pushd tools/designer/src/plugins/qwebview/
qmake
qmake \
      QMAKE_CXXFLAGS+="%{optflags}" \
      QMAKE_CFLAGS+="%{optflags}" \
      QMAKE_LFLAGS+="-Wl,--as-needed"
make
popd

%install
make INSTALL_ROOT=%{buildroot} -C WebKitBuild/Release install
make install INSTALL_ROOT=%{buildroot} -C tools/designer/src/plugins/qwebview
#
find %{buildroot}%{_libdir} -type f -name '*prl' -exec perl -pi -e "s, -L$RPM_BUILD_DIR/\S+,,g" {} \;
find %{buildroot}%{_libdir} -type f -name '*prl' -exec sed -i -e "/^QMAKE_PRL_BUILD_DIR/d" {} \;
find %{buildroot}%{_libdir} -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=/usr/bin/moc," -e "s,uic_location=.*,uic_location=/usr/bin/uic," {} \;

%fdupes -s %{buildroot}%{_includedir}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_libdir}/qt4/plugins/imports/QtWebKit/
%{_libdir}/libQtWebKit.so.4*
%{_libdir}/qt4/plugins/designer/libqwebview.so

%files -n libQtWebKit-devel
%defattr(-,root,root,-)
%doc ChangeLog
%{_includedir}/QtWebKit/
%{_libdir}/pkgconfig/QtWebKit.pc
%{_libdir}/libQtWebKit.prl
%{_libdir}/libQtWebKit.so
%dir %{_datadir}/qt4/mkspecs/modules
%{_datadir}/qt4/mkspecs/modules/qt_webkit.pri

%changelog
* Thu Nov 30 2017 dimstar@opensuse.org
- Unconditionally buildrequire python-xml: our build script makes
  use of it and we just can't rely on 3rd party packages to bring
  our dependencies (in the past, glib2-devel brought python-xml,
  but that package changed to python3 code).
* Mon Mar 20 2017 rguenther@suse.com
- Disable -Wextra due to noisy -Wexpansion_to_defined which is enabled
  with -Wextra starting with GCC 7.  Otherwise we run into
  "Logfile got too big, killed job.".
* Fri Sep  9 2016 mmarek@suse.cz
- Rebuild with a fixed flex package to fix a buffer overflow
  (bsc#990856, CVE-2016-6354).
* Sun Jul 26 2015 hrvoje.senjan@gmail.com
- Fix the suse_version check logic in the gstreamer BuildRequires
  in order to build with gst1.0 API on Leap
* Thu May 28 2015 dmueller@suse.com
- update for Qt 4.8.7
* Mon Apr 27 2015 hrvoje.senjan@gmail.com
- Add fix-g++5-build.patch from upstream
* Thu Sep 25 2014 hrvoje.senjan@gmail.com
- Update to 2.3.4:
  * Bugfix release
  * Incorporated GStreamer 1.0 support
- Drop gstreamer-1.0.diff, aarch64-support.patch, bison3.patch,
  ppc64le-support.patch, all merged upstream
* Wed Apr 30 2014 dmueller@suse.com
- build against Qt 4.8.6
* Sun Jan 26 2014 schwab@linux-m68k.org
- lowlevelinterpreter-bigendian.patch: fix LLInt for big endian (webkit#103128)
- Remove extra / from RPM_OPT_FLAGS
* Fri Dec 13 2013 uweigand@de.ibm.com
- ppc64le-support.patch: Add powerpc64le-linux support.
* Fri Nov  8 2013 dvaleev@suse.com
- Apply "WebCore workaround for QtWebkit: do not build with -g,
  but with -g1" for powerpc as well
  (04_enable_debug_information.diff)
* Thu Oct 24 2013 dmueller@suse.com
- Dinar wants ppc64 to be built with -g1
* Sat Oct 19 2013 dmueller@suse.com
- reduce memory consumption on ARM/AArch64 to fix build
* Sun Sep 29 2013 hrvoje.senjan@gmail.com
- Added bison3.patch, fixes compilation with bison3 (webkit#119798)
* Tue Sep 24 2013 alarrosa@suse.com
- Fix the license declaration in the spec file (bnc#739670)
* Tue Sep  3 2013 hrvoje.senjan@gmail.com
- Update to 2.3.3
  * Bugfix release
  * QtWebKit displays the border radii (radius) of a button very ugly
    (webkit#28113)
  * Resource leak related to gstreamer and videos (webkit#109350)
  * Fix minor memory leak in slot execution
  * Potential use-after-free with an event fired at a
    HTMLMediaElement which is currently being deleted (webkit#117466)
* Thu Aug 22 2013 hrvoje.senjan@gmail.com
- Dropped no-jit.patch, jit and assembler are now disabled on all
  arches except x86_64, and that's defined through DEFINE passed
  to build script as both require SSE2 instructions (bnc#837063)
- Export LDFLAGS -Wl,--as-needed for reduced linkage
- Added %%{optflags} to qwebview building
* Thu Aug 15 2013 toddrme2178@gmail.com
- Add Provides: qtwebkit since it is needed by some outside
  packages
* Wed Aug  7 2013 hrvoje.senjan@gmail.com
- Postpone gstreamer 1.0 support for next release since it breaks
  phonon's gstreamer 0.10 backend, and 1.0 version is not in sight
* Thu Aug  1 2013 speilicke@suse.com
- Buildrequire python-xml on SLE and libwebp everywhere
* Sat Jul 13 2013 hrvoje.senjan@gmail.com
- Update to 2.3.2
  * Bugfix release
  * Fix a crash in QtPixmapRuntime. (webkit#117193)
  * Fix a crash under ~PingLoader when the QNAM on the page has
    been destroyed. (webkit#116035)
  * Fix crash when loading link to audio file (webkit#15794)
  * Fix crash when calling QWebFrame::evaluateJavaScript
    (webkit#113434)
  * Assert in JSC::Heap::unprotect when closing facebook.com website
    (webkit#115058)
  * Add support for tiled shadow blur (webkit#90082)
  * Late-loading stylesheets can cause composited layers to be blank
    (webkit103773)
* Thu Jul  4 2013 nico.kruber@gmail.com
- fix missing plugins.pri in qwebview sources
* Wed Jul  3 2013 dmueller@suse.com
- update to qwebview from 4.8.5
* Fri Jun 21 2013 crrodriguez@opensuse.org
- build with large file support in 32 bit archs
* Mon May 13 2013 schwab@suse.de
- aarch64-support.diff: add support for aarch64
- no-jit.patch: no JIT on aarch64 and powerpc
* Tue Apr 30 2013 hrvoje.senjan@gmail.com
- Disable GStreamer 1.0 for 12.3, causes issues with e.g. Amarok
* Thu Apr 18 2013 hrvoje.senjan@gmail.com
- Update to version 2.3.1
  * Bugfix release
- Dropped libQtWebKit4-gcc48.patch, included upstream
* Sat Apr  6 2013 hrvoje.senjan@gmail.com
- Add libQtWebKit4-gcc48.patch, fixes build with GCC 4.8
- Tweak the patches, so it also saves memory on
  arm
* Tue Apr  2 2013 hrvoje.senjan@gmail.com
- Added buffer-ranges.patch, fixes buffering with gstreamer 1.0
  (webkit#105319)
  and MediaPlayerPrivateGStreamer-should-take-ownership-of-the-playbin.patch
  (webkit#107445)
* Sat Mar 30 2013 asterios.dramis@gmail.com
- Added libxslt-devel as build requirement (QtWebKit can use it to properly
  display xml files - see rh#919778).
- Enabled WebP support (added libwebp-devel as build requirement).
* Tue Mar 19 2013 idonmez@suse.com
- Enable GStreamer 1.0 for also openSUSE 12.3
* Sat Mar 16 2013 hrvoje.senjan@gmail.com
- Update to version 2.3.0 (bnc#769197)
  * Lots of performance improvements and reduced memory usage.
  * Incremental image loading by prefering WebKit image-decoders over
    Qt image decoders
  * Interface for automatic spell-checker
  * Better support for "BLOB" URLs
  * WebGL support
  * CSS shaders/filters support
  * CSS regions/exclusions support
- Add upstream patch for gstreamer 1.0 support, and enable it
  for >= 13.1
- Drop obsolete patches: avoid-rpath.diff, bison-26.diff,
  build-with-glib-231.diff, fix_infinite_loop_bwo97258.diff,
  0001_fix_symbols_visibility_for_webcore.diff and
  01_lflags_as-needed.diff
* Wed Feb  6 2013 cornelis@solcon.nl
- Removed webkit-qtwebkit-2.2tp1-qt46.patch to solve bnc#776525
* Wed Dec 19 2012 nico.kruber@gmail.com
- added patch to fix infinite loop with certain svg files
  see https://bugs.webkit.org/show_bug.cgi?id=97258
* Wed Dec  5 2012 stephan.binner@basyskom.com
- Sync with Qt 4.8.4
* Mon Nov 19 2012 cgiboudeaux@gmx.com
- Rediff reduce-link-optimization.diff. Needed by SLES
* Mon Nov  5 2012 dmueller@suse.com
- fix build against bison 2.6
* Wed Sep 19 2012 dmueller@suse.com
- Sync with Qt 4.8.3
* Mon Aug 13 2012 dmueller@suse.com
- reduce memory usage for arm
* Thu Jun  7 2012 dmueller@suse.com
- Sync with Qt 4.8.2
* Sat Apr 14 2012 dimstar@opensuse.org
- Add libQtWebKit4-gcc47.patch: Fix build with gcc 4.7. Patch taken
  from Fedora.
* Thu Apr  5 2012 dmueller@suse.com
- add back designer plugin (bnc#743937)
* Fri Mar 30 2012 idonmez@suse.com
- Sync with Qt 4.8.1
* Thu Feb  9 2012 dmueller@suse.de
- install qt_webkit_version.pri (bnc#746117)
* Fri Jan 20 2012 dmueller@suse.de
- fix build
* Mon Jan  2 2012 dmueller@suse.de
- fix license tags
- fix build with glib >= 2.31
* Fri Dec 16 2011 idonmez@suse.com
- Sync version with libqt4
* Wed Dec 14 2011 adrian@suse.de
- add patch to reduce memory usage during linking (ARM only)
* Mon Dec  5 2011 adrian@suse.de
- do not force fixed optimization level
* Mon Dec  5 2011 agraf@suse.com
- compile with -O1 on armv7 because of compiler bug
* Wed Nov 23 2011 cgiboudeaux@gmx.com
- Bump version to match the libqt4 one. Fixes the libqt4-devel-doc build
* Fri Oct  7 2011 coolo@suse.com
- remove self provides
* Thu Sep 29 2011 tittiatcoke@gmail.com
- Update to version 2.2.0
  See for more information:
    http://trac.webkit.org/wiki/QtWebKitRelease22
* Mon Sep 19 2011 asterios.dramis@gmail.com
- Update to version 2.2.0-rc1 (2.1.90).
- Removed kubuntu_fix_jit_warnings_i386.diff patch (fixed upstream).
* Mon Sep 12 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week35.
- Spec file updates:
  * Changed License: to LGPL-2.0 with exceptions or GPL-3.0 with exceptions.
  * Use "--release" istead of "--debug" for compilation.
  * Minor other updates.
- Removed the following patches:
  webkit-qtwebkit-type-casting.patch
  webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch
  webkit-qtwebkit-2.2-shared.patch
- Added the following patches (from Fedora and Ubuntu):
  webkit-qtwebkit-2.2-debuginfo.patch (disabled for now)
  0001_fix_symbols_visibility_for_webcore.diff
  01_lflags_as-needed.diff
  02_add_nostrip_for_debug_packages.diff
  03_hide_std_symbols.diff
  04_enable_debug_information.diff
  defines_qt_webkit.diff
  kubuntu_fix_jit_warnings_i386.diff
- Disabled (for now) the following patch:
  webkit-qtwebkit-2.2-no_Werror.patch
* Sun Sep  4 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week34.
* Wed Aug 24 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week33.
* Tue Aug  9 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week31.
* Sat Aug  6 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week30.
* Mon Jul 25 2011 asterios.dramis@gmail.com
- Update to version 2.1.80.week28.
- Spec file updates:
  * Compile the package with gstreamer support.
* Fri Jul  1 2011 asterios.dramis@gmail.com
- Rebased webkit-qtwebkit-type-casting.patch to apply cleanly.
* Thu Jun 30 2011 asterios.dramis@gmail.com
- Update to version 2.2-beta1 (2.1.80).
* Wed Jun 29 2011 asterios.dramis@gmail.com
- Spec file updates:
  * Added qt-mobility-devel in BuildRequires: (for audio/video tags support).
* Wed Jun 22 2011 asterios.dramis@gmail.com
- Spec file updates:
  * Don't install qt_webkit_version.pri (conflicts with libqt4-devel).
* Sun Jun 19 2011 asterios.dramis@gmail.com
- Spec file updates:
  * perl-Switch in BuildRequires: is needed only for openSUSE > 11.4.
* Sun Jun 19 2011 asterios.dramis@gmail.com
- Initial version 2.1.70.git.20110619
openSUSE Build Service is sponsored by