# Seems not to build with -j12 on x86_64, we choose -j6 %{?!limit_build:%global _smp_ncpus_max 6} %ifarch x86_64 %{ix86} %global _limit_build_mem 7168 %else %global _limit_build_mem 6144 %endif %define oname webkitgtk %define api6 6.0 %define api 4.1 %define api4 4.0 %define javascriptcoregtk_major 0 %define javascriptcoregtk4_major 18 %define javascriptcoregtk6_major 1 %define libjavascriptcoregtk6 %mklibname javascriptcoregtk %{api6} %{javascriptcoregtk6_major} %define libjavascriptcoregtk %mklibname javascriptcoregtk %{api} %{javascriptcoregtk_major} %define libjavascriptcoregtk4 %mklibname javascriptcoregtk %{api4} %{javascriptcoregtk4_major} %define javascriptcoregtk_gir5 %mklibname javascriptcore-gir %{api6} %define javascriptcoregtk_gir %mklibname javascriptcore-gir %{api} %define javascriptcoregtk_gir4 %mklibname javascriptcore-gir %{api4} %define webkit6_major 4 %define webkit2_major 0 %define webkit4_major 37 %define libwebkit6 %mklibname webkitgtk %{api6} %{webkit6_major} %define libwebkit2 %mklibname webkit2gtk %{api} %{webkit2_major} %define libwebkit4 %mklibname webkit2gtk %{api4} %{webkit4_major} %define webkit6_gir %mklibname webkitgtk-gir %{api6} %define webkit2_gir %mklibname webkit2gtk-gir %{api} %define webkit4_gir %mklibname webkit2gtk-gir %{api4} %define develname6 %mklibname -d webkitgtk%{api6} %define develname %mklibname -d webkit2gtk%{api} %define develname4 %mklibname -d webkit2gtk%{api4} %bcond_without gamepad Name: webkit2 Version: 2.50.1 Release: %mkrel 1 Summary: GTK 3 web content engine library License: LGPLv2 Group: System/Libraries URL: https://www.webkitgtk.org/ Source0: https://webkitgtk.org/releases/%{oname}-%{version}.tar.xz # Don't use SSE/SSE2 instructions on i586 (from Debian) Patch2: dont-detect-sse2.patch Patch4: webkitgtk-linking.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2310828 # https://bugs.webkit.org/show_bug.cgi?id=279360 #Patch5: 5a287cdc5ab49bccc4aeb3767dcfb862d18807f5.patch BuildRequires: bison BuildRequires: bubblewrap BuildRequires: cmake BuildRequires: gi-docgen BuildRequires: gnupg2 BuildRequires: gperf BuildRequires: hyphen-devel BuildRequires: ninja-build BuildRequires: python3 BuildRequires: ruby BuildRequires: unifdef BuildRequires: xdg-dbus-proxy BuildRequires: libatomic-devel BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(enchant-2) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gstreamer-plugins-bad-1.0) BuildRequires: pkgconfig(gstreamer-transcoder-1.0) BuildRequires: gstreamer1.0-transcoder BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(libavif) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libjxl) BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libsecret-1) BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libsoup-3.0) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwoff2dec) BuildRequires: pkgconfig(libxslt) %if %{with gamepad} BuildRequires: pkgconfig(manette-0.2) %endif BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(upower-glib) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-server) BuildRequires: pkgconfig(wpe-1.0) BuildRequires: pkgconfig(wpebackend-fdo-1.0) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(lcms2) %description WebKitGTK is the port of the portable web rendering engine WebKit to the GTK 3 platform. %package -n %{name}-driver Summary: WebKitGTK WebDriver support Group: System/Libraries Conflicts: webkit2 < %{version}-%{release} Conflicts: webkit25 < 2.38.0-3 %description -n %{name}-driver WebDriver service implementation for WebKitGTK. %package -n webkit2gtk%{api} Summary: GTK 3 web content engine library Group: System/Libraries Requires: %{name}-driver >= %{version}-%{release} Obsoletes: webkit2 < %{version}-%{release} %description -n webkit2gtk%{api} WebKitGTK is the port of the portable web rendering engine WebKit to the GTK 3 platform. %package -n webkitgtk%{api6} Summary: GTK 4 web content engine library Group: System/Libraries Requires: %{name}-driver >= %{version}-%{release} %description -n webkitgtk%{api6} WebKitGTK is the port of the portable web rendering engine WebKit to the GTK 4 platform. %package -n webkit2gtk%{api4} Summary: GTK 3 web content engine library Group: System/Libraries Requires: %{name}-driver >= %{version}-%{release} Obsoletes: webkit24 < 2.38.2-3 %description -n webkit2gtk%{api4} WebKitGTK is the port of the portable web rendering engine WebKit to the GTK 3 platform. %package -n webkitgtk%{api6}-jsc Summary: JavaScriptCore shell for WebKit GTK 4 Group: Development/GNOME and GTK+ %description -n webkitgtk%{api6}-jsc jsc is a shell for JavaScriptCore, WebKit's JavaScript engine. It allows you to interact with the JavaScript engine directly. %package -n webkit2gtk%{api}-jsc Summary: JavaScriptCore shell for WebKit GTK 3 Group: Development/GNOME and GTK+ Obsoletes: webkit2-jsc < %{version}-%{release} %description -n webkit2gtk%{api}-jsc jsc is a shell for JavaScriptCore, WebKit's JavaScript engine. It allows you to interact with the JavaScript engine directly. %package -n webkit2gtk%{api4}-jsc Summary: JavaScriptCore shell for WebKit GTK 3 Group: Development/GNOME and GTK+ Obsoletes: webkit2-jsc4 < 2.38.2-3 %description -n webkit2gtk%{api4}-jsc jsc is a shell for JavaScriptCore, WebKit's JavaScript engine. It allows you to interact with the JavaScript engine directly. %package -n %{libwebkit6} Summary: GTK port of WebKit web browser engine Group: System/Libraries Requires: webkitgtk%{api6} >= %{version} # These are hard requirements of WebKit's bubblewrap sandbox. Requires: bubblewrap Requires: xdg-dbus-proxy # If Geoclue is not running, the geolocation API will not work. Recommends: geoclue2 # If no xdg-desktop-portal back-end is installed, many features will be broken # inside the sandbox. In particular, the -gtk back-end has to be installed for # desktop settings access, including font settings. Recommends: xdg-desktop-portal-gtk %description -n %{libwebkit6} The GTK 4 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{libwebkit2} Summary: GTK port of WebKit web browser engine Group: System/Libraries Requires: webkit2gtk%{api} >= %{version} # These are hard requirements of WebKit's bubblewrap sandbox. Requires: bubblewrap Requires: xdg-dbus-proxy # If Geoclue is not running, the geolocation API will not work. Recommends: geoclue2 # If no xdg-desktop-portal back-end is installed, many features will be broken # inside the sandbox. In particular, the -gtk back-end has to be installed for # desktop settings access, including font settings. Recommends: xdg-desktop-portal-gtk %description -n %{libwebkit2} The GTK 3 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{libwebkit4} Summary: GTK port of WebKit web browser engine Group: System/Libraries Requires: webkit2gtk%{api4} >= %{version} # These are hard requirements of WebKit's bubblewrap sandbox. Requires: bubblewrap Requires: xdg-dbus-proxy # If Geoclue is not running, the geolocation API will not work. Recommends: geoclue2 # If no xdg-desktop-portal back-end is installed, many features will be broken # inside the sandbox. In particular, the -gtk back-end has to be installed for # desktop settings access, including font settings. Recommends: xdg-desktop-portal-gtk %description -n %{libwebkit4} The GTK 3 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{libjavascriptcoregtk6} Summary: GTK 4 port of WebKit web browser engine Group: System/Libraries %description -n %{libjavascriptcoregtk6} The GTK 4 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{libjavascriptcoregtk} Summary: GTK 3 port of WebKit web browser engine Group: System/Libraries %description -n %{libjavascriptcoregtk} The GTK 3 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{libjavascriptcoregtk4} Summary: GTK 3 port of WebKit web browser engine Group: System/Libraries %description -n %{libjavascriptcoregtk4} The GTK 3 port of WebKit is intended to provide a browser component primarily for users of the portable GTK UI toolkit on platforms like Linux. %package -n %{develname6} Summary: Development files for WebKit GTK 4 port Group: Development/GNOME and GTK+ Provides: webkit2-devel = %{version}-%{release} Provides: webkit2gtk%{api6}-devel = %{version}-%{release} Provides: libwebkit2gtk%{api6}-devel = %{version}-%{release} Requires: %{libjavascriptcoregtk6} = %{version} Requires: %{libwebkit6} = %{version} Requires: %{javascriptcoregtk_gir5} = %{version} Requires: %{webkit6_gir} = %{version} Requires: webkitgtk%{api6}-jsc = %{version} %description -n %{develname6} The %{name}-devel package contains libraries, build data, and header files for developing applications that use %{name}. %package -n %{develname} Summary: Development files for WebKit GTK 3 port Group: Development/GNOME and GTK+ Provides: webkit2gtk%{api}-devel = %{version}-%{release} Provides: libwebkit2gtk%{api}-devel = %{version}-%{release} Requires: %{libjavascriptcoregtk} = %{version} Requires: %{libwebkit2} = %{version} Requires: %{javascriptcoregtk_gir} = %{version} Requires: %{webkit2_gir} = %{version} Requires: webkit2gtk%{api}-jsc = %{version} Obsoletes: %{_lib}webkit2-devel < %{version}-%{release} %description -n %{develname} The %{name}-devel package contains libraries, build data, and header files for developing applications that use %{name}. %package -n %{develname4} Summary: Development files for WebKit GTK 3 port Group: Development/GNOME and GTK+ Provides: webkit2gtk%{api4}-devel = %{version}-%{release} Provides: libwebkit2gtk%{api4}-devel = %{version}-%{release} Requires: %{libjavascriptcoregtk4} = %{version} Requires: %{libwebkit4} = %{version} Requires: %{javascriptcoregtk_gir4} = %{version} Requires: %{webkit4_gir} = %{version} Requires: webkit2gtk%{api4}-jsc = %{version} Obsoletes: %{_lib}webkit4-devel < 2.38.2-3 %description -n %{develname4} The %{name}-devel package contains libraries, build data, and header files for developing applications that use %{name}. %package -n %{javascriptcoregtk_gir5} Summary: GObject Introspection interface description for JSCore Group: System/Libraries Requires: %{libjavascriptcoregtk} = %{version}-%{release} %description -n %{javascriptcoregtk_gir5} GObject Introspection interface description for JSCore. %package -n %{javascriptcoregtk_gir} Summary: GObject Introspection interface description for JSCore Group: System/Libraries Requires: %{libjavascriptcoregtk} = %{version}-%{release} %description -n %{javascriptcoregtk_gir} GObject Introspection interface description for JSCore. %package -n %{javascriptcoregtk_gir4} Summary: GObject Introspection interface description for JSCore Group: System/Libraries Requires: %{libjavascriptcoregtk} = %{version}-%{release} %description -n %{javascriptcoregtk_gir4} GObject Introspection interface description for JSCore. %package -n %{webkit6_gir} Summary: GObject Introspection interface description for %{name} Group: System/Libraries Requires: %{libwebkit6} = %{version}-%{release} %description -n %{webkit6_gir} GObject Introspection interface description for WebKit. %package -n %{webkit2_gir} Summary: GObject Introspection interface description for %{name} Group: System/Libraries Requires: %{libwebkit2} = %{version}-%{release} %description -n %{webkit2_gir} GObject Introspection interface description for WebKit. %package -n %{webkit4_gir} Summary: GObject Introspection interface description for %{name} Group: System/Libraries Requires: %{libwebkit4} = %{version}-%{release} %description -n %{webkit4_gir} GObject Introspection interface description for WebKit. %prep %setup -qn %{oname}-%{version} %autopatch -p1 %build # Increase the DIE limit so our debuginfo packages can be size-optimized. # This previously decreased the size for x86_64 from ~5G to ~1.1G, but as of # 2022 it's more like 850 MB -> 675 MB. This requires lots of RAM on the # builders, so only do this for x86_64 and aarch64 to avoid overwhelming # builders with less RAM. # https://bugzilla.redhat.com/show_bug.cgi?id=1456261 %global _dwz_max_die_limit_x86_64 250000000 %global _dwz_max_die_limit_aarch64 250000000 # Require 32 GB of RAM per vCPU for debuginfo processing. 16 GB is not enough. %{?limit_build:%global _find_debuginfo_opts %{limit_build -m 32768}} # Reduce debuginfo verbosity 32-bit builds to reduce memory consumption even more. # https://bugs.webkit.org/show_bug.cgi?id=140176 # https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/I6IVNA52TXTBRQLKW45CJ5K4RA4WNGMI/ %ifarch %{ix86} %arm aarch64 %global debugcflags -g1 %endif # JIT is broken on ARM systems with new ARMv8.5 BTI extension at the moment # Cf. https://bugzilla.redhat.com/show_bug.cgi?id=2130009 # Cf. https://bugs.webkit.org/show_bug.cgi?id=245697 # Disable BTI until this is fixed upstream. %ifarch aarch64 %global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /') %endif %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-6.0 %cmake \ -G Ninja \ -DGCC_OFFLINEASM_SOURCE_MAP=OFF \ -DPORT=GTK \ -DUSE_GTK4=ON \ -DUSE_LIBBACKTRACE=OFF \ -DUSE_JPEGXL=ON \ -DPYTHON_EXECUTABLE=%{_bindir}/python3 \ -DUSE_WPE_RENDERER=OFF \ %if ! %{with gamepad} -DENABLE_GAMEPAD=OFF \ %endif -DUSE_SOUP2=OFF %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.1 %cmake \ -G Ninja \ -DGCC_OFFLINEASM_SOURCE_MAP=OFF \ -DPORT=GTK \ -DUSE_GTK4=OFF \ -DUSE_LIBBACKTRACE=OFF \ -DUSE_JPEGXL=ON \ -DPYTHON_EXECUTABLE=%{_bindir}/python3 \ -DUSE_WPE_RENDERER=OFF \ %if ! %{with gamepad} -DENABLE_GAMEPAD=OFF \ %endif -DUSE_SOUP2=OFF %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.0 %cmake \ -G Ninja \ -DGCC_OFFLINEASM_SOURCE_MAP=OFF \ -DPORT=GTK \ -DUSE_GTK4=OFF \ -DUSE_LIBBACKTRACE=OFF \ -DUSE_JPEGXL=ON \ -DPYTHON_EXECUTABLE=%{_bindir}/python3 \ -DUSE_WPE_RENDERER=OFF \ %if ! %{with gamepad} -DENABLE_GAMEPAD=OFF \ %endif -DUSE_SOUP2=ON %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-6.0 export NINJA_STATUS="[1/3][%f/%t %es] " %cmake_build %{?limit_build: %{limit_build -m %{_limit_build_mem}}} %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.1 export NINJA_STATUS="[2/3][%f/%t %es] " %cmake_build %{?limit_build: %{limit_build -m %{_limit_build_mem}}} %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.0 export NINJA_STATUS="[3/3][%f/%t %es] " %cmake_build %{?limit_build: %{limit_build -m %{_limit_build_mem}}} %install %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-6.0 %cmake_install %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.1 %cmake_install %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.0 %cmake_install %find_lang WebKitGTK-%{api6} %find_lang WebKitGTK-%{api} %find_lang WebKitGTK-%{api4} %files -n webkit2gtk%{api} -f WebKitGTK-%{api}.lang %dir %{_libexecdir}/webkit2gtk-%{api}/ %{_libexecdir}/webkit2gtk-%{api}/WebKit*Process %{_libexecdir}/webkit2gtk-%{api}/MiniBrowser %dir %{_libdir}/webkit2gtk-%{api}/ %{_libdir}/webkit2gtk-%{api}/injected-bundle/libwebkit2gtkinjectedbundle.so %files -n %{name}-driver %{_bindir}/WebKitWebDriver %files -n webkit2gtk%{api4} -f WebKitGTK-%{api4}.lang %dir %{_libexecdir}/webkit2gtk-%{api4}/ %{_libexecdir}/webkit2gtk-%{api4}/WebKit*Process %{_libexecdir}/webkit2gtk-%{api4}/MiniBrowser %dir %{_libdir}/webkit2gtk-%{api4}/ %{_libdir}/webkit2gtk-%{api4}/injected-bundle/libwebkit2gtkinjectedbundle.so %files -n webkitgtk%{api6} -f WebKitGTK-%{api6}.lang %dir %{_libexecdir}/webkitgtk-%{api6}/ %{_libexecdir}/webkitgtk-%{api6}/WebKit*Process %{_libexecdir}/webkitgtk-%{api6}/MiniBrowser %dir %{_libdir}/webkitgtk-%{api6}/ %{_libdir}/webkitgtk-%{api6}/injected-bundle/libwebkitgtkinjectedbundle.so %files -n webkitgtk%{api6}-jsc %{_libexecdir}/webkitgtk-%{api6}/jsc %files -n webkit2gtk%{api}-jsc %{_libexecdir}/webkit2gtk-%{api}/jsc %files -n webkit2gtk%{api4}-jsc %{_libexecdir}/webkit2gtk-%{api4}/jsc %files -n %{libjavascriptcoregtk} %{_libdir}/libjavascriptcoregtk-%{api}.so.%{javascriptcoregtk_major} %{_libdir}/libjavascriptcoregtk-%{api}.so.%{javascriptcoregtk_major}.* %files -n %{libjavascriptcoregtk4} %{_libdir}/libjavascriptcoregtk-%{api4}.so.%{javascriptcoregtk4_major} %{_libdir}/libjavascriptcoregtk-%{api4}.so.%{javascriptcoregtk4_major}.* %files -n %{libjavascriptcoregtk6} %{_libdir}/libjavascriptcoregtk-%{api6}.so.%{javascriptcoregtk6_major} %{_libdir}/libjavascriptcoregtk-%{api6}.so.%{javascriptcoregtk6_major}.* %files -n %{libwebkit6} %{_libdir}/libwebkitgtk-%{api6}.so.%{webkit6_major} %{_libdir}/libwebkitgtk-%{api6}.so.%{webkit6_major}.* %files -n %{libwebkit2} %{_libdir}/libwebkit2gtk-%{api}.so.%{webkit2_major} %{_libdir}/libwebkit2gtk-%{api}.so.%{webkit2_major}.* %files -n %{libwebkit4} %{_libdir}/libwebkit2gtk-%{api4}.so.%{webkit4_major} %{_libdir}/libwebkit2gtk-%{api4}.so.%{webkit4_major}.* %files -n %{develname6} %doc %{_docdir}/webkitgtk-web-process-extension-%{api6}/ %doc %{_docdir}/webkitgtk-%{api6}/ %doc %{_docdir}/javascriptcoregtk-%{api6}/ %{_includedir}/webkitgtk-%{api6}/ %{_libdir}/*-%{api6}.so %{_libdir}/pkgconfig/*-%{api6}.pc %{_datadir}/gir-1.0/*-%{api6}.gir %files -n %{develname} %doc %{_docdir}/webkit2gtk-web-extension-%{api}/ %doc %{_docdir}/webkit2gtk-%{api}/ %doc %{_docdir}/javascriptcoregtk-%{api}/ %{_includedir}/webkitgtk-%{api}/ %{_libdir}/*-%{api}.so %{_libdir}/pkgconfig/*-%{api}.pc %{_datadir}/gir-1.0/*-%{api}.gir %files -n %{develname4} %doc %{_docdir}/webkit2gtk-web-extension-%{api4}/ %doc %{_docdir}/webkit2gtk-%{api4}/ %doc %{_docdir}/javascriptcoregtk-%{api4}/ %{_includedir}/webkitgtk-%{api4}/ %{_libdir}/*-%{api4}.so %{_libdir}/pkgconfig/*-%{api4}.pc %{_datadir}/gir-1.0/*-%{api4}.gir %files -n %{javascriptcoregtk_gir5} %{_libdir}/girepository-1.0/JavaScriptCore-%{api6}.typelib %files -n %{javascriptcoregtk_gir} %{_libdir}/girepository-1.0/JavaScriptCore-%{api}.typelib %files -n %{javascriptcoregtk_gir4} %{_libdir}/girepository-1.0/JavaScriptCore-%{api4}.typelib %files -n %{webkit6_gir} %{_libdir}/girepository-1.0/WebKit-%{api6}.typelib %{_libdir}/girepository-1.0/WebKitWebProcessExtension-%{api6}.typelib %files -n %{webkit2_gir} %{_libdir}/girepository-1.0/WebKit2-%{api}.typelib %{_libdir}/girepository-1.0/WebKit2WebExtension-%{api}.typelib %files -n %{webkit4_gir} %{_libdir}/girepository-1.0/WebKit2-%{api4}.typelib %{_libdir}/girepository-1.0/WebKit2WebExtension-%{api4}.typelib