cruxports/webkitgtk-41/Pkgfile

53 lines
2.4 KiB
Plaintext

# Description: Rendering engine for web browsers, built against gtk3 and libsoup3
# URL: https://www.webkitgtk.org/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: gst-plugins-base gtk3 hyphen icu lcms2 libseccomp libsecret libsoup3 libwebp libxslt ruby unifdef woff2 xorg-libxcomposite xorg-libxt
# Optional: bubblewrap enchant geoclue gst-plugins-bad libavif libjxl libmanette openjpeg2 wpebackend-fdo xdg-dbus-proxy
name=webkitgtk-41
version=2.44.3
release=1
source=(https://webkitgtk.org/releases/webkitgtk-$version.tar.xz)
build() {
# fail the build if dependencies are not met
[ -e /usr/include/harfbuzz/hb-icu.h ] || { printf '\e[1;31m%-6s\e[m\n' "You need to install icu, then rebuild harfbuzz for webkitgtk to work, quitting..." ; exit 1; }
prt-get isinst openjpeg2 || PKGMK_WEBKITGTK+=' -DUSE_OPENJPEG=OFF'
prt-get isinst enchant || PKGMK_WEBKITGTK+=' -DENABLE_SPELLCHECK=OFF'
prt-get isinst libjxl && PKGMK_WEBKITGTK+=' -DUSE_JPEGXL=ON' || PKGMK_WEBKITGTK+=' -DUSE_JPEGXL=OFF'
prt-get isinst geoclue && PKGMK_WEBKITGTK+=' -DENABLE_GEOLOCATION=ON' || PKGMK_WEBKITGTK+=' -DENABLE_GEOLOCATION=OFF'
prt-get isinst bubblewrap xdg-dbus-proxy && PKGMK_WEBKITGTK+=' -DENABLE_BUBBLEWRAP_SANDBOX=ON' \
|| PKGMK_WEBKITGTK+=' -DENABLE_BUBBLEWRAP_SANDBOX=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 webkitgtk-$version -B build -G Ninja ${PKGMK_WEBKITGTK} \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=/usr/lib \
-D CMAKE_INSTALL_LIBEXECDIR=/usr/lib \
-D CMAKE_BUILD_TYPE=Release \
-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} -Wl,-fuse-ld=gold" \
-D CMAKE_SKIP_RPATH=ON \
-D PORT=GTK \
-D USE_GTK4=OFF \
-D USE_SOUP2=OFF \
-D USE_LIBBACKTRACE=OFF \
-D ENABLE_MINIBROWSER=ON \
-D ENABLE_JOURNALD_LOG=OFF \
-D ENABLE_DOCUMENTATION=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
rm -r $PKG/usr/share/locale
# avoid a footprint collision with webkitgtk
mv $PKG/usr/bin/WebKitWebDriver{,-4.1}
}