From 4fda045f90a4e301329bddb766e2e12a0b4401de Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 14 Feb 2025 00:13:14 +0000 Subject: gentoo auto-resync : 14:02:2025 - 00:13:14 --- dev-qt/qtwebengine/Manifest | 3 +- .../files/qtwebengine-6.8.2-glibc2.41.patch | 20 ++ dev-qt/qtwebengine/qtwebengine-6.8.2-r1.ebuild | 336 +++++++++++++++++++++ dev-qt/qtwebengine/qtwebengine-6.8.2.ebuild | 335 -------------------- 4 files changed, 358 insertions(+), 336 deletions(-) create mode 100644 dev-qt/qtwebengine/files/qtwebengine-6.8.2-glibc2.41.patch create mode 100644 dev-qt/qtwebengine/qtwebengine-6.8.2-r1.ebuild delete mode 100644 dev-qt/qtwebengine/qtwebengine-6.8.2.ebuild (limited to 'dev-qt/qtwebengine') diff --git a/dev-qt/qtwebengine/Manifest b/dev-qt/qtwebengine/Manifest index 1b5e7ac81317..665b6ec3727b 100644 --- a/dev-qt/qtwebengine/Manifest +++ b/dev-qt/qtwebengine/Manifest @@ -7,6 +7,7 @@ AUX qtwebengine-5.15.2_p20210521-clang-libc++.patch 358 BLAKE2B a03de632ac4e01cf AUX qtwebengine-6.8.1-QTBUG-131156.patch 7291 BLAKE2B 90993c2406631001e1f75f32da495e9d6c91a81d92e30b3902da45a08fe18b36cdddaf7763d58cdd48ea9f25566da3d107807e71bd47c5422e54c9fcbf07cd72 SHA512 0f9d2e14fa2abfe73fa691d91ad57fe833a9b70627d737c49f6928111a4d0a1d294a2a38620b1368b3fad6a347eff408a521fbc2cf4ff317ebf5a63b62c1efb6 AUX qtwebengine-6.8.1-aarch64-xnnpack.patch 629 BLAKE2B 2809c1e159252c3131c318cd31fd6d7875a41ca477ffcc82b832838eeb0b89ed15baea25f95c894369b73fd41c7cfea0fcc880b5fc097b8e987b718300fb7d3b SHA512 b1e3330a2e6e8b352cf83b8c2e9b469772638d331b78c9f690208044a72a1bbefc5b3114affc5a512a8c0839ece197322a8382da8e8c3be18042a9c394034c31 AUX qtwebengine-6.8.1-cstdint.patch 1136 BLAKE2B 8dc976348896073cc6f884199d6ad13a0e5f377707e6046d84bfc7927b749729ebe1f1b0b2f2c930094201647bfd638405ebfe4dce5d3583844f2a95ead5169a SHA512 12e65e9f1ca2ef498e4fba4769dd5bd3c03935f6c2e69ab47ebfab1f5f4637616c4d2303fdb645f404a3348a5701a132a204bf55dd80b54497d18294800014a6 +AUX qtwebengine-6.8.2-glibc2.41.patch 1106 BLAKE2B c1b785f35547256aa0441839a5f7de2921ffc97a592b96f659bb9c8d76c1eee1f8353b80f0094cef4cd71355a4e3925005c549bdfa16554e8eb560356c25dae1 SHA512 bd3e084364636a984b04e0c5df233c21f6ec56c99dce214f2747e84aac61bd518e5b6728eb76bb52e9dff2f8e9f3775a7fc3b89f6954b54a0c6dd45f81c72418 DIST qtwebengine-5.15.14_p20240510-patchset.tar.xz 20780 BLAKE2B 516d4c628c4b027ab3a7159da006a57173be91de3eb4b7f308029953d4fd19fb3e790ca38e79d17fef75d8d9b392676650acb9285d5913f9ebecaa4136575c47 SHA512 492979d118d6bd9165ee194724e38b627d19c89dbe1daa6b2f55e4a8fc7676748a1eacb9623ee05e09140c2c4a2ac82ddafaef5c45630a117ce0ed14b240a474 DIST qtwebengine-5.15.16_p20241115.tar.xz 301382752 BLAKE2B 08adfae6228a91f1f4b2a603a28881d9cf97f339d951217f3837d614ebb58aff9b0963220be04cc9a17869b6021a6d7687848bd8ccd1c8c49115a5e6944be84b SHA512 50e0bc7b4236859b4419f2f8eaf37e47c1994c30ca3bf584dd2f4996b5f8ba7cd31c8aae48c28f0fcd39c144490f5e451c7ecf5d340e7b10fa2e37666ef21100 DIST qtwebengine-6.8-patchset-7.tar.xz 9096 BLAKE2B 58a95b198a6c8180a71a4365e7c2e3bee2d3798ecff18b01fe23e228a4ceafe2aae43088f503a98fa2d5097271ec442985d993fb24e1b2d2c09014b3309bef4d SHA512 489caa5f7cc3d3091e5896c2eb4d489a40fc220738c2240ec406928c7c948ab8962817024c2fbe3c393294e70ef6ce8c02e47964952a3656ff6ebf7908069fc3 @@ -15,7 +16,7 @@ DIST qtwebengine-everywhere-src-6.8.1.tar.xz 566480152 BLAKE2B 6e4137f66363169ae DIST qtwebengine-everywhere-src-6.8.2.tar.xz 566518084 BLAKE2B 312fda4150bdc1aee25625440baca45b532ecd7a1ce24d3dc3ba990cdf208c3ba42f159e02c881f38b56c29b75677d9001e6222d35b4c96fc39eecf65502e9c7 SHA512 27590ec53845fa36f48a5a0506d505995850027d85bf33fe0413733cbde5c2744e8ea49f445c91d84b8d43454b9f12c1cf7005d614bbcae1a29d432fdacdc0e4 EBUILD qtwebengine-5.15.16_p20241115.ebuild 7879 BLAKE2B ce3061b704385359455c0885efe935b9bf1f8e5627ba06a9fbafb1c95cfccdef6f39331868bbaf3d5794d708e7bb6c01cbef28c1880f45fb60d9e81cc73dcf53 SHA512 c31bca254f0962e39f763f49f22930d7c6d51a68169b72e9bf9afb111a01e40c15c82d86743f185480f092c85e8e17c51dc4e07ee7557ac449a00a8d3952be6f EBUILD qtwebengine-6.8.1-r1.ebuild 10358 BLAKE2B 49ae9ccf4db903ac46ed602bb9a9eca4751eb1a2476ce4a3bc2d02a61529e8c6f1d892729c5b1393bc975d5d26a5840d4e0599029467e69ddfec5d606beeb631 SHA512 8ddb31bfdc1118d87d188bcd6d74d8fdca4800c6e0420d21740614587f62d9d8b1ebd3603c20ff52d6b6ecc6c673c4360f6c0c08a549f927889ba582be4a8f38 -EBUILD qtwebengine-6.8.2.ebuild 10314 BLAKE2B c8462b2833f4778f363d08b62c8a5585d58b439641ed6bc83142f35ae72b1047ca2a22c818079a55f670512bbed31b7d6b1c317aad8a731b8ce7110332bb3bc4 SHA512 4cd85c7d16049ecccb4a8755d6076b2f464b6af9af7ae71710e5f918d319e41ef96d212543f4b61e367779220a2b5d8f79196ade3aa5b5593cba687c296a7ded +EBUILD qtwebengine-6.8.2-r1.ebuild 10357 BLAKE2B e4872e5e64b3b192f0695f2ccb14aa9e81f76a31b29ee3293f87f0bb45a60ec3065aaeb37af0bc6330eb0a1106454609fd0cba617bf7ded16d5556ecca871f2c SHA512 e73b389d377f6606c0a3e6593bceba405e6d1e611792be635fed41b3c8cce0afbba90c5130f718d321c1aa02ed1ab9139dbd028e1d87a2fff0c2c6783cb0aab4 EBUILD qtwebengine-6.8.9999.ebuild 10314 BLAKE2B c8462b2833f4778f363d08b62c8a5585d58b439641ed6bc83142f35ae72b1047ca2a22c818079a55f670512bbed31b7d6b1c317aad8a731b8ce7110332bb3bc4 SHA512 4cd85c7d16049ecccb4a8755d6076b2f464b6af9af7ae71710e5f918d319e41ef96d212543f4b61e367779220a2b5d8f79196ade3aa5b5593cba687c296a7ded EBUILD qtwebengine-6.9.9999.ebuild 10163 BLAKE2B 4c142149b20df58fe0b44a2743d6c6f13ba612d6076a3d81e33e7d9564cdd27eb22a669347fcb71d10775f7ec9b6d651b61461e1eca8216ffa7bfc98e04d72d9 SHA512 274b653dc2636db3df74b983101a4fea07ad90cc8f1a891ecd07de1cec1158e6c4be5f9c45b34813c1860fee54cd94cf5562ff30320b9bb143d0317c064e59ee EBUILD qtwebengine-6.9999.ebuild 10122 BLAKE2B 3d8cc9b76bd0bba42c72d66e996ca1ed81d7b122fe0d6bddc023efbf14d9fe945ae8b28341a47a5244453a06f9a671c22dbb09305196611c762aa0602fedd12a SHA512 072fc8e115b88fdccc0aa00a0d61fd070224ee0f95c3c19d8c5287a598b4282846699b142e5edd5b7d55ff9c3862e2f8724459a44464dede903327868ab611c9 diff --git a/dev-qt/qtwebengine/files/qtwebengine-6.8.2-glibc2.41.patch b/dev-qt/qtwebengine/files/qtwebengine-6.8.2-glibc2.41.patch new file mode 100644 index 000000000000..85288a94a6a0 --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-6.8.2-glibc2.41.patch @@ -0,0 +1,20 @@ +https://bugs.gentoo.org/949654 + +Quick downstream fix for now. Hasn't been sent to upstream(s) yet +as of the writing of this, but believe it should happen soon. + +From 6c7a3a3a733cf33e9355f497815700e5e26e7c3d Mon Sep 17 00:00:00 2001 +From: Mike Lothian +Date: Wed, 12 Feb 2025 13:52:01 +0000 +Subject: [PATCH] Test fix +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +@@ -238,7 +238,7 @@ ResultExpr RestrictMmapFlags() { + // TODO(davidung), remove MAP_DENYWRITE with updated Tegra libraries. + const uint64_t kAllowedMask = MAP_SHARED | MAP_PRIVATE | MAP_ANONYMOUS | + MAP_STACK | MAP_NORESERVE | MAP_FIXED | +- MAP_DENYWRITE | MAP_LOCKED | ++ MAP_DENYWRITE | MAP_LOCKED | MAP_DROPPABLE | + kArchSpecificAllowedMask; + const Arg flags(3); + return If((flags & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS()); diff --git a/dev-qt/qtwebengine/qtwebengine-6.8.2-r1.ebuild b/dev-qt/qtwebengine/qtwebengine-6.8.2-r1.ebuild new file mode 100644 index 000000000000..5953fdc5e01c --- /dev/null +++ b/dev-qt/qtwebengine/qtwebengine-6.8.2-r1.ebuild @@ -0,0 +1,336 @@ +# Copyright 2021-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +PYTHON_REQ_USE="xml(+)" +inherit check-reqs flag-o-matic multiprocessing optfeature +inherit prefix python-any-r1 qt6-build toolchain-funcs + +DESCRIPTION="Library for rendering dynamic web content in Qt6 C++ and QML applications" +SRC_URI+=" + https://dev.gentoo.org/~ionen/distfiles/${PN}-6.8-patchset-7.tar.xz +" + +if [[ ${QT6_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm64" +fi + +IUSE=" + accessibility +alsa bindist custom-cflags designer geolocation + +jumbo-build kerberos opengl pdfium pulseaudio qml screencast + +system-icu vaapi vulkan webdriver +widgets +" +REQUIRED_USE=" + designer? ( qml widgets ) +" + +# dlopen: krb5, libva, pciutils, udev +# gcc: for -latomic +RDEPEND=" + app-arch/snappy:= + dev-libs/expat + dev-libs/libevent:= + dev-libs/libxml2[icu] + dev-libs/libxslt + dev-libs/nspr + dev-libs/nss + ~dev-qt/qtbase-${PV}:6[accessibility=,gui,opengl=,vulkan?,widgets?] + ~dev-qt/qtdeclarative-${PV}:6[widgets?] + ~dev-qt/qtwebchannel-${PV}:6[qml?] + media-libs/fontconfig + media-libs/freetype + media-libs/harfbuzz:= + media-libs/lcms:2 + media-libs/libjpeg-turbo:= + media-libs/libpng:= + media-libs/libwebp:= + media-libs/mesa[gbm(+)] + media-libs/openjpeg:2= + media-libs/opus + media-libs/tiff:= + sys-apps/dbus + sys-apps/pciutils + sys-devel/gcc:* + sys-libs/zlib:=[minizip] + virtual/libudev + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXext + x11-libs/libXfixes + x11-libs/libXrandr + x11-libs/libXtst + x11-libs/libdrm + x11-libs/libxcb:= + x11-libs/libxkbcommon + x11-libs/libxkbfile + alsa? ( media-libs/alsa-lib ) + designer? ( ~dev-qt/qttools-${PV}:6[designer] ) + geolocation? ( ~dev-qt/qtpositioning-${PV}:6 ) + kerberos? ( virtual/krb5 ) + pulseaudio? ( media-libs/libpulse[glib] ) + screencast? ( + dev-libs/glib:2 + media-video/pipewire:= + ) + system-icu? ( dev-libs/icu:= ) + vaapi? ( media-libs/libva:=[X] ) +" +DEPEND=" + ${RDEPEND} + media-libs/libglvnd + x11-base/xorg-proto + x11-libs/libXcursor + x11-libs/libXi + x11-libs/libxshmfence + opengl? ( media-libs/libglvnd[X] ) + screencast? ( media-libs/libepoxy[egl(+)] ) + test? ( + widgets? ( app-text/poppler[cxx(+)] ) + ) + vaapi? ( + vulkan? ( dev-util/vulkan-headers ) + ) +" +BDEPEND=" + $(python_gen_any_dep 'dev-python/html5lib[${PYTHON_USEDEP}]') + dev-util/gperf + net-libs/nodejs[ssl] + sys-devel/bison + sys-devel/flex +" + +PATCHES=( "${WORKDIR}"/patches/${PN} ) +[[ ${PV} == 6.9999 ]] || # too fragile for 6.9999, but keep for 6.x.9999 + PATCHES+=( "${WORKDIR}"/patches/chromium ) + +PATCHES+=( + # add extras as needed here, may merge in set if carries across versions + "${FILESDIR}"/${PN}-6.8.1-aarch64-xnnpack.patch + "${FILESDIR}"/${PN}-6.8.1-cstdint.patch + "${FILESDIR}"/${PN}-6.8.2-glibc2.41.patch +) + +python_check_deps() { + python_has_version "dev-python/html5lib[${PYTHON_USEDEP}]" +} + +qtwebengine_check-reqs() { + [[ ${MERGE_TYPE} == binary ]] && return + + if is-flagq '-g?(gdb)?([1-9])'; then #307861 + ewarn + ewarn "Used CFLAGS/CXXFLAGS seem to enable debug info (-g or -ggdb), which" + ewarn "is non-trivial with ${PN}. May experience extended compilation" + ewarn "times, increased disk/memory usage, and potentially link failure." + ewarn + ewarn "If run into issues, please try disabling before reporting a bug." + fi + + local CHECKREQS_DISK_BUILD=9G + local CHECKREQS_DISK_USR=360M + + if ! has distcc ${FEATURES}; then #830661 + # assume ~2GB per job or 1.5GB if clang, possible with less + # depending on free memory and *FLAGS, but prefer being safe as + # users having OOM issues with qtwebengine been rather common + tc-is-clang && : 15 || : 20 + local CHECKREQS_MEMORY=$(($(makeopts_jobs)*_/10))G + fi + + check-reqs_${EBUILD_PHASE_FUNC} #570534 +} + +pkg_pretend() { + qtwebengine_check-reqs +} + +pkg_setup() { + qtwebengine_check-reqs + python-any-r1_pkg_setup +} + +src_prepare() { + qt6-build_src_prepare + + # for www-plugins/chrome-binary-plugins (widevine) search paths on prefix + hprefixify -w /Gentoo/ src/core/content_client_qt.cpp + + # store chromium versions, only used in postinst for a warning + local chromium + mapfile -t chromium < CHROMIUM_VERSION || die + [[ ${chromium[1]} =~ ^Based.*:[^0-9]+([0-9.]+$) ]] && + QT6_CHROMIUM_VER=${BASH_REMATCH[1]} || die + [[ ${chromium[2]} =~ ^Patched.+:[^0-9]+([0-9.]+$) ]] && + QT6_CHROMIUM_PATCHES_VER=${BASH_REMATCH[1]} || die +} + +src_configure() { + local mycmakeargs=( + $(qt_feature pdfium qtpdf_build) + $(qt_feature qml qtpdf_quick_build) + $(qt_feature webdriver webenginedriver) + $(qt_feature widgets qtpdf_widgets_build) + $(usev pdfium -DQT_FEATURE_pdf_v8=ON) + + -DQT_FEATURE_qtwebengine_build=ON + $(qt_feature qml qtwebengine_quick_build) + $(qt_feature widgets qtwebengine_widgets_build) + + $(cmake_use_find_package designer Qt6Designer) + + $(qt_feature alsa webengine_system_alsa) + $(qt_feature !bindist webengine_proprietary_codecs) + $(qt_feature geolocation webengine_geolocation) + $(qt_feature jumbo-build webengine_jumbo_build) + $(qt_feature kerberos webengine_kerberos) + $(qt_feature pulseaudio webengine_system_pulseaudio) + $(qt_feature screencast webengine_webrtc_pipewire) + $(qt_feature system-icu webengine_system_icu) + $(qt_feature vaapi webengine_vaapi) + $(qt_feature vulkan webengine_vulkan) + -DQT_FEATURE_webengine_embedded_build=OFF + -DQT_FEATURE_webengine_extensions=ON + # TODO: it may be possible to make x11 optional since 6.8+ + -DQT_FEATURE_webengine_ozone_x11=ON + -DQT_FEATURE_webengine_pepper_plugins=ON + -DQT_FEATURE_webengine_printing_and_pdf=ON + -DQT_FEATURE_webengine_spellchecker=ON + -DQT_FEATURE_webengine_webchannel=ON + -DQT_FEATURE_webengine_webrtc=ON + + # needs a modified ffmpeg to be usable (bug #831487), and even then + # it is picky about codecs/version and system's can lead to unexpected + # issues (e.g. builds but some files don't play even with support) + -DQT_FEATURE_webengine_system_ffmpeg=OFF + + # use bundled re2 to avoid complications, Qt has also disabled + # this by default in 6.7.3+ (bug #913923) + -DQT_FEATURE_webengine_system_re2=OFF + + # system_libvpx=ON is intentionally ignored with USE=vaapi which leads + # to using system's being less tested, prefer disabling for now until + # vaapi can use it as well + -DQT_FEATURE_webengine_system_libvpx=OFF + + # not necessary to pass these (default), but in case detection fails + $(printf -- '-DQT_FEATURE_webengine_system_%s=ON ' \ + freetype gbm glib harfbuzz lcms2 libevent libjpeg \ + libopenjpeg2 libpci libpng libtiff libwebp libxml \ + minizip opus poppler snappy zlib) + + # TODO: fixup gn cross, or package dev-qt/qtwebengine-gn with =ON + # (see also BUILD_ONLY_GN option added in 6.8+ for the latter) + -DINSTALL_GN=OFF + ) + + local mygnargs=( + # prefer no dlopen where possible + $(usev pulseaudio link_pulseaudio=true) + $(usev screencast rtc_link_pipewire=true) + # reduce default disk space usage + symbol_level=0 + ) + + if use !custom-cflags; then + strip-flags # fragile + + # temporary workaround for bug #947356, should be fixed in Qt 6.9.x + append-cppflags -U_GLIBCXX_ASSERTIONS + + if is-flagq '-g?(gdb)?([2-9])'; then #914475 + replace-flags '-g?(gdb)?([2-9])' -g1 + ewarn "-g2+/-ggdb* *FLAGS replaced with -g1 (enable USE=custom-cflags to keep)" + fi + + # Built helpers segfault when using (at least) -march=armv8-a+pauth + # (bug #920555, #920568 -- suspected gcc bug). For now, filter all + # for simplicity. Override with USE=custom-cflags if wanted, please + # report if above -march works again so can cleanup. + use arm64 && tc-is-gcc && filter-flags '-march=*' '-mcpu=*' + fi + + export NINJAFLAGS=$(get_NINJAOPTS) + [[ ${NINJA_VERBOSE^^} == OFF ]] || NINJAFLAGS+=" -v" + + local -x EXTRA_GN="${mygnargs[*]} ${EXTRA_GN}" + einfo "Extra Gn args: ${EXTRA_GN}" + + qt6-build_src_configure +} + +src_compile() { + # tentatively work around a possible (rare) race condition (bug #921680) + cmake_build WebEngineCore_sync_all_public_headers + + cmake_src_compile +} + +src_test() { + if [[ ${EUID} == 0 ]]; then + # almost every tests fail, so skip entirely + ewarn "Skipping tests due to running as root (chromium refuses this configuration)." + return + fi + + local CMAKE_SKIP_TESTS=( + # fails with network sandbox + tst_certificateerror + tst_loadsignals + tst_qquickwebengineview + tst_qwebengineglobalsettings + tst_qwebengineview + # fails with offscreen rendering, may be worth retrying if the issue + # persist given these are rather major tests (or consider virtx) + tst_qmltests + tst_qwebenginepage + # certs verfication seems flaky and gives expiration warnings + tst_qwebengineclientcertificatestore + # test is misperformed when qtbase is built USE=-test? + tst_touchinput + # currently requires webenginedriver to be already installed + tst_webenginedriver + ) + + # prevent using the system's qtwebengine + # (use glob to avoid unnecessary complications with arch dir) + local resources=( "${BUILD_DIR}/src/core/${CMAKE_BUILD_TYPE}/"* ) + [[ -d ${resources[0]} ]] || die "invalid resources path: ${resources[0]}" + local -x QTWEBENGINEPROCESS_PATH=${BUILD_DIR}${QT6_LIBEXECDIR#"${QT6_PREFIX}"}/QtWebEngineProcess + local -x QTWEBENGINE_LOCALES_PATH=${resources[0]}/qtwebengine_locales + local -x QTWEBENGINE_RESOURCES_PATH=${resources[0]} + + # random failures in several tests without -j1 + qt6-build_src_test -j1 +} + +src_install() { + qt6-build_src_install + + [[ -e ${D}${QT6_LIBDIR}/libQt6WebEngineCore.so ]] || #601472 + die "${CATEGORY}/${PF} failed to build anything. Please report to https://bugs.gentoo.org/" + + if use test && use webdriver; then + rm -- "${D}${QT6_BINDIR}"/testbrowser || die + fi +} + +pkg_postinst() { + # plugin may also be found in $HOME if provided by chrome or firefox + use amd64 && + optfeature "Widevine DRM support (protected media playback)" \ + www-plugins/chrome-binary-plugins + + elog + elog "This version of Qt WebEngine is based on Chromium version ${QT6_CHROMIUM_VER}, with" + elog "additional security fixes up to ${QT6_CHROMIUM_PATCHES_VER}. Extensive as it is, the" + elog "list of backports is impossible to evaluate, but always bound to be behind" + elog "Chromium's release schedule." + elog + elog "In addition, various online services may deny service based on an outdated" + elog "user agent version (and/or other checks). Google is already known to do so." + elog + elog "tl;dr your web browsing experience will be compromised." +} diff --git a/dev-qt/qtwebengine/qtwebengine-6.8.2.ebuild b/dev-qt/qtwebengine/qtwebengine-6.8.2.ebuild deleted file mode 100644 index 0988f8bb29d5..000000000000 --- a/dev-qt/qtwebengine/qtwebengine-6.8.2.ebuild +++ /dev/null @@ -1,335 +0,0 @@ -# Copyright 2021-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..13} ) -PYTHON_REQ_USE="xml(+)" -inherit check-reqs flag-o-matic multiprocessing optfeature -inherit prefix python-any-r1 qt6-build toolchain-funcs - -DESCRIPTION="Library for rendering dynamic web content in Qt6 C++ and QML applications" -SRC_URI+=" - https://dev.gentoo.org/~ionen/distfiles/${PN}-6.8-patchset-7.tar.xz -" - -if [[ ${QT6_BUILD_TYPE} == release ]]; then - KEYWORDS="~amd64 ~arm64" -fi - -IUSE=" - accessibility +alsa bindist custom-cflags designer geolocation - +jumbo-build kerberos opengl pdfium pulseaudio qml screencast - +system-icu vaapi vulkan webdriver +widgets -" -REQUIRED_USE=" - designer? ( qml widgets ) -" - -# dlopen: krb5, libva, pciutils, udev -# gcc: for -latomic -RDEPEND=" - app-arch/snappy:= - dev-libs/expat - dev-libs/libevent:= - dev-libs/libxml2[icu] - dev-libs/libxslt - dev-libs/nspr - dev-libs/nss - ~dev-qt/qtbase-${PV}:6[accessibility=,gui,opengl=,vulkan?,widgets?] - ~dev-qt/qtdeclarative-${PV}:6[widgets?] - ~dev-qt/qtwebchannel-${PV}:6[qml?] - media-libs/fontconfig - media-libs/freetype - media-libs/harfbuzz:= - media-libs/lcms:2 - media-libs/libjpeg-turbo:= - media-libs/libpng:= - media-libs/libwebp:= - media-libs/mesa[gbm(+)] - media-libs/openjpeg:2= - media-libs/opus - media-libs/tiff:= - sys-apps/dbus - sys-apps/pciutils - sys-devel/gcc:* - sys-libs/zlib:=[minizip] - virtual/libudev - x11-libs/libX11 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXext - x11-libs/libXfixes - x11-libs/libXrandr - x11-libs/libXtst - x11-libs/libdrm - x11-libs/libxcb:= - x11-libs/libxkbcommon - x11-libs/libxkbfile - alsa? ( media-libs/alsa-lib ) - designer? ( ~dev-qt/qttools-${PV}:6[designer] ) - geolocation? ( ~dev-qt/qtpositioning-${PV}:6 ) - kerberos? ( virtual/krb5 ) - pulseaudio? ( media-libs/libpulse[glib] ) - screencast? ( - dev-libs/glib:2 - media-video/pipewire:= - ) - system-icu? ( dev-libs/icu:= ) - vaapi? ( media-libs/libva:=[X] ) -" -DEPEND=" - ${RDEPEND} - media-libs/libglvnd - x11-base/xorg-proto - x11-libs/libXcursor - x11-libs/libXi - x11-libs/libxshmfence - opengl? ( media-libs/libglvnd[X] ) - screencast? ( media-libs/libepoxy[egl(+)] ) - test? ( - widgets? ( app-text/poppler[cxx(+)] ) - ) - vaapi? ( - vulkan? ( dev-util/vulkan-headers ) - ) -" -BDEPEND=" - $(python_gen_any_dep 'dev-python/html5lib[${PYTHON_USEDEP}]') - dev-util/gperf - net-libs/nodejs[ssl] - sys-devel/bison - sys-devel/flex -" - -PATCHES=( "${WORKDIR}"/patches/${PN} ) -[[ ${PV} == 6.9999 ]] || # too fragile for 6.9999, but keep for 6.x.9999 - PATCHES+=( "${WORKDIR}"/patches/chromium ) - -PATCHES+=( - # add extras as needed here, may merge in set if carries across versions - "${FILESDIR}"/${PN}-6.8.1-aarch64-xnnpack.patch - "${FILESDIR}"/${PN}-6.8.1-cstdint.patch -) - -python_check_deps() { - python_has_version "dev-python/html5lib[${PYTHON_USEDEP}]" -} - -qtwebengine_check-reqs() { - [[ ${MERGE_TYPE} == binary ]] && return - - if is-flagq '-g?(gdb)?([1-9])'; then #307861 - ewarn - ewarn "Used CFLAGS/CXXFLAGS seem to enable debug info (-g or -ggdb), which" - ewarn "is non-trivial with ${PN}. May experience extended compilation" - ewarn "times, increased disk/memory usage, and potentially link failure." - ewarn - ewarn "If run into issues, please try disabling before reporting a bug." - fi - - local CHECKREQS_DISK_BUILD=9G - local CHECKREQS_DISK_USR=360M - - if ! has distcc ${FEATURES}; then #830661 - # assume ~2GB per job or 1.5GB if clang, possible with less - # depending on free memory and *FLAGS, but prefer being safe as - # users having OOM issues with qtwebengine been rather common - tc-is-clang && : 15 || : 20 - local CHECKREQS_MEMORY=$(($(makeopts_jobs)*_/10))G - fi - - check-reqs_${EBUILD_PHASE_FUNC} #570534 -} - -pkg_pretend() { - qtwebengine_check-reqs -} - -pkg_setup() { - qtwebengine_check-reqs - python-any-r1_pkg_setup -} - -src_prepare() { - qt6-build_src_prepare - - # for www-plugins/chrome-binary-plugins (widevine) search paths on prefix - hprefixify -w /Gentoo/ src/core/content_client_qt.cpp - - # store chromium versions, only used in postinst for a warning - local chromium - mapfile -t chromium < CHROMIUM_VERSION || die - [[ ${chromium[1]} =~ ^Based.*:[^0-9]+([0-9.]+$) ]] && - QT6_CHROMIUM_VER=${BASH_REMATCH[1]} || die - [[ ${chromium[2]} =~ ^Patched.+:[^0-9]+([0-9.]+$) ]] && - QT6_CHROMIUM_PATCHES_VER=${BASH_REMATCH[1]} || die -} - -src_configure() { - local mycmakeargs=( - $(qt_feature pdfium qtpdf_build) - $(qt_feature qml qtpdf_quick_build) - $(qt_feature webdriver webenginedriver) - $(qt_feature widgets qtpdf_widgets_build) - $(usev pdfium -DQT_FEATURE_pdf_v8=ON) - - -DQT_FEATURE_qtwebengine_build=ON - $(qt_feature qml qtwebengine_quick_build) - $(qt_feature widgets qtwebengine_widgets_build) - - $(cmake_use_find_package designer Qt6Designer) - - $(qt_feature alsa webengine_system_alsa) - $(qt_feature !bindist webengine_proprietary_codecs) - $(qt_feature geolocation webengine_geolocation) - $(qt_feature jumbo-build webengine_jumbo_build) - $(qt_feature kerberos webengine_kerberos) - $(qt_feature pulseaudio webengine_system_pulseaudio) - $(qt_feature screencast webengine_webrtc_pipewire) - $(qt_feature system-icu webengine_system_icu) - $(qt_feature vaapi webengine_vaapi) - $(qt_feature vulkan webengine_vulkan) - -DQT_FEATURE_webengine_embedded_build=OFF - -DQT_FEATURE_webengine_extensions=ON - # TODO: it may be possible to make x11 optional since 6.8+ - -DQT_FEATURE_webengine_ozone_x11=ON - -DQT_FEATURE_webengine_pepper_plugins=ON - -DQT_FEATURE_webengine_printing_and_pdf=ON - -DQT_FEATURE_webengine_spellchecker=ON - -DQT_FEATURE_webengine_webchannel=ON - -DQT_FEATURE_webengine_webrtc=ON - - # needs a modified ffmpeg to be usable (bug #831487), and even then - # it is picky about codecs/version and system's can lead to unexpected - # issues (e.g. builds but some files don't play even with support) - -DQT_FEATURE_webengine_system_ffmpeg=OFF - - # use bundled re2 to avoid complications, Qt has also disabled - # this by default in 6.7.3+ (bug #913923) - -DQT_FEATURE_webengine_system_re2=OFF - - # system_libvpx=ON is intentionally ignored with USE=vaapi which leads - # to using system's being less tested, prefer disabling for now until - # vaapi can use it as well - -DQT_FEATURE_webengine_system_libvpx=OFF - - # not necessary to pass these (default), but in case detection fails - $(printf -- '-DQT_FEATURE_webengine_system_%s=ON ' \ - freetype gbm glib harfbuzz lcms2 libevent libjpeg \ - libopenjpeg2 libpci libpng libtiff libwebp libxml \ - minizip opus poppler snappy zlib) - - # TODO: fixup gn cross, or package dev-qt/qtwebengine-gn with =ON - # (see also BUILD_ONLY_GN option added in 6.8+ for the latter) - -DINSTALL_GN=OFF - ) - - local mygnargs=( - # prefer no dlopen where possible - $(usev pulseaudio link_pulseaudio=true) - $(usev screencast rtc_link_pipewire=true) - # reduce default disk space usage - symbol_level=0 - ) - - if use !custom-cflags; then - strip-flags # fragile - - # temporary workaround for bug #947356, should be fixed in Qt 6.9.x - append-cppflags -U_GLIBCXX_ASSERTIONS - - if is-flagq '-g?(gdb)?([2-9])'; then #914475 - replace-flags '-g?(gdb)?([2-9])' -g1 - ewarn "-g2+/-ggdb* *FLAGS replaced with -g1 (enable USE=custom-cflags to keep)" - fi - - # Built helpers segfault when using (at least) -march=armv8-a+pauth - # (bug #920555, #920568 -- suspected gcc bug). For now, filter all - # for simplicity. Override with USE=custom-cflags if wanted, please - # report if above -march works again so can cleanup. - use arm64 && tc-is-gcc && filter-flags '-march=*' '-mcpu=*' - fi - - export NINJAFLAGS=$(get_NINJAOPTS) - [[ ${NINJA_VERBOSE^^} == OFF ]] || NINJAFLAGS+=" -v" - - local -x EXTRA_GN="${mygnargs[*]} ${EXTRA_GN}" - einfo "Extra Gn args: ${EXTRA_GN}" - - qt6-build_src_configure -} - -src_compile() { - # tentatively work around a possible (rare) race condition (bug #921680) - cmake_build WebEngineCore_sync_all_public_headers - - cmake_src_compile -} - -src_test() { - if [[ ${EUID} == 0 ]]; then - # almost every tests fail, so skip entirely - ewarn "Skipping tests due to running as root (chromium refuses this configuration)." - return - fi - - local CMAKE_SKIP_TESTS=( - # fails with network sandbox - tst_certificateerror - tst_loadsignals - tst_qquickwebengineview - tst_qwebengineglobalsettings - tst_qwebengineview - # fails with offscreen rendering, may be worth retrying if the issue - # persist given these are rather major tests (or consider virtx) - tst_qmltests - tst_qwebenginepage - # certs verfication seems flaky and gives expiration warnings - tst_qwebengineclientcertificatestore - # test is misperformed when qtbase is built USE=-test? - tst_touchinput - # currently requires webenginedriver to be already installed - tst_webenginedriver - ) - - # prevent using the system's qtwebengine - # (use glob to avoid unnecessary complications with arch dir) - local resources=( "${BUILD_DIR}/src/core/${CMAKE_BUILD_TYPE}/"* ) - [[ -d ${resources[0]} ]] || die "invalid resources path: ${resources[0]}" - local -x QTWEBENGINEPROCESS_PATH=${BUILD_DIR}${QT6_LIBEXECDIR#"${QT6_PREFIX}"}/QtWebEngineProcess - local -x QTWEBENGINE_LOCALES_PATH=${resources[0]}/qtwebengine_locales - local -x QTWEBENGINE_RESOURCES_PATH=${resources[0]} - - # random failures in several tests without -j1 - qt6-build_src_test -j1 -} - -src_install() { - qt6-build_src_install - - [[ -e ${D}${QT6_LIBDIR}/libQt6WebEngineCore.so ]] || #601472 - die "${CATEGORY}/${PF} failed to build anything. Please report to https://bugs.gentoo.org/" - - if use test && use webdriver; then - rm -- "${D}${QT6_BINDIR}"/testbrowser || die - fi -} - -pkg_postinst() { - # plugin may also be found in $HOME if provided by chrome or firefox - use amd64 && - optfeature "Widevine DRM support (protected media playback)" \ - www-plugins/chrome-binary-plugins - - elog - elog "This version of Qt WebEngine is based on Chromium version ${QT6_CHROMIUM_VER}, with" - elog "additional security fixes up to ${QT6_CHROMIUM_PATCHES_VER}. Extensive as it is, the" - elog "list of backports is impossible to evaluate, but always bound to be behind" - elog "Chromium's release schedule." - elog - elog "In addition, various online services may deny service based on an outdated" - elog "user agent version (and/or other checks). Google is already known to do so." - elog - elog "tl;dr your web browsing experience will be compromised." -} -- cgit v1.2.3