File libQtWebKit4.spec of Package libQtWebKit4

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

# disable LTO because of build errors e.g.
# undefined reference to `llint_throw_from_native_call'
# see
%define _lto_cflags %{nil}

Name:           libQtWebKit4
%define tar_version 2.3.4
%define qt_version 4.8.7
Version:        %{qt_version}+%{tar_version}
Release:        0
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++
Source1:        qwebview-%{qt_version}.tar.gz
Source99:       baselibs.conf
# PATCH-FIX-OPENSUSE webkit-qtwebkit-2.2-tp1-pluginpath.patch -- 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 -- 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 -- Set CONFIG += nostrip to avoid stripping (taken from Ubuntu)
Patch3:         02_add_nostrip_for_debug_packages.diff
# PATCH-FIX-OPENSUSE defines_qt_webkit.diff -- 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 -- 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 -- 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
Patch17:        0001-fix-building-with-bison-3.7.patch
Patch18:        0001-Remove-invalid-g_object-declarations-to-fix-build-wi.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
%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)
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)
BuildRequires:  sqlite-devel
%requires_ge libqt4-x11
Provides:       qtwebkit = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

%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
%if 0%{?suse_version} > 1310
%patch10 -p1
%patch11 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1

# runs out of memory or creates static archives > 2/4GB boundary otherwise
%ifarch %arm aarch64

%ifnarch x86_64

export QTDIR=%{_prefix}

Tools/Scripts/build-webkit \
  --qt \
  --makeargs="%{?_smp_mflags}" \
  --prefix=%{_prefix} \
  --no-webkit2 \
  --release \
%ifnarch x86_64
  --no-force-sse2 \
  --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_CXXFLAGS+="%{optflags}" \
      QMAKE_CFLAGS+="%{optflags}" \

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 -n libQtWebKit-devel
%doc ChangeLog
%dir %{_datadir}/qt4/mkspecs/modules

openSUSE Build Service is sponsored by