cruxports/webkitgtk-60/Pkgfile

62 lines
2.4 KiB
Plaintext

# Description: rendering engine for gtk web browsers, unstable branch
# URL: https://www.webkitgtk.org/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: gtk4 gst-plugins-base hyphen icu lcms2 libseccomp libsecret libsoup3 libwebp ruby unifdef woff2
# Optional: enchant libnotify geoclue openjpeg2 xdg-dbus-proxy bubblewrap wpebackend-fdo libmanette
name=webkitgtk-60
version=2.41.5
release=1
source=(https://webkitgtk.org/releases/webkitgtk-$version.tar.xz bwrap-pipewire.patch)
build() {
# fail the build if dependencies are not met
[ -e /usr/include/harfbuzz/hb-icu.h ] || \
{ echo "Rebuild harfbuzz with icu present; otherwise webkitgtk will not work."; exit 1; }
PKGMK_WEBKITGTK=(-G Ninja -D CMAKE_BUILD_TYPE=Release
-Wno-dev -D CMAKE_INSTALL_PREFIX:PATH=/usr
-D CMAKE_INSTALL_LIBEXECDIR:PATH=/usr/lib
-D CMAKE_INSTALL_LIBDIR:PATH=/usr/lib
-D CMAKE_SKIP_RPATH=ON
-D PORT=GTK
-D USE_GTK4=ON
-D USE_SOUP2=OFF
-D ENABLE_MINIBROWSER=ON
-D ENABLE_JOURNALD_LOG=OFF
-D ENABLE_DOCUMENTATION=OFF
-D ENABLE_QUARTZ_TARGET=OFF
-D USER_AGENT_BRANDING=CRUX-3.7)
if prt-get isinst bubblewrap xdg-dbus-proxy; then
PKGMK_WEBKITGTK+=(-DENABLE_BUBBLEWRAP_SANDBOX=ON)
patch -i bwrap-pipewire.patch \
${name%-*}-$version/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
else
PKGMK_WEBKITGTK+=(-DENABLE_BUBBLEWRAP_SANDBOX=OFF)
fi
prt-get isinst lld && LDFLAGS+=" -Wl,-fuse-ld=gold"
prt-get isinst openjpeg2 || PKGMK_WEBKITGTK+=(-DUSE_OPENJPEG=OFF)
[ -e /usr/lib/libjxl.so ] || PKGMK_WEBKITGTK+=(-DUSE_JPEGXL=OFF)
prt-get isinst enchant || PKGMK_WEBKITGTK+=(-DENABLE_SPELLCHECK=OFF)
prt-get isinst geoclue && PKGMK_WEBKITGTK+=(-DENABLE_GEOLOCATION=ON) || PKGMK_WEBKITGTK+=(-DENABLE_GEOLOCATION=OFF)
prt-get isinst wpebackend-fdo || PKGMK_WEBKITGTK+=(-DUSE_WPE_RENDERER=OFF)
prt-get isinst libmanette || PKGMK_WEBKITGTK+=(-DENABLE_GAMEPAD=OFF)
prt-get isinst libavif || PKGMK_WEBKITGTK+=(-DUSE_AVIF=OFF)
prt-get isinst gst-plugins-bad || PKGMK_WEBKITGTK+=(-DUSE_GSTREAMER_TRANSCODER=OFF)
cmake -S ${name%-*}-$version -B build "${PKGMK_WEBKITGTK[@]}" \
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -DNDEBUG -ffat-lto-objects" \
-D CMAKE_C_FLAGS_RELEASE="${CFLAGS} -DNDEBUG -ffat-lto-objects" \
-D CMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
ninja -C build -j ${JOBS:-1}
DESTDIR=$PKG ninja -C build install
rm -r $PKG/usr/share/locale
# avoid a conflict with the webkitgtk footprint
mv $PKG/usr/bin/WebKitWebDriver{,-60}
}