File libwebkit3.spec of Package libwebkit
#
# spec file for package libwebkit3
#
# Copyright (c) 2013 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 build_for_gtk3 1
%if %{build_for_gtk3}
%define _pkgname_no_slpp libwebkitgtk3
%define _sover -3_0-0
%define _wk2sover -3_0-18
%define _sonamever 3.0
%define _sonameverpkg 3_0
%define _develnamever 3
%define _gtkver 3.0
%define _jscver 3
%define _pkgconfig_suffix gtk-3.0
%define _withwk2 1
%else
%define _pkgname_no_slpp libwebkitgtk2
%define _sover -1_0-0
%define _sonamever 1.0
%define _sonameverpkg 1_0
%define _withwk2 0
# empty:
#%%define _develnamever
%define _gtkver 2.0
%define _jscver 1
%define _pkgconfig_suffix -1.0
%endif
Name: libwebkit3
Summary: Library for rendering web content, GTK+ Port
License: LGPL-2.0 and LGPL-2.0+
Group: Development/Libraries/C and C++
Version: 1.10.2
Release: 0
# FIXME: at some point, figure out a way to remove the hack where we use -g0 to have successful builds
# FIXME: get upstream to fix the conflict on gtk-doc docs between gtk2 and gtk3 versions
# FIXME: after 1.7.90, remove workaround in %%setup that is needed to fix the build
Url: http://webkitgtk.org/
Source: http://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM webkit-gir-fixup.patch dimstar@opensuse.org -- Fix JSCore.gir to reference a real library.
Patch0: webkit-gir-fixup.patch
# PATCH-FIX-OPENSUSE webkit-ld-optimization.patch vuntz@opensuse.org -- Add ld options to use less memory when linking, should help building on OBS, but this will be slower
Patch2: webkit-ld-optimization.patch
# PATCH-FIX-UPSTREAM webkit-shm_unlink-moved-to-librt.patch webkit#104118 dimstar@opensuse.org -- shm_unlink moved to librt with glibc 2.17
Patch3: webkit-shm_unlink-moved-to-librt.patch
BuildRequires: Mesa-devel
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: gobject-introspection-devel >= 0.9.5
BuildRequires: gperf
BuildRequires: gtk-doc
BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
# Needed for patch3
BuildRequires: libtool
BuildRequires: perl
BuildRequires: python
BuildRequires: ruby
# Needed by make-hash-tools.pl, after move to perl 5.14
BuildRequires: perl(Switch)
BuildRequires: pkgconfig(atspi-2) >= 2.2.1
BuildRequires: pkgconfig(cairo) >= 1.10
BuildRequires: pkgconfig(cairo-ft)
BuildRequires: pkgconfig(enchant) >= 0.22
BuildRequires: pkgconfig(fontconfig) >= 2.4
BuildRequires: pkgconfig(freetype2) >= 9.0
%if %{build_for_gtk3}
# yes, needed for the plugin process even though we're targetting gtk3
BuildRequires: pkgconfig(gail) >= 1.8
BuildRequires: pkgconfig(gail-3.0) >= 3.0
BuildRequires: pkgconfig(gtk+-2.0) >= 2.10
BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0
BuildRequires: pkgconfig(gtk+-unix-print-3.0)
%else
BuildRequires: pkgconfig(gail) >= 1.8
BuildRequires: pkgconfig(gtk+-2.0) >= 2.10
%endif
BuildRequires: pkgconfig(geoclue)
BuildRequires: pkgconfig(glib-2.0) >= 2.32.0
BuildRequires: pkgconfig(gstreamer-1.0) >= 0.11.90
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) >= 0.11.90
BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libsoup-2.4) >= 2.39.2
BuildRequires: pkgconfig(libxml-2.0) >= 2.6
BuildRequires: pkgconfig(libxslt) >= 1.1.7
BuildRequires: pkgconfig(pango) >= 1.21.0
BuildRequires: pkgconfig(pangoft2)
BuildRequires: pkgconfig(sqlite3) >= 3.0
BuildRequires: pkgconfig(xcomposite)
BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(xrender)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(zlib)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%package -n libwebkitgtk%{_sover}
Summary: Library for rendering web content, GTK+ Port
Group: Development/Libraries/C and C++
%if ! %{build_for_gtk3}
Provides: libWebKitGtk0 = %{version}
Obsoletes: libWebKitGtk0 < %{version}
%endif
# We provide %{_pkgname_no_slpp}: that's the GTK+ version being used.
Provides: %{_pkgname_no_slpp} = %{version}
Recommends: %{_pkgname_no_slpp}-lang = %{version}
%description -n libwebkitgtk%{_sover}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%if %{_withwk2}
%package -n libwebkit2gtk%{_wk2sover}
Summary: Library for rendering web content, GTK+ Port
Group: System/Libraries
# this will install the non-webkit2 library too; at some point, we should move
# the Provides for %%{_pkgname_no_slpp} here
Recommends: %{_pkgname_no_slpp}-lang = %{version}
%description -n libwebkit2gtk%{_wk2sover}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%endif
%package -n libjavascriptcoregtk%{_sover}
Summary: JavaScript Core Engine, GTK+ Port
Group: System/Libraries
%description -n libjavascriptcoregtk%{_sover}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%package -n typelib-1_0-WebKit-%{_sonameverpkg}
Summary: Library for rendering web content, GTK+ Port -- Introspection bindings
Group: System/Libraries
%description -n typelib-1_0-WebKit-%{_sonameverpkg}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
This package provides the GObject Introspection bindings for the GTK+
port of WebKit.
%if %{build_for_gtk3}
%package -n typelib-1_0-WebKit2-%{_sonameverpkg}
Summary: Library for rendering web content, GTK+ Port -- Introspection bindings
Group: System/Libraries
%description -n typelib-1_0-WebKit2-%{_sonameverpkg}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
This package provides the GObject Introspection bindings for the GTK+
port of WebKit2.
%endif
%package -n typelib-1_0-JSCore-%{_sonameverpkg}
Summary: JavaScript Core Engine, GTK+ Port -- Introspection bindings
Group: System/Libraries
%description -n typelib-1_0-JSCore-%{_sonameverpkg}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
This package provides the GObject Introspection bindings for the GTK+
port of the JavaScript Core engine.
%package -n libwebkitgtk%{?_develnamever}-devel
Summary: Library for rendering web content, GTK+ Port
Group: Development/Libraries/C and C++
Requires: libjavascriptcoregtk%{_sover} = %{version}
%if %{_withwk2}
Requires: libwebkit2gtk%{_wk2sover} = %{version}
%endif
Requires: libwebkitgtk%{_sover} = %{version}
Requires: typelib-1_0-JSCore-%{_sonameverpkg}
Requires: typelib-1_0-WebKit-%{_sonameverpkg}
%if ! %{build_for_gtk3}
Provides: WebKitGtk-devel = %{version}
Obsoletes: WebKitGtk-devel < %{version}
Provides: libwebkit-devel = %{version}
Obsoletes: libwebkit-devel < %{version}
%endif
%description -n libwebkitgtk%{?_develnamever}-devel
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%package -n webkit-jsc-%{_jscver}
Summary: Library for rendering web content, GTK+ Port
Group: Development/Libraries/C and C++
Requires: libwebkitgtk%{_sover} = %{version}
%if ! %{build_for_gtk3}
Provides: webkit-jsc = %{version}
Obsoletes: webkit-jsc < %{version}
%endif
%description -n webkit-jsc-%{_jscver}
WebKit is a web content engine, derived from KHTML and KJS from KDE,
and used primarily in Apple's Safari browser. It is made to be
embedded in other applications, such as mail readers, or web browsers.
It is able to display content such as HTML, SVG, XML, and others. It
also supports DOM, XMLHttpRequest, XSLT, CSS, Javascript/ECMAscript and
more.
%lang_package -n %{_pkgname_no_slpp}
%prep
%setup -q -n webkitgtk-%{version}
%patch0 -p1
%patch2
%patch3 -p1
# FIXME: workaround needed in > 1.7.90 to fix build
mkdir DerivedSources/ANGLE
mkdir DerivedSources/InjectedBundle
mkdir -p DerivedSources/WebKit2/webkit2gtk/webkit2
mkdir DerivedSources/webkit
%build
%ifarch ppc64
RPM_OPT_FLAGS+=" -mminimal-toc "
%endif
%ifarch %arm
# we'll always want to remove the debug from the build on arm
RPM_OPT_FLAGS="${RPM_OPT_FLAGS/-g/}"
%endif
%ifarch ppc ppc64 %arm
%define extraconfigure --disable-jit
RPM_OPT_FLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads "
%endif
# No debug builds.... We run out of about everything with -O2 -g (the .ar becomes > 4.3GB)
export CFLAGS=" $RPM_OPT_FLAGS -g0"
export CXXFLAGS=" $RPM_OPT_FLAGS -g0"
# Needed by patch3
autoreconf --verbose --install -I Source/autotools
%configure \
--with-gtk=%{_gtkver} \
--enable-geolocation \
--enable-introspection \
--enable-javascript-debugger \
%{?extraconfigure} \
--disable-static \
--enable-shared \
--with-gstreamer=1.0 \
%if %{_withwk2}
--enable-webkit2
%else
--disable-webkit2
%endif
make V=1
%install
%makeinstall
%find_lang webkitgtk-%{_gtkver} %{no_lang_C}
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%post -n libwebkitgtk%{_sover} -p /sbin/ldconfig
%postun -n libwebkitgtk%{_sover} -p /sbin/ldconfig
%if %{_withwk2}
%post -n libwebkit2gtk%{_wk2sover} -p /sbin/ldconfig
%postun -n libwebkit2gtk%{_wk2sover} -p /sbin/ldconfig
%endif
%post -n libjavascriptcoregtk%{_sover} -p /sbin/ldconfig
%postun -n libjavascriptcoregtk%{_sover} -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files -n libwebkitgtk%{_sover}
%defattr(-,root,root)
%doc Source/WebCore/LICENSE-APPLE Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1 Source/WebKit/LICENSE Source/WebKit/gtk/NEWS
%{_libdir}/libwebkitgtk-%{_sonamever}.so.*
%{_datadir}/webkitgtk-%{_sonamever}/
%if %{_withwk2}
%files -n libwebkit2gtk%{_wk2sover}
%defattr(-,root,root)
%{_libdir}/libwebkit2gtk-%{_sonamever}.so.*
%{_libexecdir}/WebKitPluginProcess
%{_libexecdir}/WebKitWebProcess
%endif
%files -n libjavascriptcoregtk%{_sover}
%defattr(-, root, root)
%doc Source/JavaScriptCore/COPYING.LIB Source/WebKit/gtk/NEWS
%{_libdir}/libjavascriptcoregtk-%{_sonamever}.so.*
%files -n typelib-1_0-WebKit-%{_sonameverpkg}
%defattr(-,root,root)
%{_libdir}/girepository-1.0/WebKit-%{_sonamever}.typelib
%if %{build_for_gtk3}
%files -n typelib-1_0-WebKit2-%{_sonameverpkg}
%defattr(-,root,root)
%{_libdir}/girepository-1.0/WebKit2-%{_sonamever}.typelib
%endif
%files -n typelib-1_0-JSCore-%{_sonameverpkg}
%defattr(-,root,root)
%{_libdir}/girepository-1.0/JSCore-%{_sonamever}.typelib
%files -n libwebkitgtk%{?_develnamever}-devel
%defattr(-,root,root)
# FIXME: this is wrong: libwebkitgtk-devel and libwebkitgtk3-devel will conflict on the gtk-doc files
%doc %{_datadir}/gtk-doc/html/webkitgtk/
%{_libdir}/libjavascriptcoregtk-%{_sonamever}.so
%{_libdir}/libwebkitgtk-%{_sonamever}.so
%{_libdir}/pkgconfig/javascriptcoregtk-%{_sonamever}.pc
%{_libdir}/pkgconfig/webkit%{_pkgconfig_suffix}.pc
%{_includedir}/webkitgtk-%{_sonamever}/
%{_datadir}/gir-1.0/*.gir
%if %{_withwk2}
%doc %{_datadir}/gtk-doc/html/webkit2gtk/
%{_libdir}/libwebkit2gtk-%{_sonamever}.so
%{_libdir}/pkgconfig/webkit2%{_pkgconfig_suffix}.pc
%endif
%files -n webkit-jsc-%{_jscver}
%defattr(-,root,root)
%{_bindir}/jsc-%{_jscver}
%files -n %{_pkgname_no_slpp}-lang -f webkitgtk-%{_gtkver}.lang
%changelog