diff --git a/www-client/cromite/Manifest b/www-client/cromite/Manifest new file mode 100644 index 000000000..3502be1c0 --- /dev/null +++ b/www-client/cromite/Manifest @@ -0,0 +1,5 @@ +DIST chromium-116-patchset-2.tar.xz 5944 BLAKE2B bc67611ecfa93c75e1df8e05f1cabf432bfb807b7fefeb277ff4465f233a159128fecc5b0dd6e3f4954221ac675ff3e25d225352260a695d63f26b1ca6376003 SHA512 705950b3a679714adc14ae81ec51d637ba3bcbeff6dad30d9bbacec36ec6e1776534b8d1ad85fc7e838adeb588566e195a271a9ec220015d343a3038af705456 +DIST chromium-116.0.5845.140.tar.xz 1599642528 BLAKE2B f25afb7b7aaf6ba5c7969b907fcb0a662cdc7a07aa94d3c38f5ab508c62554f405ac418794b38f9b3b12dec73182c18eafb6d87dee75b248bf1fbe05d970dec4 SHA512 309611f56b64b8b40c27d339fc87de35429905791e24e493f2d2792b56a998d81c66e3cae1c9de728c7131c60bedee76b5b42a7a8694d3fb26c48c986489d433 +DIST chromium-ppc64le-gentoo-patches-1.tar.xz 5636 BLAKE2B 1d898939df023c59285b27bee552470483ea06375d1ee8d6947b89c5927c23cc7bfec6b49f3b376ece931d11a56f8e2a45791e0f92ad61974fc8c34c1082d89c SHA512 8a71cb007e47cda8e5fe5d185729389e65c48bd322c8ee8b3986bee8571427b959628f2666bda646a3f89ae64197c0957d3626845ff03461dbd5dee4c964d07c +DIST chromium_116.0.5845.110-2raptor0~deb11u1.debian.tar.xz 1672712 BLAKE2B db6ec1a06d2994580e107500dcebeb77eb3b7c3965c29451ae42eb46dc6ed541172b8495a39343ef82536a7a3c8d1e78b8e9d0bb83fa67ea5dee34771d9b4913 SHA512 bc20ba713712f74dd0bb28edb9784fcd986c6cfd8219e69cce1f5660cdf003d1b53f86d67b17eeab7bf39af6d543ad7e8227734e0f5771ab421bfcb3f15e2dd0 +DIST cromite-bf086af7df35bef641790d3f00c4d9ab27392b83.tar.gz 13465518 BLAKE2B 139518f00fb3c49388bc834a757c606dc95238bd09fba7125dc8125c32d281b2ab70e4a2af8bc3424a9a293a4256fc92588803daf4214aa150c17d462e4b0110 SHA512 7756be56ad109013bfa9f27487b2a576d4cd841f7ccc050a4e21456b316562d63164f163b813d4d37fa118bc445a5e282f8c8fabd4a77c8698bae64783d40b84 diff --git a/www-client/cromite/cromite-116.0.5845.140.ebuild b/www-client/cromite/cromite-116.0.5845.140.ebuild new file mode 100644 index 000000000..7e2737bb7 --- /dev/null +++ b/www-client/cromite/cromite-116.0.5845.140.ebuild @@ -0,0 +1,1486 @@ +# Copyright 2009-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE="xml(+)" + +CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he + hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr + sv sw ta te th tr uk ur vi zh-CN zh-TW" + +inherit check-reqs chromium-2 desktop flag-o-matic llvm ninja-utils pax-utils +inherit python-any-r1 qmake-utils readme.gentoo-r1 toolchain-funcs xdg-utils + +# Use following environment variables to customise the build +# EXTRA_GN — pass extra options to gn +# NINJAOPTS="-k0 -j8" useful to populate ccache even if ebuild is still failing + +CROMITE_COMMIT_ID="bf086af7df35bef641790d3f00c4d9ab27392b83" +# CROMITE_PR_COMMITS=( +# c917e096342e5b90eeea91ab1f8516447c8756cf +# 5794e9d12bf82620d5f24505798fecb45ca5a22d +# ) + +DESCRIPTION="Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser!" +HOMEPAGE="https://github.com/uazo/cromite" +PATCHSET="2" +PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}" +PATCHSET_PPC64="116.0.5845.110-2raptor0~deb11u1" +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${PV/_*}.tar.xz + https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz + https://github.com/uazo/${PN}/archive/${CROMITE_COMMIT_ID}.tar.gz -> ${PN}-${CROMITE_COMMIT_ID}.tar.gz + ppc64? ( + https://quickbuild.io/~raptor-engineering-public/+archive/ubuntu/chromium/+files/chromium_${PATCHSET_PPC64}.debian.tar.xz + https://dev.gentoo.org/~sultan/distfiles/www-client/chromium/chromium-ppc64le-gentoo-patches-1.tar.xz + ) +" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="+X bluetooth cfi +clang convert-dict cups cpu_flags_arm_neon custom-cflags debug enable-driver gtk4 hangouts headless hevc kerberos nvidia +official optimize-thinlto optimize-webui pax-kernel pgo pic +proprietary-codecs pulseaudio qt5 qt6 screencast selinux suid system-abseil-cpp system-av1 system-brotli system-crc32c system-double-conversion +system-ffmpeg +system-harfbuzz +system-icu +system-jsoncpp +system-libevent +system-libusb system-libvpx +system-openh264 system-openjpeg +system-png system-re2 +system-snappy system-woff2 thinlto vaapi wayland widevine" +RESTRICT=" + !system-ffmpeg? ( proprietary-codecs? ( bindist ) ) + !system-openh264? ( bindist ) +" +REQUIRED_USE=" + thinlto? ( clang ) + optimize-thinlto? ( thinlto ) + cfi? ( thinlto ) + pgo? ( clang ) + x86? ( !thinlto !widevine ) + screencast? ( wayland ) + !headless? ( || ( X wayland ) ) + !proprietary-codecs? ( !hevc ) + hevc? ( system-ffmpeg ) + vaapi? ( !system-av1 !system-libvpx ) + qt6? ( qt5 ) +" + +# CHROMIUM_COMMITS=( +# ddfcc907907a20d9f8fbc1416492e2093b339b22 +# 6ab6fdfe3d403b6917069957c707e6822b873962 +# a818a8afbb4e21efb3f261543ccd83081fc30636 +# ) + +if [ ! -z "${CROMITE_PR_COMMITS[*]}" ]; then + for i in "${CROMITE_PR_COMMITS[@]}"; do + SRC_URI+="https://github.com/uazo/${PN}/commit/$i.patch -> ${PN}-$i.patch + " + done +fi + +if [ ! -z "${CHROMIUM_COMMITS[*]}" ]; then + for i in "${CHROMIUM_COMMITS[@]}"; do + SRC_URI+="https://github.com/chromium/chromium/commit/${i/-}.patch -> chromium-${i/-}.patch + " + done +fi + +COMMON_X_DEPEND=" + x11-libs/libXcomposite:= + x11-libs/libXcursor:= + x11-libs/libXdamage:= + x11-libs/libXfixes:= + >=x11-libs/libXi-1.6.0:= + x11-libs/libXrandr:= + x11-libs/libXrender:= + x11-libs/libXtst:= + x11-libs/libxshmfence:= +" + +COMMON_SNAPSHOT_DEPEND=" + system-abseil-cpp? ( >=dev-cpp/abseil-cpp-20230125.2 ) + system-brotli? ( >=app-arch/brotli-9999 ) + system-crc32c? ( dev-libs/crc32c ) + system-double-conversion? ( dev-libs/double-conversion ) + system-woff2? ( media-libs/woff2 ) + system-snappy? ( app-arch/snappy ) + system-jsoncpp? ( dev-libs/jsoncpp ) + system-libevent? ( dev-libs/libevent ) + system-openjpeg? ( media-libs/openjpeg:2= ) + system-re2? ( >=dev-libs/re2-0.2019.08.01:= ) + system-libvpx? ( >=media-libs/libvpx-1.13.0:=[postproc] ) + system-libusb? ( virtual/libusb:1 ) + system-icu? ( >=dev-libs/icu-71.1:= ) + >=dev-libs/libxml2-2.9.4-r3:=[icu] + dev-libs/nspr:= + >=dev-libs/nss-3.26:= + dev-libs/libxslt:= + media-libs/fontconfig:= + >=media-libs/freetype-2.11.0-r1:= + system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] ) + media-libs/libjpeg-turbo:= + system-png? ( media-libs/libpng:= ) + >=media-libs/libwebp-0.4.0:= + media-libs/mesa:=[gbm(+)] + >=media-libs/openh264-1.6.0:= + system-av1? ( + >=media-libs/dav1d-1.0.0:= + >=media-libs/libaom-3.7.0:= + ) + sys-libs/zlib:= + x11-libs/libdrm:= + !headless? ( + dev-libs/glib:2 + >=media-libs/alsa-lib-1.0.19:= + pulseaudio? ( + || ( + media-libs/libpulse + >=media-sound/apulse-0.1.9 + ) + ) + sys-apps/pciutils:= + kerberos? ( virtual/krb5 ) + vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] ) + X? ( + x11-libs/libX11:= + x11-libs/libXext:= + x11-libs/libxcb:= + ) + x11-libs/libxkbcommon:= + wayland? ( + dev-libs/libffi:= + screencast? ( media-video/pipewire:= ) + ) + ) +" + +COMMON_DEPEND=" + ${COMMON_SNAPSHOT_DEPEND} + app-arch/bzip2:= + dev-libs/expat:= + system-ffmpeg? ( + >=media-video/ffmpeg-4.3:= + || ( + media-video/ffmpeg[-samba] + >=net-fs/samba-4.5.10-r1[-debug(-)] + ) + >=media-libs/opus-1.3.1:= + ) + net-misc/curl[ssl] + sys-apps/dbus:= + media-libs/flac:= + sys-libs/zlib:=[minizip] + !headless? ( + X? ( ${COMMON_X_DEPEND} ) + >=app-accessibility/at-spi2-core-2.46.0:2 + media-libs/mesa:=[X?,wayland?] + cups? ( >=net-print/cups-1.3.11:= ) + virtual/udev + x11-libs/cairo:= + x11-libs/gdk-pixbuf:2 + x11-libs/pango:= + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtwidgets:5 + ) + qt6? ( dev-qt/qtbase:6[gui,widgets] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + !headless? ( + || ( + x11-libs/gtk+:3[X?,wayland?] + gui-libs/gtk:4[X?,wayland?] + ) + qt5? ( dev-qt/qtgui:5[X?,wayland?] ) + qt6? ( dev-qt/qtbase:6[X?,wayland?] ) + ) + virtual/ttf-fonts + selinux? ( sec-policy/selinux-chromium ) + !www-client/chromium + !www-client/chromium-bin + !www-client/ungoogled-chromium-bin +" + +DEPEND="${COMMON_DEPEND} + !headless? ( + gtk4? ( gui-libs/gtk:4[X?,wayland?] ) + !gtk4? ( x11-libs/gtk+:3[X?,wayland?] ) + ) +" + +BDEPEND=" + ${COMMON_SNAPSHOT_DEPEND} + ${PYTHON_DEPS} + $(python_gen_any_dep ' + dev-python/setuptools[${PYTHON_USEDEP}] + ') + >=app-arch/gzip-1.7 + !headless? ( + qt5? ( dev-qt/qtcore:5 ) + qt6? ( dev-qt/qtbase:6 ) + ) + dev-lang/perl + >=dev-util/gn-0.1807 + >=dev-util/gperf-3.0.3 + >=dev-util/ninja-1.7.2 + dev-vcs/git + >=net-libs/nodejs-7.6.0[inspector] + >=sys-devel/bison-2.4.3 + sys-devel/flex + virtual/pkgconfig + clang? ( + pgo? ( >=sys-devel/clang-17 >=sys-devel/lld-17 ) + !pgo? ( sys-devel/clang sys-devel/lld ) + ) + cfi? ( sys-devel/clang-runtime[sanitize] ) +" + +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then + EBUILD_DEATH_HOOKS+=" chromium_pkg_die"; +fi + +DISABLE_AUTOFORMATTING="yes" +DOC_CONTENTS=" +Some web pages may require additional fonts to display properly. +Try installing some of the following packages if some characters +are not displayed properly: +- media-fonts/arphicfonts +- media-fonts/droid +- media-fonts/ipamonafont +- media-fonts/noto +- media-fonts/ja-ipafonts +- media-fonts/takao-fonts +- media-fonts/wqy-microhei +- media-fonts/wqy-zenhei + +To fix broken icons on the Downloads page, you should install an icon +theme that covers the appropriate MIME types, and configure this as your +GTK+ icon theme. + +For native file dialogs in KDE, install kde-apps/kdialog. + +To make password storage work with your desktop environment you may +have install one of the supported credentials management applications: +- app-crypt/libsecret (GNOME) +- kde-frameworks/kwallet (KDE) +If you have one of above packages installed, but don't want to use +them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS +in /etc/chromium/default. +" + +S="${WORKDIR}/chromium-${PV/_*}" + +python_check_deps() { + python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]" +} + +pre_build_checks() { + # Check build requirements, bug #541816 and bug #471810 . + CHECKREQS_MEMORY="4G" + CHECKREQS_DISK_BUILD="14G" + tc-is-cross-compiler && CHECKREQS_DISK_BUILD="16G" + if is-flagq '-g?(gdb)?([1-9])'; then + CHECKREQS_DISK_BUILD="16G" + fi + check-reqs_${EBUILD_PHASE_FUNC} +} + +pkg_pretend() { + if has_version "sys-libs/libcxx"; then + ewarn + ewarn "You have sys-libs/libcxx, please be aware that system-*" + ewarn "and some other c++ dependencies need to be compiled" + ewarn "with the same library as ungoogled-chromium itself" + ewarn "dev-libs/jsoncpp is most problematic, see #58 #49 #119 for details" + ewarn + fi + if use cfi; then + ewarn + ewarn "Building with cfi is only possible if building with -stdlib=libc++" + ewarn "Make sure all dependencies are also built this way, see #40" + ewarn + fi + if use uazo-bromite; then + ewarn + ewarn "uazo-bromite patches are very experimental and unstable" + ewarn "Please consider testing them and giving feedback upstream:" + ewarn "https://github.com/uazo/cromite/issues" + ewarn "Not all patches are applied, let me know if any other are worthy of inclusion" + ewarn + fi + if use system-abseil-cpp; then + ewarn + ewarn "Chromium code is not very friendly to system abseil-cpp, see #218" + ewarn "If you know how to fix this, feel free to submit a PR" + ewarn + [[ -z "${NODIE}" ]] && die "The build will fail!" + fi + pre_build_checks + + if use headless; then + local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt5" "qt6" "vaapi" "wayland") + for myiuse in ${headless_unused_flags[@]}; do + use ${myiuse} && ewarn "Ignoring USE=${myiuse} since USE=headless is set." + done + fi +} + +pkg_setup() { + pre_build_checks + + chromium_suid_sandbox_check_kernel_config +} + +src_prepare() { + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + if ! use custom-cflags; then #See #25 #92 + sed -i '/default_stack_frames/Q' ${WORKDIR}/patches/chromium-*-compiler.patch || die + fi + + # disable global media controls, crashes with libstdc++ + sed -i -e \ + "/\"GlobalMediaControlsCastStartStop\",/{n;s/ENABLED/DISABLED/;}" \ + "chrome/browser/media/router/media_router_feature.cc" || die + + local PATCHES=( + "${WORKDIR}/patches" + "${FILESDIR}/chromium-cross-compile.patch" + "${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch" + "${FILESDIR}/chromium-qt6.patch" + "${FILESDIR}/chromium-98-gtk4-build.patch" + "${FILESDIR}/chromium-108-EnumTable-crash.patch" + "${FILESDIR}/chromium-109-system-openh264.patch" + "${FILESDIR}/chromium-109-system-zlib.patch" + "${FILESDIR}/chromium-111-InkDropHost-crash.patch" + "${FILESDIR}/chromium-114-remove-evdev-dep.patch" + "${FILESDIR}/chromium-115-binutils-2.41.patch" + "${FILESDIR}/perfetto-system-zlib.patch" + "${FILESDIR}/gtk-fix-prefers-color-scheme-query.diff" + "${FILESDIR}/restore-x86-r2.patch" + ) + + if [ ! -z "${CHROMIUM_COMMITS[*]}" ]; then + for i in "${CHROMIUM_COMMITS[@]}"; do + if [[ $i = -* ]]; then + eapply -R "${DISTDIR}/chromium-${i/-}.patch" || die + else + PATCHES+=( "${DISTDIR}/chromium-$i.patch" ) + fi + done + fi + + if use ppc64 ; then + local p + for p in $(grep -v "^#" "${WORKDIR}"/debian/patches/series | grep "^ppc64le" || die); do + if [[ ! $p =~ "fix-breakpad-compile.patch" ]]; then + eapply "${WORKDIR}/debian/patches/${p}" + fi + done + PATCHES+=( "${WORKDIR}/ppc64le" ) + fi + + default + + + mkdir -p third_party/node/linux/node-linux-x64/bin || die + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die + + # adjust python interpreter version + sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die + sed -i -e "s|vpython3|${EPYTHON}|g" testing/xvfb.py || die + + cp "${FILESDIR}/libusb.gn" build/linux/unbundle || die + sed -i '/^REPLACEMENTS.*$/{s++REPLACEMENTS = {"libusb":"third_party/libusb/BUILD.gn",+;h};${x;/./{x;q0};x;q1}' \ + build/linux/unbundle/replace_gn_files.py || die + sed -i '/^.*deps.*third_party\/jsoncpp.*$/{s++public_deps = [ "//third_party/jsoncpp" ]+;h};${x;/./{x;q0};x;q1}' \ + third_party/webrtc/rtc_base/BUILD.gn || die + + use bluetooth || eapply "${FILESDIR}/disable-bluez.patch" + + use convert-dict && eapply "${FILESDIR}/chromium-ucf-dict-utility.patch" + + if use hevc; then + sed -i '/^bool IsHevcProfileSupported(const VideoType& type) {$/{s++bool IsHevcProfileSupported(const VideoType\& type) { return true;+;h};${x;/./{x;q0};x;q1}' \ + media/base/supported_types.cc || die + fi + + if use system-abseil-cpp; then + eapply "${FILESDIR}/chromium-system-abseil.patch" + cp -f /usr/include/absl/base/options.h third_party/abseil-cpp/absl/base/options.h + sed -i '/^#define ABSL_OPTION_USE_STD_OPTIONAL.*$/{s++#define ABSL_OPTION_USE_STD_OPTIONAL 0+;h};${x;/./{x;q0};x;q1}' \ + third_party/abseil-cpp/absl/base/options.h || die + fi + + use system-brotli && eapply "${FILESDIR}/chromium-system-brotli.patch" + + use system-ffmpeg && eapply "${FILESDIR}/chromium-99-opus.patch" + + if use system-ffmpeg; then + if has_version "/dev/null + for i in "${CROMITE_PR_COMMITS[@]}"; do + eapply "${DISTDIR}/${PN}-$i.patch" + done + popd >/dev/null + fi + + readarray -t topatch < "${WORKDIR}/cromite-${CROMITE_COMMIT_ID}/build/bromite_patches_list.txt" + for i in "${topatch[@]}"; do + einfo "$i" + # ebegin "$i" + git apply --exclude="*/web_tests/*" --exclude="*/test-list/*" \ + --exclude="*/uv/test/*" --exclude="*.rst" \ + --exclude="*/cctest/*" --exclude="*/unittests/*" \ + --exclude="*/test/data/*" --exclude="*/.eslintrc*" \ + -p1 < "${WORKDIR}/cromite-${CROMITE_COMMIT_ID}/build/patches/$i" || die + # eend $? || die + popd > /dev/null || die + done + + local keeplibs=( + base/third_party/cityhash + ) + use system-double-conversion || keeplibs+=( + base/third_party/double_conversion + ) + keeplibs+=( + base/third_party/dynamic_annotations + base/third_party/icu + base/third_party/nspr + base/third_party/superfasthash + base/third_party/symbolize + base/third_party/valgrind + base/third_party/xdg_mime + base/third_party/xdg_user_dirs + buildtools/third_party/libc++ + buildtools/third_party/libc++abi + chrome/third_party/mozilla_security_manager + courgette/third_party + net/third_party/mozilla_security_manager + net/third_party/nss + net/third_party/quic + net/third_party/uri_template + third_party/abseil-cpp/absl/base + ) + use system-abseil-cpp || keeplibs+=( + third_party/abseil-cpp + ) + keeplibs+=( + third_party/angle + third_party/angle/src/common/third_party/xxhash + third_party/angle/src/third_party/ceval + ) + use nvidia || keeplibs+=( + third_party/angle/src/third_party/libXNVCtrl + ) + keeplibs+=( + third_party/angle/src/third_party/systeminfo + third_party/angle/src/third_party/volk + third_party/apple_apsl + third_party/axe-core + third_party/blink + third_party/bidimapper + third_party/boringssl + third_party/boringssl/src/third_party/fiat + third_party/breakpad + third_party/breakpad/breakpad/src/third_party/curl + ) + use system-brotli || keeplibs+=( + third_party/brotli + ) + keeplibs+=( + third_party/catapult + third_party/catapult/common/py_vulcanize/third_party/rcssmin + third_party/catapult/common/py_vulcanize/third_party/rjsmin + third_party/catapult/third_party/beautifulsoup4-4.9.3 + third_party/catapult/third_party/html5lib-1.1 + third_party/catapult/third_party/polymer + third_party/catapult/third_party/six + third_party/catapult/tracing/third_party/d3 + third_party/catapult/tracing/third_party/gl-matrix + third_party/catapult/tracing/third_party/jpeg-js + third_party/catapult/tracing/third_party/jszip + third_party/catapult/tracing/third_party/mannwhitneyu + third_party/catapult/tracing/third_party/oboe + third_party/catapult/tracing/third_party/pako + third_party/ced + third_party/cld_3 + third_party/closure_compiler + third_party/content_analysis_sdk + third_party/cpuinfo + third_party/crashpad + third_party/crashpad/crashpad/third_party/lss + third_party/crashpad/crashpad/third_party/zlib + ) + use system-crc32c || keeplibs+=( + third_party/crc32c + ) + keeplibs+=( + third_party/cros_system_api + third_party/d3 + third_party/dawn + third_party/dawn/third_party/gn/webgpu-cts + third_party/dawn/third_party/khronos + third_party/depot_tools + third_party/devscripts + third_party/devtools-frontend + third_party/devtools-frontend/src/front_end/third_party/acorn + third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json + third_party/devtools-frontend/src/front_end/third_party/axe-core + third_party/devtools-frontend/src/front_end/third_party/chromium + third_party/devtools-frontend/src/front_end/third_party/codemirror + third_party/devtools-frontend/src/front_end/third_party/diff + third_party/devtools-frontend/src/front_end/third_party/i18n + third_party/devtools-frontend/src/front_end/third_party/intl-messageformat + third_party/devtools-frontend/src/front_end/third_party/lighthouse + third_party/devtools-frontend/src/front_end/third_party/lit + third_party/devtools-frontend/src/front_end/third_party/lodash-isequal + third_party/devtools-frontend/src/front_end/third_party/marked + third_party/devtools-frontend/src/front_end/third_party/puppeteer + third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt + third_party/devtools-frontend/src/front_end/third_party/vscode.web-custom-data + third_party/devtools-frontend/src/front_end/third_party/wasmparser + third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n + third_party/devtools-frontend/src/third_party + third_party/distributed_point_functions + third_party/dom_distiller_js + third_party/eigen3 + third_party/emoji-segmenter + third_party/farmhash + third_party/fdlibm + third_party/fft2d + third_party/flatbuffers + third_party/fp16 + third_party/freetype + third_party/fusejs + third_party/fxdiv + third_party/highway + third_party/liburlpattern + third_party/libzip + third_party/gemmlowp + third_party/google_input_tools + third_party/google_input_tools/third_party/closure_library + third_party/google_input_tools/third_party/closure_library/third_party/closure + third_party/googletest + third_party/hunspell + third_party/iccjpeg + third_party/inspector_protocol + third_party/ipcz + third_party/jinja2 + ) + use system-jsoncpp || keeplibs+=( + third_party/jsoncpp + ) + keeplibs+=( + third_party/jstemplate + third_party/khronos + third_party/leveldatabase + third_party/libaddressinput + third_party/libavif + ) + use system-libevent || keeplibs+=( + third_party/libevent + ) + keeplibs+=( + third_party/libgav1 + third_party/libjingle + third_party/libphonenumber + third_party/libsecret + third_party/libsrtp + third_party/libsync + third_party/libudev + ) + use system-libusb || keeplibs+=( + third_party/libusb + ) + keeplibs+=( + third_party/libva_protected_content + ) + use system-libvpx || keeplibs+=( + third_party/libvpx + third_party/libvpx/source/libvpx/third_party/x86inc + ) + keeplibs+=( + third_party/libwebm + third_party/libx11 + third_party/libxcb-keysyms + third_party/libxml/chromium + third_party/libyuv + third_party/llvm + third_party/lottie + third_party/lss + third_party/lzma_sdk + third_party/mako + third_party/maldoca + third_party/maldoca/src/third_party/tensorflow_protos + third_party/maldoca/src/third_party/zlibwrapper + third_party/markupsafe + third_party/material_color_utilities + third_party/mesa + third_party/metrics_proto + third_party/minigbm + third_party/modp_b64 + third_party/nasm + third_party/nearby + third_party/neon_2_sse + third_party/node + third_party/omnibox_proto + third_party/one_euro_filter + third_party/openscreen + third_party/openscreen/src/third_party/mozilla + third_party/openscreen/src/third_party/tinycbor/src/src + third_party/ots + third_party/pdfium + third_party/pdfium/third_party/agg23 + third_party/pdfium/third_party/base + third_party/pdfium/third_party/bigint + third_party/pdfium/third_party/freetype + third_party/pdfium/third_party/lcms + ) + use system-openjpeg || keeplibs+=( + third_party/pdfium/third_party/libopenjpeg + ) + keeplibs+=( + third_party/pdfium/third_party/libtiff + third_party/pdfium/third_party/skia_shared + third_party/perfetto + third_party/perfetto/protos/third_party/chromium + third_party/pffft + third_party/ply + third_party/polymer + third_party/private-join-and-compute + third_party/private_membership + third_party/protobuf + third_party/pthreadpool + third_party/puffin + third_party/pyjson5 + third_party/pyyaml + third_party/qcms + third_party/rnnoise + third_party/s2cellid + third_party/securemessage + third_party/selenium-atoms + third_party/shell-encryption + third_party/simplejson + third_party/skia + third_party/skia/include/third_party/vulkan + third_party/skia/third_party/vulkan + third_party/smhasher + ) + use system-snappy || keeplibs+=( + third_party/snappy + ) + keeplibs+=( + third_party/sqlite + third_party/swiftshader + third_party/swiftshader/third_party/astc-encoder + third_party/swiftshader/third_party/llvm-subzero + third_party/swiftshader/third_party/marl + third_party/swiftshader/third_party/subzero + third_party/swiftshader/third_party/SPIRV-Headers/include/spirv + third_party/swiftshader/third_party/SPIRV-Tools + third_party/tensorflow_models + third_party/tensorflow-text + third_party/tflite + third_party/tflite/src/third_party/eigen3 + third_party/tflite/src/third_party/fft2d + third_party/ruy + third_party/six + third_party/ukey2 + third_party/utf + third_party/vulkan + third_party/wayland + third_party/webdriver + third_party/webgpu-cts + third_party/webrtc + third_party/webrtc/common_audio/third_party/ooura + third_party/webrtc/common_audio/third_party/spl_sqrt_floor + third_party/webrtc/modules/third_party/fft + third_party/webrtc/modules/third_party/g711 + third_party/webrtc/modules/third_party/g722 + third_party/webrtc/rtc_base/third_party/base64 + third_party/webrtc/rtc_base/third_party/sigslot + third_party/widevine + ) + use system-woff2 || keeplibs+=( + third_party/woff2 + ) + keeplibs+=( + third_party/wuffs + third_party/x11proto + third_party/xcbproto + third_party/xnnpack + third_party/zxcvbn-cpp + third_party/zlib/google + url/third_party/mozilla + v8/src/third_party/siphash + v8/src/third_party/valgrind + v8/src/third_party/utf8-decoder + v8/third_party/glibc + v8/third_party/inspector_protocol + v8/third_party/v8 + + # gyp -> gn leftovers + third_party/speech-dispatcher + third_party/usb_ids + third_party/xdg-utils + ) + if ! use system-ffmpeg; then + keeplibs+=( third_party/ffmpeg third_party/opus ) + fi + if ! use system-icu; then + keeplibs+=( third_party/icu ) + fi + if ! use system-png; then + keeplibs+=( third_party/libpng ) + fi + if ! use system-av1; then + keeplibs+=( + third_party/dav1d + third_party/libaom + third_party/libaom/source/libaom/third_party/fastfeat + third_party/libaom/source/libaom/third_party/SVT-AV1 + third_party/libaom/source/libaom/third_party/vector + third_party/libaom/source/libaom/third_party/x86inc + ) + fi + if ! use system-harfbuzz; then + keeplibs+=( third_party/harfbuzz-ng ) + fi + if ! use system-openh264; then + keeplibs+=( third_party/openh264 ) + fi + if ! use system-re2; then + keeplibs+=( third_party/re2 ) + fi + if use arm64 || use ppc64 ; then + keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 ) + fi + + keeplibs+=( third_party/ungoogled ) + + # we need to generate ppc64 stuff because upstream does not ship it yet + # it has to be done before unbundling. + if use ppc64; then + pushd third_party/libvpx >/dev/null || die + mkdir -p source/config/linux/ppc64 || die + # requires git and clang, bug #832803 + sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g" \ + generate_gni.sh || die + ./generate_gni.sh || die + popd >/dev/null || die + + pushd third_party/ffmpeg >/dev/null || die + cp libavcodec/ppc/h264dsp.c libavcodec/ppc/h264dsp_ppc.c || die + cp libavcodec/ppc/h264qpel.c libavcodec/ppc/h264qpel_ppc.c || die + popd >/dev/null || die + fi + + ebegin "Removing bundled libraries" + # Remove most bundled libraries. Some are still needed. + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove + eend $? || die + + # bundled eu-strip is for amd64 only and we don't want to pre-stripped binaries + mkdir -p buildtools/third_party/eu-strip/bin || die + ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die +} + +src_configure() { + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + local myconf_gn="" + + # Make sure the build system will use the right tools, bug #340795. + tc-export AR CC CXX NM + + if use clang && ! tc-is-clang ; then + einfo "Enforcing the use of clang due to USE=clang ..." + if tc-is-cross-compiler; then + CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}" + CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}" + BUILD_CC=${CBUILD}-clang + BUILD_CXX=${CBUILD}-clang++ + else + CC=${CHOST}-clang + CXX=${CHOST}-clang++ + fi + strip-unsupported-flags + elif ! use clang && ! tc-is-gcc ; then + einfo "Enforcing the use of gcc due to USE=-clang ..." + CC=${CHOST}-gcc + CXX=${CHOST}-g++ + strip-unsupported-flags + fi + + if tc-is-clang; then + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false" + else + myconf_gn+=" is_clang=false" + fi + + # Force lld for lto or pgo builds only, otherwise disable, bug 641556 + if use thinlto || use pgo || use nvidia; then + myconf_gn+=" use_lld=true" + else + myconf_gn+=" use_lld=false" + fi + + if use thinlto || use pgo; then + AR=llvm-ar + NM=llvm-nm + if tc-is-cross-compiler; then + BUILD_AR=llvm-ar + BUILD_NM=llvm-nm + fi + fi + + # Define a custom toolchain for GN + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" + + if tc-is-cross-compiler; then + tc-export BUILD_{AR,CC,CXX,NM} + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\"" + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\"" + myconf_gn+=" pkg_config=\"$(tc-getPKG_CONFIG)\"" + myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\"" + + # setup cups-config, build system only uses --libs option + if use cups; then + mkdir "${T}/cups-config" || die + cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die + export PATH="${PATH}:${T}/cups-config" + fi + + # Don't inherit PKG_CONFIG_PATH from environment + local -x PKG_CONFIG_PATH= + else + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" + fi + + # Disable rust for now; it's only used for testing and we don't need the additional bdep + myconf_gn+=" enable_rust=false" + + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. + myconf_gn+=" is_debug=false" + + # enable DCHECK with USE=debug only, increases chrome binary size by 30%, bug #811138. + # DCHECK is fatal by default, make it configurable at runtime, #bug 807881. + myconf_gn+=" dcheck_always_on=$(usex debug true false)" + myconf_gn+=" dcheck_is_configurable=$(usex debug true false)" + + # Disable nacl, we can't build without pnacl (http://crbug.com/269560). + myconf_gn+=" enable_nacl=false" + + local gn_system_libraries=( + flac + fontconfig + freetype + libdrm + libjpeg + libwebp + libxml + libxslt + zlib + ) + if use system-abseil-cpp; then + gn_system_libraries+=( + absl_algorithm + absl_base + absl_cleanup + absl_container + absl_debugging + absl_flags + absl_functional + absl_hash + absl_log + absl_log_internal + absl_memory + absl_meta + absl_numeric + absl_random + absl_status + absl_strings + absl_synchronization + absl_time + absl_types + absl_utility + ) + fi + if use system-brotli; then + gn_system_libraries+=( brotli ) + fi + if use system-crc32c; then + gn_system_libraries+=( crc32c ) + fi + if use system-double-conversion; then + gn_system_libraries+=( double-conversion ) + fi + if use system-woff2; then + gn_system_libraries+=( woff2 ) + fi + if use nvidia; then + gn_system_libraries+=( libXNVCtrl ) + fi + if use system-ffmpeg; then + gn_system_libraries+=( ffmpeg opus ) + fi + if use system-jsoncpp; then + gn_system_libraries+=( jsoncpp ) + fi + if use system-icu; then + gn_system_libraries+=( icu ) + fi + if use system-png; then + gn_system_libraries+=( libpng ) + myconf_gn+=" use_system_libpng=true" + fi + if use system-av1; then + gn_system_libraries+=( dav1d libaom ) + fi + if use system-libusb; then + gn_system_libraries+=( libusb ) + fi + if use system-libvpx; then + gn_system_libraries+=( libvpx ) + fi + if use system-libevent; then + gn_system_libraries+=( libevent ) + fi + use system-openh264 && gn_system_libraries+=( + openh264 + ) + use system-re2 && gn_system_libraries+=( + re2 + ) + use system-snappy && gn_system_libraries+=( + snappy + ) + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die + + # See dependency logic in third_party/BUILD.gn + myconf_gn+=" use_system_harfbuzz=$(usex system-harfbuzz true false)" + + # Optional dependencies. + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)" + myconf_gn+=" enable_widevine=$(usex widevine true false)" + + if use headless; then + myconf_gn+=" use_cups=false" + myconf_gn+=" use_kerberos=false" + myconf_gn+=" use_pulseaudio=false" + myconf_gn+=" use_vaapi=false" + myconf_gn+=" rtc_use_pipewire=false" + else + myconf_gn+=" use_cups=$(usex cups true false)" + myconf_gn+=" use_kerberos=$(usex kerberos true false)" + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)" + myconf_gn+=" use_vaapi=$(usex vaapi true false)" + myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)" + myconf_gn+=" gtk_version=$(usex gtk4 4 3)" + fi + + # TODO: link_pulseaudio=true for GN. + + myconf_gn+=" disable_fieldtrial_testing_config=true" + + myconf_gn+=" use_bluez=$(usex bluetooth true false)" + + myconf_gn+=" is_cfi=$(usex cfi true false)" + + if use cfi; then + myconf_gn+=" use_cfi_icall=true" + myconf_gn+=" use_cfi_cast=true" + fi + + if use pgo; then + myconf_gn+=" chrome_pgo_phase=2" + else + myconf_gn+=" chrome_pgo_phase=0" + fi + + myconf_gn+=" optimize_webui=$(usex optimize-webui true false)" + myconf_gn+=" use_system_freetype=$(usex system-harfbuzz true false)" + myconf_gn+=" use_system_libopenjpeg2=$(usex system-openjpeg true false)" + myconf_gn+=" enable_pdf=true" + myconf_gn+=" use_system_lcms2=true" + myconf_gn+=" enable_print_preview=true" + myconf_gn+=" enable_platform_hevc=$(usex hevc true false)" + myconf_gn+=" enable_hevc_parser_and_hw_decoder=$(usex hevc true false)" + + # Ungoogled flags + myconf_gn+=" enable_mdns=false" + myconf_gn+=" enable_mse_mpeg2ts_stream_parser=$(usex proprietary-codecs true false)" + myconf_gn+=" enable_reading_list=false" + myconf_gn+=" enable_remoting=false" + myconf_gn+=" enable_reporting=false" + myconf_gn+=" enable_service_discovery=false" + myconf_gn+=" exclude_unwind_tables=true" + myconf_gn+=" use_official_google_api_keys=false" + myconf_gn+=" google_api_key=\"\"" + myconf_gn+=" google_default_client_id=\"\"" + myconf_gn+=" google_default_client_secret=\"\"" + myconf_gn+=" safe_browsing_mode=0" + myconf_gn+=" use_unofficial_version_number=false" + myconf_gn+=" blink_symbol_level=0" + myconf_gn+=" symbol_level=0" + myconf_gn+=" enable_iterator_debugging=false" + myconf_gn+=" enable_swiftshader=false" + myconf_gn+=" build_with_tflite_lib=false" + + # Additional flags + myconf_gn+=" perfetto_use_system_zlib=true" + myconf_gn+=" use_system_zlib=true" + myconf_gn+=" use_system_libjpeg=true" + myconf_gn+=" rtc_build_examples=false" + + # Never use bundled gold binary. Disable gold linker flags for now. + # Do not use bundled clang. + # Trying to use gold results in linker crash. + myconf_gn+=" use_gold=false use_sysroot=false use_custom_libcxx=false" + + # Disable pseudolocales, only used for testing + myconf_gn+=" enable_pseudolocales=false" + + # Disable code formating of generated files + myconf_gn+=" blink_enable_generated_code_formatting=false" + + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)" + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)" + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\"" + + local myarch="$(tc-arch)" + + # Avoid CFLAGS problems, bug #352457, bug #390147. + if ! use custom-cflags; then + filter-flags "-O*" "-Wl,-O*" #See #25 + strip-flags + + # Prevent linker from running out of address space, bug #471810 . + if use x86; then + filter-flags "-g*" + fi + + # Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646. + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a + fi + + if tc-is-gcc; then + # https://bugs.gentoo.org/904455 + append-cxxflags "$(test-flags-CXX -fno-tree-vectorize)" + fi + fi + + if [[ $myarch = amd64 ]] ; then + myconf_gn+=" target_cpu=\"x64\"" + ffmpeg_target_arch=x64 + elif [[ $myarch = x86 ]] ; then + myconf_gn+=" target_cpu=\"x86\"" + ffmpeg_target_arch=ia32 + + # This is normally defined by compiler_cpu_abi in + # build/config/compiler/BUILD.gn, but we patch that part out. + append-flags -msse2 -mfpmath=sse -mmmx + elif [[ $myarch = arm64 ]] ; then + myconf_gn+=" target_cpu=\"arm64\"" + ffmpeg_target_arch=arm64 + elif [[ $myarch = arm ]] ; then + myconf_gn+=" target_cpu=\"arm\"" + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm) + elif [[ $myarch = ppc64 ]] ; then + myconf_gn+=" target_cpu=\"ppc64\"" + ffmpeg_target_arch=ppc64 + else + die "Failed to determine target arch, got '$myarch'." + fi + + if use thinlto; then + # We need to change the default value of import-instr-limit in + # LLVM to limit the text size increase. The default value is + # 100, and we change it to 30 to reduce the text size increase + # from 25% to 10%. The performance number of page_cycler is the + # same on two of the thinLTO configurations, we got 1% slowdown + # on speedometer when changing import-instr-limit from 100 to 30. + # append-ldflags "-Wl,-plugin-opt,-import-instr-limit=30" + sed -i '/import_instr_limit = 5/{s++import_instr_limit = 30+;h};${x;/./{x;q0};x;q1}' \ + build/config/compiler/BUILD.gn || die + + append-ldflags "-Wl,--thinlto-jobs=$(makeopts_jobs)" + fi + + # Make sure that -Werror doesn't get added to CFLAGS by the build system. + # Depending on GCC version the warnings are different and we don't want + # the build to fail because of that. + myconf_gn+=" treat_warnings_as_errors=false" + + # Disable fatal linker warnings, bug 506268. + myconf_gn+=" fatal_linker_warnings=false" + + # Disable external code space for V8 for ppc64. It is disabled for ppc64 + # by default, but cross-compiling on amd64 enables it again. + if tc-is-cross-compiler; then + if ! use amd64 && ! use arm64; then + myconf_gn+=" v8_enable_external_code_space=false" + fi + fi + + # Only enabled for clang, but gcc has endian macros too + myconf_gn+=" v8_use_libm_trig_functions=true" + + # Bug 491582. + export TMPDIR="${WORKDIR}/temp" + mkdir -p -m 755 "${TMPDIR}" || die + + # https://bugs.gentoo.org/654216 + addpredict /dev/dri/ #nowarn + + #if ! use system-ffmpeg; then + if false; then + local build_ffmpeg_args="" + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then + build_ffmpeg_args+=" --disable-asm" + fi + + # Re-configure bundled ffmpeg. See bug #491378 for example reasons. + einfo "Configuring bundled ffmpeg..." + pushd third_party/ffmpeg > /dev/null || die + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \ + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die + chromium/scripts/copy_config.sh || die + chromium/scripts/generate_gn.py || die + popd > /dev/null || die + fi + + # Disable unknown warning message from clang. + if tc-is-clang; then + append-flags -Wno-unknown-warning-option + if tc-is-cross-compiler; then + export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option" + export BUILD_CFLAGS+=" -Wno-unknown-warning-option" + fi + fi + + # Explicitly disable ICU data file support for system-icu/headless builds. + if use system-icu || use headless; then + myconf_gn+=" icu_use_data_file=false" + fi + + # Enable ozone wayland and/or headless support + myconf_gn+=" use_ozone=true ozone_auto_platforms=false" + myconf_gn+=" ozone_platform_headless=true" + if use headless; then + myconf_gn+=" ozone_platform=\"headless\"" + myconf_gn+=" use_xkbcommon=false use_gtk=false use_qt=false" + myconf_gn+=" use_glib=false use_gio=false" + myconf_gn+=" use_pangocairo=false use_alsa=false" + myconf_gn+=" use_libpci=false use_udev=false" + myconf_gn+=" enable_print_preview=false" + myconf_gn+=" enable_remoting=false" + else + myconf_gn+=" use_system_libdrm=true" + myconf_gn+=" use_system_minigbm=true" + myconf_gn+=" use_xkbcommon=true" + if use qt5 || use qt6; then + local cbuild_libdir=$(get_libdir) + if tc-is-cross-compiler; then + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt) + cbuild_libdir=${cbuild_libdir:2} + cbuild_libdir=${cbuild_libdir/% } + fi + if use qt5; then + if tc-is-cross-compiler; then + myconf_gn+=" moc_qt5_path=\"${EPREFIX}/${cbuild_libdir}/qt5/bin\"" + else + myconf_gn+=" moc_qt5_path=\"$(qt5_get_bindir)\"" + fi + fi + if use qt6; then + myconf_gn+=" moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\"" + fi + + myconf_gn+=" use_qt=true" + myconf_gn+=" use_qt6=$(usex qt6 true false)" + else + myconf_gn+=" use_qt=false" + fi + myconf_gn+=" ozone_platform_x11=$(usex X true false)" + myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)" + myconf_gn+=" ozone_platform=$(usex wayland \"wayland\" \"x11\")" + use wayland && myconf_gn+=" use_system_libffi=true" + fi + + # Results in undefined references in chrome linking, may require CFI to work + if use arm64; then + myconf_gn+=" arm_control_flow_integrity=\"none\"" + fi + + # Enable official builds + myconf_gn+=" is_official_build=$(usex official true false)" + myconf_gn+=" use_thin_lto=$(usex thinlto true false)" + myconf_gn+=" thin_lto_enable_optimizations=$(usex optimize-thinlto true false)" + if use official; then + # Allow building against system libraries in official builds + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ + tools/generate_shim_headers/generate_shim_headers.py || die + # Don't add symbols to build + myconf_gn+=" symbol_level=0" + else + myconf_gn+=" devtools_skip_typecheck=false" + fi + + # user CXXFLAGS might overwrite -march=armv8-a+crc+crypto, bug #851639 + if use arm64 && tc-is-gcc; then + sed -i '/^#if HAVE_ARM64_CRC32C/a #pragma GCC target ("+crc+crypto")' \ + third_party/crc32c/src/src/crc32c_arm64.cc || die + fi + + # skipping typecheck is only supported on amd64, bug #876157 + if ! use amd64; then + myconf_gn+=" devtools_skip_typecheck=false" + fi + + # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn) + append-cflags -Wno-builtin-macro-redefined + append-cxxflags -Wno-builtin-macro-redefined + append-cppflags "-D__DATE__= -D__TIME__= -D__TIMESTAMP__=" + + myconf_gn+=" import(\"${WORKDIR}/cromite-${CROMITE_COMMIT_ID}/build/bromite.gn_args\")" + + local flags + einfo "Building with the following compiler settings:" + for flags in C{C,XX} AR NM RANLIB {C,CXX,CPP,LD}FLAGS \ + EXTRA_GN UGC_{SKIP_{PATCHES,SUBSTITUTION},KEEP_BINARIES} ; do + einfo " ${flags} = \"${!flags}\"" + done + + einfo "Configuring Cromite..." + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release + echo "$@" + "$@" || die + + # The "if" below should not be executed unless testing + if [ ! -z "${NODIE}" ]; then + # List all args + # gn args --list out/Release + + # Quick compiler check + eninja -C out/Release protoc torque + fi +} + +src_compile() { + # Final link uses lots of file descriptors. + ulimit -n 2048 + + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + # Don't inherit PYTHONPATH from environment, bug #789021, #812689 + local -x PYTHONPATH= + + use convert-dict && eninja -C out/Release convert_dict + + # Build mksnapshot and pax-mark it. + if use pax-kernel; then + local x + for x in mksnapshot v8_context_snapshot_generator; do + if tc-is-cross-compiler; then + eninja -C out/Release "host/${x}" + pax-mark m "out/Release/host/${x}" + else + eninja -C out/Release "${x}" + pax-mark m "out/Release/${x}" + fi + done + fi + + # Even though ninja autodetects number of CPUs, we respect + # user's options, for debugging with -j 1 or any other reason. + eninja -C out/Release chrome + + use enable-driver && eninja -C out/Release chromedriver + use suid && eninja -C out/Release chrome_sandbox + + pax-mark m out/Release/chrome + + use enable-driver && mv out/Release/chromedriver{.unstripped,} + + rm -f out/Release/locales/*.pak.info || die + + # Build manpage; bug #684550 + sed -e 's|@@PACKAGE@@|chromium-browser|g; + s|@@MENUNAME@@|Chromium|g;' \ + chrome/app/resources/manpage.1.in > \ + out/Release/chromium-browser.1 || die + + # Build desktop file; bug #706786 + sed -e 's|@@MENUNAME@@|Chromium|g; + s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g; + s|@@PACKAGE@@|chromium-browser|g; + s|\(^Exec=\)/usr/bin/|\1|g;' \ + chrome/installer/linux/common/desktop.template > \ + out/Release/chromium-browser-chromium.desktop || die + + # Build vk_swiftshader_icd.json; bug #827861 + #sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' \ + # third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > \ + # out/Release/vk_swiftshader_icd.json || die +} + +src_install() { + local CHROMIUM_HOME="/usr/$(get_libdir)/cromite" + exeinto "${CHROMIUM_HOME}" + doexe out/Release/chrome + + if use convert-dict; then + newexe "${FILESDIR}/update-dicts.sh" update-dicts.sh + doexe out/Release/convert_dict + fi + + if use suid; then + newexe out/Release/chrome_sandbox chrome-sandbox + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" + fi + + use enable-driver && doexe out/Release/chromedriver + #doexe out/Release/chrome_crashpad_handler + + ozone_auto_session () { + use X && use wayland && ! use headless && echo true || echo false + } + local sedargs=( -e + "s:/usr/lib/:/usr/$(get_libdir)/:g; + s:@@OZONE_AUTO_SESSION@@:$(ozone_auto_session):g" + ) + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r7.sh" > cromite-launcher.sh || die + if has_version ">=media-sound/apulse-0.1.9" ; then + sed -i 's/exec -a "chromium-browser"/exec -a "chromium-browser" apulse/' cromite-launcher.sh || die + fi + doexe cromite-launcher.sh + + # It is important that we name the target "chromium-browser", + # xdg-utils expect it; bug #355517. + dosym "${CHROMIUM_HOME}/cromite-launcher.sh" /usr/bin/cromite-browser + # keep the old symlink around for consistency + dosym "${CHROMIUM_HOME}/cromite-launcher.sh" /usr/bin/cromite + + use enable-driver && dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver + + # Allow users to override command-line options, bug #357629. + insinto /etc/cromite + newins "${FILESDIR}/chromium.default" "default" + + pushd out/Release/locales > /dev/null || die + chromium_remove_language_paks + popd + + insinto "${CHROMIUM_HOME}" + doins out/Release/*.bin + doins out/Release/*.pak + ( + shopt -s nullglob + local files=(out/Release/*.so out/Release/*.so.[0-9]) + [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}" + ) + + # Install bundled xdg-utils, avoids installing X11 libraries with USE="-X wayland" + doins out/Release/xdg-{settings,mime} + + if ! use system-icu && ! use headless; then + doins out/Release/icudtl.dat + fi + + doins -r out/Release/locales + #doins -r out/Release/MEIPreload + + # Install vk_swiftshader_icd.json; bug #827861 + #doins out/Release/vk_swiftshader_icd.json + + #if [[ -d out/Release/swiftshader ]]; then + # insinto "${CHROMIUM_HOME}/swiftshader" + # doins out/Release/swiftshader/*.so + #fi + + use widevine && dosym WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so /usr/$(get_libdir)/chromium-browser/libwidevinecdm.so + + # Install icons + local branding size + for size in 16 24 32 48 64 128 256 ; do + case ${size} in + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; + *) branding="chrome/app/theme/chromium" ;; + esac + newicon -s ${size} "${branding}/product_logo_${size}.png" \ + chromium-browser.png + done + + # Install desktop entry + domenu out/Release/chromium-browser-chromium.desktop + + # Install GNOME default application entry (bug #303100). + insinto /usr/share/gnome-control-center/default-apps + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml + + # Install manpage; bug #684550 + doman out/Release/chromium-browser.1 + dosym chromium-browser.1 /usr/share/man/man1/chromium.1 + + readme.gentoo_create_doc +} + +pkg_postrm() { + xdg_icon_cache_update + xdg_desktop_database_update +} + +pkg_postinst() { + xdg_icon_cache_update + xdg_desktop_database_update + readme.gentoo_print_elog + + if ! use headless; then + if use vaapi; then + elog "VA-API is disabled by default at runtime. You have to enable it" + elog "by adding --enable-features=VaapiVideoDecoder and " + elog "--disable-features=UseChromeOSDirectVideoDecoder to CHROMIUM_FLAGS" + elog "in /etc/chromium/default." + fi + if use screencast; then + elog "Screencast is disabled by default at runtime. Either enable it" + elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer" + elog "inside Chromium or add --enable-features=WebRTCPipeWireCapturer" + elog "to CHROMIUM_FLAGS in /etc/chromium/default." + fi + if use gtk4; then + elog "Chromium prefers GTK3 over GTK4 at runtime. To override this" + elog "behaviour you need to pass --gtk-version=4, e.g. by adding it" + elog "to CHROMIUM_FLAGS in /etc/chromium/default." + fi + if use widevine; then + elog "widevine requires binary plugins, which are distributed separately" + elog "Make sure you have www-plugins/chrome-binary-plugins installed" + fi + if use qt5 && use qt6; then + elog "Chromium automatically selects Qt5 or Qt6 based on your desktop" + elog "environment. To override you need to pass --qt-version=5 or" + elog "--qt-version=6, e.g. by adding it to CHROMIUM_FLAGS in" + elog "/etc/chromium/default." + fi + fi +} diff --git a/www-client/cromite/files/chromium-108-EnumTable-crash.patch b/www-client/cromite/files/chromium-108-EnumTable-crash.patch new file mode 100644 index 000000000..661ec33c1 --- /dev/null +++ b/www-client/cromite/files/chromium-108-EnumTable-crash.patch @@ -0,0 +1,76 @@ +diff --git a/components/media_router/common/providers/cast/channel/enum_table.h b/components/media_router/common/providers/cast/channel/enum_table.h +index 842553a..89de703 100644 +--- a/components/media_router/common/providers/cast/channel/enum_table.h ++++ b/components/media_router/common/providers/cast/channel/enum_table.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "base/check_op.h" + #include "base/notreached.h" +@@ -187,7 +188,6 @@ class + inline constexpr GenericEnumTableEntry(int32_t value); + inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); + +- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; + GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; + + private: +@@ -253,7 +253,6 @@ class EnumTable { + constexpr Entry(E value, base::StringPiece str) + : GenericEnumTableEntry(static_cast(value), str) {} + +- Entry(const Entry&) = delete; + Entry& operator=(const Entry&) = delete; + }; + +@@ -312,15 +311,14 @@ class EnumTable { + if (is_sorted_) { + const std::size_t index = static_cast(value); + if (ANALYZER_ASSUME_TRUE(index < data_.size())) { +- const auto& entry = data_.begin()[index]; ++ const auto& entry = data_[index]; + if (ANALYZER_ASSUME_TRUE(entry.has_str())) + return entry.str(); + } + return absl::nullopt; + } + return GenericEnumTableEntry::FindByValue( +- reinterpret_cast(data_.begin()), +- data_.size(), static_cast(value)); ++ &data_[0], data_.size(), static_cast(value)); + } + + // This overload of GetString is designed for cases where the argument is a +@@ -348,8 +346,7 @@ class EnumTable { + // enum value directly. + absl::optional GetEnum(base::StringPiece str) const { + auto* entry = GenericEnumTableEntry::FindByString( +- reinterpret_cast(data_.begin()), +- data_.size(), str); ++ &data_[0], data_.size(), str); + return entry ? static_cast(entry->value) : absl::optional(); + } + +@@ -364,7 +361,7 @@ class EnumTable { + // Align the data on a cache line boundary. + alignas(64) + #endif +- std::initializer_list data_; ++ const std::vector data_; + bool is_sorted_; + + constexpr EnumTable(std::initializer_list data, bool is_sorted) +@@ -376,8 +373,8 @@ class EnumTable { + + for (std::size_t i = 0; i < data.size(); i++) { + for (std::size_t j = i + 1; j < data.size(); j++) { +- const Entry& ei = data.begin()[i]; +- const Entry& ej = data.begin()[j]; ++ const Entry& ei = data[i]; ++ const Entry& ej = data[j]; + DCHECK(ei.value != ej.value) + << "Found duplicate enum values at indices " << i << " and " << j; + DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/www-client/cromite/files/chromium-109-system-openh264.patch b/www-client/cromite/files/chromium-109-system-openh264.patch new file mode 100644 index 000000000..6be816b30 --- /dev/null +++ b/www-client/cromite/files/chromium-109-system-openh264.patch @@ -0,0 +1,20 @@ +--- a/build/linux/unbundle/openh264.gn ++++ b/build/linux/unbundle/openh264.gn +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/buildflag_header.gni") + import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") + +@@ -34,3 +35,9 @@ source_set("encoder") { + deps = [ ":openh264_shim" ] + public_configs = [ ":config" ] + } ++ ++buildflag_header("buildflags") { ++ header = "buildflags.h" ++ header_dir = "third_party/openh264" ++ flags = [ "OPENH264_API_WELS=1" ] ++} diff --git a/www-client/cromite/files/chromium-109-system-zlib.patch b/www-client/cromite/files/chromium-109-system-zlib.patch new file mode 100644 index 000000000..5e8b2d80a --- /dev/null +++ b/www-client/cromite/files/chromium-109-system-zlib.patch @@ -0,0 +1,10 @@ +--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc +@@ -19,7 +19,6 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "third_party/zlib/contrib/minizip/ioapi.h" + + namespace tflite { + namespace metadata { diff --git a/www-client/cromite/files/chromium-111-InkDropHost-crash.patch b/www-client/cromite/files/chromium-111-InkDropHost-crash.patch new file mode 100644 index 000000000..21dd8e41b --- /dev/null +++ b/www-client/cromite/files/chromium-111-InkDropHost-crash.patch @@ -0,0 +1,25 @@ +https://chromium-review.googlesource.com/c/chromium/src/+/2959890 + +--- a/ui/views/animation/ink_drop_host.h ++++ b/ui/views/animation/ink_drop_host.h +@@ -238,6 +238,11 @@ class VIEWS_EXPORT InkDropHost { + // Used to observe View and inform the InkDrop of host-transform changes. + ViewLayerTransformObserver host_view_transform_observer_; + ++ // Declared before |ink_drop_|, because InkDropImpl may call ++ // RemoveInkDropLayer on partly destructed InkDropHost. In ++ // that case |ink_drop_mask_| must be still valid. ++ std::unique_ptr ink_drop_mask_; ++ + // Should not be accessed directly. Use GetInkDrop() instead. + std::unique_ptr ink_drop_; + +@@ -261,8 +266,6 @@ class VIEWS_EXPORT InkDropHost { + int ink_drop_small_corner_radius_ = 2; + int ink_drop_large_corner_radius_ = 4; + +- std::unique_ptr ink_drop_mask_; +- + base::RepeatingCallback()> create_ink_drop_callback_; + base::RepeatingCallback()> + create_ink_drop_ripple_callback_; diff --git a/www-client/cromite/files/chromium-113-gcc-13-0001-vulkanmemoryallocator.patch b/www-client/cromite/files/chromium-113-gcc-13-0001-vulkanmemoryallocator.patch new file mode 100644 index 000000000..28372caeb --- /dev/null +++ b/www-client/cromite/files/chromium-113-gcc-13-0001-vulkanmemoryallocator.patch @@ -0,0 +1,10 @@ +--- a/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h ++++ b/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h +@@ -2579,6 +2579,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #undef VMA_IMPLEMENTATION + + #include ++#include + #include + #include + #include diff --git a/www-client/cromite/files/chromium-113-swiftshader-cstdint.patch b/www-client/cromite/files/chromium-113-swiftshader-cstdint.patch new file mode 100644 index 000000000..6c04f5499 --- /dev/null +++ b/www-client/cromite/files/chromium-113-swiftshader-cstdint.patch @@ -0,0 +1,40 @@ +From ecefa6c6596982616fa1f564fcee363ef8533808 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 03 May 2023 12:01:36 +0200 +Subject: [PATCH] IWYU: add cstdint for uintptr_t in llvm-10.0 Signals.h + +Upstream commit: + + From ff1681ddb303223973653f7f5f3f3435b48a1983 Mon Sep 17 00:00:00 2001 + From: Sergei Trofimovich + Date: Mon, 23 May 2022 08:03:23 +0100 + Subject: [PATCH] [Support] Add missing header to Signals.h + + Without the change llvm build fails on this week's gcc-13 snapshot as: + + [ 0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o + In file included from llvm/lib/Support/Signals.cpp:14: + llvm/include/llvm/Support/Signals.h:119:8: error: variable or field 'CleanupOnSignal' declared void + 119 | void CleanupOnSignal(uintptr_t Context); + | ^~~~~~~~~~~~~~~ + +Change-Id: Iabe0256d86012e7887e295815aa6cfd50694459a +Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/71608 +Reviewed-by: Shahbaz Youssefi +Kokoro-Result: kokoro +Tested-by: Shahbaz Youssefi +Commit-Queue: Shahbaz Youssefi +--- + +diff --git a/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h b/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h +index e0a18e7..148216b 100644 +--- a/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h ++++ b/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h +@@ -14,6 +14,7 @@ + #ifndef LLVM_SUPPORT_SIGNALS_H + #define LLVM_SUPPORT_SIGNALS_H + ++#include + #include + + namespace llvm { diff --git a/www-client/cromite/files/chromium-114-compiler-custom-cflags.patch b/www-client/cromite/files/chromium-114-compiler-custom-cflags.patch new file mode 100644 index 000000000..f3b17541e --- /dev/null +++ b/www-client/cromite/files/chromium-114-compiler-custom-cflags.patch @@ -0,0 +1,255 @@ +From 307a0f63dd9b118f4b8470ed3d7567e81fdb7a6d Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Tue, 15 Nov 2022 10:27:58 +0000 +Subject: [PATCH] Disable various compiler configs + +--- + build/config/compiler/BUILD.gn | 134 +++++---------------------------- + 1 file changed, 17 insertions(+), 117 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index bd039fc..4d3759a 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -276,9 +276,7 @@ config("compiler") { + + configs += [ + # See the definitions below. +- ":clang_revision", + ":rustc_revision", +- ":compiler_cpu_abi", + ":compiler_codegen", + ":compiler_deterministic", + ] +@@ -540,36 +540,6 @@ + ldflags += [ "-Wl,-z,keep-text-section-prefix" ] + } + +- if (is_clang && !is_nacl && current_os != "zos") { +- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] +- if (save_reproducers_on_lld_crash && use_lld) { +- ldflags += [ +- "-fcrash-diagnostics=all", +- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir, +- ] +- } +- +- # TODO(hans): Remove this once Clang generates better optimized debug info +- # by default. https://crbug.com/765793 +- cflags += [ +- "-mllvm", +- "-instcombine-lower-dbg-declare=0", +- ] +- if (!is_debug && use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ] +- } +- } +- +- # TODO(crbug.com/1235145): Investigate why/if this should be needed. +- if (is_win) { +- cflags += [ "/clang:-ffp-contract=off" ] +- } else { +- cflags += [ "-ffp-contract=off" ] +- } +- } + + # C11/C++11 compiler flags setup. + # --------------------------- +@@ -1301,46 +1268,6 @@ config("compiler_deterministic") { + } + } + +- # Makes builds independent of absolute file path. +- if (is_clang && strip_absolute_paths_from_debug_symbols) { +- # If debug option is given, clang includes $cwd in debug info by default. +- # For such build, this flag generates reproducible obj files even we use +- # different build directory like "out/feature_a" and "out/feature_b" if +- # we build same files with same compile flag. +- # Other paths are already given in relative, no need to normalize them. +- if (is_nacl) { +- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. +- cflags += [ +- "-Xclang", +- "-fdebug-compilation-dir", +- "-Xclang", +- ".", +- ] +- } else { +- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= +- # and -fcoverage-compilation-dir=. +- cflags += [ "-ffile-compilation-dir=." ] +- swiftflags += [ "-file-compilation-dir=." ] +- } +- if (!is_win) { +- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) +- asmflags = [ "-Wa,-fdebug-compilation-dir,." ] +- } +- +- if (is_win && use_lld) { +- if (symbol_level == 2 || (is_clang && using_sanitizer)) { +- # Absolutize source file paths for PDB. Pass the real build directory +- # if the pdb contains source-level debug information and if linker +- # reproducibility is not critical. +- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ] +- } else { +- # Use a fake fixed base directory for paths in the pdb to make the pdb +- # output fully deterministic and independent of the build directory. +- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ] +- } +- } +- } +- + # Tells the compiler not to use absolute paths when passing the default + # paths to the tools it invokes. We don't want this because we don't + # really need it and it can mess up the goma cache entries. +@@ -1359,27 +1286,6 @@ config("compiler_deterministic") { + } + } + +-config("clang_revision") { +- if (is_clang && clang_base_path == default_clang_base_path) { +- update_args = [ +- "--print-revision", +- "--verify-version=$clang_version", +- ] +- if (llvm_force_head_revision) { +- update_args += [ "--llvm-force-head-revision" ] +- } +- clang_revision = exec_script("//tools/clang/scripts/update.py", +- update_args, +- "trim string") +- +- # This is here so that all files get recompiled after a clang roll and +- # when turning clang on or off. (defines are passed via the command line, +- # and build system rebuild things when their commandline changes). Nothing +- # should ever read this define. +- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ] +- } +-} +- + config("rustc_revision") { + if (enable_rust && defined(rustc_version)) { + # Similar to the above config, this is here so that all files get +@@ -1669,7 +1575,7 @@ config("chromium_code") { + defines = [ "_HAS_NODISCARD" ] + } + } else { +- cflags = [ "-Wall" ] ++ cflags = [] + if (treat_warnings_as_errors) { + cflags += [ "-Werror" ] + +@@ -1678,10 +1584,6 @@ config("chromium_code") { + # well. + ldflags = [ "-Werror" ] + } +- if (is_clang) { +- # Enable extra warnings for chromium_code when we control the compiler. +- cflags += [ "-Wextra" ] +- } + + # In Chromium code, we define __STDC_foo_MACROS in order to get the + # C99 macros on Mac and Linux. +@@ -1746,16 +1746,6 @@ + "__STDC_FORMAT_MACROS", + ] + +- if (!is_debug && !using_sanitizer && current_cpu != "s390x" && +- current_cpu != "s390" && current_cpu != "ppc64" && +- current_cpu != "mips" && current_cpu != "mips64" && +- current_cpu != "riscv64" && current_cpu != "loong64") { +- # Non-chromium code is not guaranteed to compile cleanly with +- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are +- # disabled, so only do that for Release build. +- defines += [ "_FORTIFY_SOURCE=2" ] +- } +- + if (is_apple) { + cflags_objc = [ "-Wimplicit-retain-self" ] + cflags_objcc = [ "-Wimplicit-retain-self" ] +@@ -2092,7 +1984,8 @@ config("default_stack_frames") { + } + + # Default "optimization on" config. +-config("optimize") { ++config("optimize") { } ++config("xoptimize") { + if (is_win) { + if (chrome_pgo_phase != 2) { + # Favor size over speed, /O1 must be before the common flags. +@@ -2137,7 +2030,8 @@ config("optimize") { + } + + # Turn off optimizations. +-config("no_optimize") { ++config("no_optimize") { } ++config("xno_optimize") { + if (is_win) { + cflags = [ + "/Od", # Disable optimization. +@@ -2177,7 +2071,8 @@ config("no_optimize") { + # Turns up the optimization level. On Windows, this implies whole program + # optimization and link-time code generation which is very expensive and should + # be used sparingly. +-config("optimize_max") { ++config("optimize_max") { } ++config("xoptimize_max") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2210,7 +2105,8 @@ config("optimize_max") { + # + # TODO(crbug.com/621335) - rework how all of these configs are related + # so that we don't need this disclaimer. +-config("optimize_speed") { ++config("optimize_speed") { } ++config("xoptimize_speed") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2236,7 +2132,8 @@ config("optimize_speed") { + } + } + +-config("optimize_fuzzing") { ++config("optimize_fuzzing") { } ++config("xoptimize_fuzzing") { + cflags = [ "-O1" ] + common_optimize_on_cflags + rustflags = [ "-Copt-level=1" ] + ldflags = common_optimize_on_ldflags +@@ -2403,7 +2403,8 @@ + } + + # Full symbols. +-config("symbols") { ++config("symbols") { } ++config("xsymbols") { + rustflags = [] + if (is_win) { + if (is_clang) { +@@ -2495,7 +2393,8 @@ config("symbols") { + # Minimal symbols. + # This config guarantees to hold symbol for stack trace which are shown to user + # when crash happens in unittests running on buildbot. +-config("minimal_symbols") { ++config("minimal_symbols") { } ++config("xminimal_symbols") { + if (is_win) { + # Functions, files, and line tables only. + cflags = [] +@@ -2568,7 +2467,8 @@ config("minimal_symbols") { + # This configuration contains function names only. That is, the compiler is + # told to not generate debug information and the linker then just puts function + # names in the final debug information. +-config("no_symbols") { ++config("no_symbols") { } ++config("xno_symbols") { + if (is_win) { + ldflags = [ "/DEBUG" ] + +-- +2.37.4 + diff --git a/www-client/cromite/files/chromium-114-compiler.patch b/www-client/cromite/files/chromium-114-compiler.patch new file mode 100644 index 000000000..8f30f19f7 --- /dev/null +++ b/www-client/cromite/files/chromium-114-compiler.patch @@ -0,0 +1,172 @@ +From 307a0f63dd9b118f4b8470ed3d7567e81fdb7a6d Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Tue, 15 Nov 2022 10:27:58 +0000 +Subject: [PATCH] Disable various compiler configs + +--- + build/config/compiler/BUILD.gn | 134 +++++---------------------------- + 1 file changed, 17 insertions(+), 117 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index bd039fc..4d3759a 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -276,9 +276,7 @@ config("compiler") { + + configs += [ + # See the definitions below. +- ":clang_revision", + ":rustc_revision", +- ":compiler_cpu_abi", + ":compiler_codegen", + ":compiler_deterministic", + ] +@@ -540,36 +540,6 @@ + ldflags += [ "-Wl,-z,keep-text-section-prefix" ] + } + +- if (is_clang && !is_nacl && current_os != "zos") { +- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] +- if (save_reproducers_on_lld_crash && use_lld) { +- ldflags += [ +- "-fcrash-diagnostics=all", +- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir, +- ] +- } +- +- # TODO(hans): Remove this once Clang generates better optimized debug info +- # by default. https://crbug.com/765793 +- cflags += [ +- "-mllvm", +- "-instcombine-lower-dbg-declare=0", +- ] +- if (!is_debug && use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ] +- } +- } +- +- # TODO(crbug.com/1235145): Investigate why/if this should be needed. +- if (is_win) { +- cflags += [ "/clang:-ffp-contract=off" ] +- } else { +- cflags += [ "-ffp-contract=off" ] +- } +- } + + # C11/C++11 compiler flags setup. + # --------------------------- +@@ -1301,46 +1268,6 @@ config("compiler_deterministic") { + } + } + +- # Makes builds independent of absolute file path. +- if (is_clang && strip_absolute_paths_from_debug_symbols) { +- # If debug option is given, clang includes $cwd in debug info by default. +- # For such build, this flag generates reproducible obj files even we use +- # different build directory like "out/feature_a" and "out/feature_b" if +- # we build same files with same compile flag. +- # Other paths are already given in relative, no need to normalize them. +- if (is_nacl) { +- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. +- cflags += [ +- "-Xclang", +- "-fdebug-compilation-dir", +- "-Xclang", +- ".", +- ] +- } else { +- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= +- # and -fcoverage-compilation-dir=. +- cflags += [ "-ffile-compilation-dir=." ] +- swiftflags += [ "-file-compilation-dir=." ] +- } +- if (!is_win) { +- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) +- asmflags = [ "-Wa,-fdebug-compilation-dir,." ] +- } +- +- if (is_win && use_lld) { +- if (symbol_level == 2 || (is_clang && using_sanitizer)) { +- # Absolutize source file paths for PDB. Pass the real build directory +- # if the pdb contains source-level debug information and if linker +- # reproducibility is not critical. +- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ] +- } else { +- # Use a fake fixed base directory for paths in the pdb to make the pdb +- # output fully deterministic and independent of the build directory. +- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ] +- } +- } +- } +- + # Tells the compiler not to use absolute paths when passing the default + # paths to the tools it invokes. We don't want this because we don't + # really need it and it can mess up the goma cache entries. +@@ -1359,27 +1286,6 @@ config("compiler_deterministic") { + } + } + +-config("clang_revision") { +- if (is_clang && clang_base_path == default_clang_base_path) { +- update_args = [ +- "--print-revision", +- "--verify-version=$clang_version", +- ] +- if (llvm_force_head_revision) { +- update_args += [ "--llvm-force-head-revision" ] +- } +- clang_revision = exec_script("//tools/clang/scripts/update.py", +- update_args, +- "trim string") +- +- # This is here so that all files get recompiled after a clang roll and +- # when turning clang on or off. (defines are passed via the command line, +- # and build system rebuild things when their commandline changes). Nothing +- # should ever read this define. +- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ] +- } +-} +- + config("rustc_revision") { + if (enable_rust && defined(rustc_version)) { + # Similar to the above config, this is here so that all files get +@@ -1669,7 +1575,7 @@ config("chromium_code") { + defines = [ "_HAS_NODISCARD" ] + } + } else { +- cflags = [ "-Wall" ] ++ cflags = [] + if (treat_warnings_as_errors) { + cflags += [ "-Werror" ] + +@@ -1678,10 +1584,6 @@ config("chromium_code") { + # well. + ldflags = [ "-Werror" ] + } +- if (is_clang) { +- # Enable extra warnings for chromium_code when we control the compiler. +- cflags += [ "-Wextra" ] +- } + + # In Chromium code, we define __STDC_foo_MACROS in order to get the + # C99 macros on Mac and Linux. +@@ -1746,16 +1746,6 @@ + "__STDC_FORMAT_MACROS", + ] + +- if (!is_debug && !using_sanitizer && current_cpu != "s390x" && +- current_cpu != "s390" && current_cpu != "ppc64" && +- current_cpu != "mips" && current_cpu != "mips64" && +- current_cpu != "riscv64" && current_cpu != "loong64") { +- # Non-chromium code is not guaranteed to compile cleanly with +- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are +- # disabled, so only do that for Release build. +- defines += [ "_FORTIFY_SOURCE=2" ] +- } +- + if (is_apple) { + cflags_objc = [ "-Wimplicit-retain-self" ] + cflags_objcc = [ "-Wimplicit-retain-self" ] diff --git a/www-client/cromite/files/chromium-114-gcc12.patch b/www-client/cromite/files/chromium-114-gcc12.patch new file mode 100644 index 000000000..5070135c6 --- /dev/null +++ b/www-client/cromite/files/chromium-114-gcc12.patch @@ -0,0 +1,30 @@ +https://chromium.googlesource.com/chromium/src/+/a1fec6273f3ad7c73b35bb420a5540355df35b74 +controlledframe: Fix start up crash + +This commit applies a fix from mail@maciej.szmigiero.name to prevent a +null reference error in GetControlledFrameFeatureList(). The fix is to +add static to `feature_list` so that the object lives past this +function. + +BUG=1447422 + +Change-Id: I22879831ec879ce7d6a178760540f88106b3ded4 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4555985 +Commit-Queue: Ovidio Ruiz-Henríquez +Reviewed-by: David Roger +Reviewed-by: Chase Phillips +Auto-Submit: Ovidio Ruiz-Henríquez +Cr-Commit-Position: refs/heads/main@{#1149296} + +--- a/chrome/common/initialize_extensions_client.cc ++++ b/chrome/common/initialize_extensions_client.cc + +@@ -19,7 +19,7 @@ + + // This list should stay in sync with GetExpectedDelegatedFeaturesForTest(). + base::span GetControlledFrameFeatureList() { +- constexpr const char* feature_list[] = { ++ static constexpr const char* feature_list[] = { + "controlledFrameInternal", "chromeWebViewInternal", "guestViewInternal", + "webRequestInternal", "webViewInternal", + }; diff --git a/www-client/cromite/files/chromium-114-remove-evdev-dep.patch b/www-client/cromite/files/chromium-114-remove-evdev-dep.patch new file mode 100644 index 000000000..6c106c33e --- /dev/null +++ b/www-client/cromite/files/chromium-114-remove-evdev-dep.patch @@ -0,0 +1,47 @@ +commit e3612e8dcb1a43bc358248845aa4f16f4a2792c7 +Author: Stephan Hartmann +Date: Fri Jun 30 19:15:09 2023 +0200 + + remoting: remove unused dependency on libevdev + + There is only one include, but nothing of libevdev is used. Instead + linux/input.h (defines BTN_*). + +diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn +index 9e8dfee8b7d9e..5f46876222fd5 100644 +--- a/remoting/host/BUILD.gn ++++ b/remoting/host/BUILD.gn +@@ -241,10 +241,6 @@ if (is_linux) { + pkg_config("xkbcommon") { + packages = [ "xkbcommon" ] + } +- +- pkg_config("libevdev") { +- packages = [ "libevdev" ] +- } + } + + # This must be a static library instead of a source set because +@@ -576,7 +572,6 @@ static_library("common") { + "x11_display_util.cc", + "x11_display_util.h", + ] +- configs += [ ":libevdev" ] + libs += [ "//third_party/libei/lib64/libei.a" ] + public_deps += [ + "//third_party/wayland:wayland_client", +diff --git a/remoting/host/linux/remote_desktop_portal_injector.cc b/remoting/host/linux/remote_desktop_portal_injector.cc +index f6de2b406a97f..bb40aa00328d4 100644 +--- a/remoting/host/linux/remote_desktop_portal_injector.cc ++++ b/remoting/host/linux/remote_desktop_portal_injector.cc +@@ -7,9 +7,9 @@ + #include + #include + #include ++#include + #include + +-#include + #include + + #include "base/check.h" diff --git a/www-client/cromite/files/chromium-115-binutils-2.41.patch b/www-client/cromite/files/chromium-115-binutils-2.41.patch new file mode 100644 index 000000000..95f65eb6e --- /dev/null +++ b/www-client/cromite/files/chromium-115-binutils-2.41.patch @@ -0,0 +1,76 @@ +From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= +Date: Sun, 16 Jul 2023 18:18:02 +0300 +Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift + instructions within inline assembly + +Fixes assembling with binutil as >= 2.41 + +Signed-off-by: James Almer +--- + libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h +index 6298f5ed19..ca7e2dffc1 100644 +--- a/third_party/ffmpeg/libavcodec/x86/mathops.h ++++ b/third_party/ffmpeg/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + +-- +2.41.0 + diff --git a/www-client/cromite/files/chromium-93-ffmpeg-4.4.patch b/www-client/cromite/files/chromium-93-ffmpeg-4.4.patch new file mode 100644 index 000000000..5dbf541a0 --- /dev/null +++ b/www-client/cromite/files/chromium-93-ffmpeg-4.4.patch @@ -0,0 +1,60 @@ +--- chromium-93.0.4577.63/media/filters/ffmpeg_demuxer.cc.orig 2021-09-07 08:38:33.765397601 +0200 ++++ chromium-93.0.4577.63/media/filters/ffmpeg_demuxer.cc 2021-09-07 09:03:32.575927180 +0200 +@@ -427,11 +427,19 @@ + scoped_refptr buffer; + + if (type() == DemuxerStream::TEXT) { ++#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T + size_t id_size = 0; ++#else ++ int id_size = 0; ++#endif + uint8_t* id_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); + ++#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T + size_t settings_size = 0; ++#else ++ int settings_size = 0; ++#endif + uint8_t* settings_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); + +@@ -443,7 +451,11 @@ + buffer = DecoderBuffer::CopyFrom(packet->data, packet->size, + side_data.data(), side_data.size()); + } else { ++#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T + size_t side_data_size = 0; ++#else ++ int side_data_size = 0; ++#endif + uint8_t* side_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); + +@@ -504,7 +516,11 @@ + packet->size - data_offset); + } + ++#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T + size_t skip_samples_size = 0; ++#else ++ int skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast(av_packet_get_side_data( + packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); +--- chromium-93.0.4577.63/media/filters/audio_decoder_unittest.cc.orig 2021-09-01 03:39:39.000000000 +0200 ++++ chromium-93.0.4577.63/media/filters/audio_decoder_unittest.cc 2021-09-07 09:00:33.311446755 +0200 +@@ -109,7 +109,11 @@ + } + + // If the timestamp is positive, try to use FFmpeg's discard data. ++#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T + size_t skip_samples_size = 0; ++#else ++ int skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast(av_packet_get_side_data( + packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); diff --git a/www-client/cromite/files/chromium-98-gtk4-build.patch b/www-client/cromite/files/chromium-98-gtk4-build.patch new file mode 100644 index 000000000..94d2f1f00 --- /dev/null +++ b/www-client/cromite/files/chromium-98-gtk4-build.patch @@ -0,0 +1,56 @@ +--- a/ui/gtk/gsk.sigs ++++ b/ui/gtk/gsk.sigs +@@ -1,16 +1,16 @@ +-GskRenderNodeType gsk_render_node_get_node_type(GskRenderNode* node); ++GskRenderNodeType gsk_render_node_get_node_type(const GskRenderNode* node); + void gsk_render_node_unref(GskRenderNode* node); +-GskRenderNode* gsk_transform_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_opacity_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_color_matrix_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_repeat_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_clip_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_rounded_clip_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_shadow_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_blur_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_debug_node_get_child(GskRenderNode* node); +-GskRenderNode* gsk_container_node_get_child(GskRenderNode* node, guint idx); +-GskRenderNode* gsk_gl_shader_node_get_child(GskRenderNode* node, guint idx); +-guint gsk_container_node_get_n_children(GskRenderNode* node); +-guint gsk_gl_shader_node_get_n_children(GskRenderNode* node); +-GdkTexture* gsk_texture_node_get_texture(GskRenderNode* node); ++GskRenderNode* gsk_transform_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_opacity_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_color_matrix_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_repeat_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_clip_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_rounded_clip_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_shadow_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_blur_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_debug_node_get_child(const GskRenderNode* node); ++GskRenderNode* gsk_container_node_get_child(const GskRenderNode* node, guint idx); ++GskRenderNode* gsk_gl_shader_node_get_child(const GskRenderNode* node, guint idx); ++guint gsk_container_node_get_n_children(const GskRenderNode* node); ++guint gsk_gl_shader_node_get_n_children(const GskRenderNode* node); ++GdkTexture* gsk_texture_node_get_texture(const GskRenderNode* node); +--- a/ui/gtk/gtk_util.cc ++++ b/ui/gtk/gtk_util.cc +@@ -705,7 +705,7 @@ + DCHECK(GtkCheckVersion(4)); + struct { + GskRenderNodeType node_type; +- GskRenderNode* (*get_child)(GskRenderNode*); ++ GskRenderNode* (*get_child)(const GskRenderNode*); + } constexpr simple_getters[] = { + {GSK_TRANSFORM_NODE, gsk_transform_node_get_child}, + {GSK_OPACITY_NODE, gsk_opacity_node_get_child}, +@@ -719,8 +719,8 @@ + }; + struct { + GskRenderNodeType node_type; +- guint (*get_n_children)(GskRenderNode*); +- GskRenderNode* (*get_child)(GskRenderNode*, guint); ++ guint (*get_n_children)(const GskRenderNode*); ++ GskRenderNode* (*get_child)(const GskRenderNode*, guint); + } constexpr container_getters[] = { + {GSK_CONTAINER_NODE, gsk_container_node_get_n_children, + gsk_container_node_get_child}, diff --git a/www-client/cromite/files/chromium-99-opus.patch b/www-client/cromite/files/chromium-99-opus.patch new file mode 100644 index 000000000..d4ecf8e80 --- /dev/null +++ b/www-client/cromite/files/chromium-99-opus.patch @@ -0,0 +1,12 @@ +diff -up chromium-99.0.4818.0/media/audio/audio_opus_encoder.h.omv~ chromium-99.0.4818.0/media/audio/audio_opus_encoder.h +--- chromium-99.0.4818.0/media/audio/audio_opus_encoder.h.omv~ 2022-01-13 05:42:57.571250471 +0100 ++++ chromium-99.0.4818.0/media/audio/audio_opus_encoder.h 2022-01-13 05:43:06.233291236 +0100 +@@ -13,7 +13,7 @@ + #include "media/base/audio_encoder.h" + #include "media/base/audio_push_fifo.h" + #include "media/base/audio_timestamp_helper.h" +-#include "third_party/opus/src/include/opus.h" ++#include + + namespace media { + diff --git a/www-client/cromite/files/chromium-browser.xml b/www-client/cromite/files/chromium-browser.xml new file mode 100644 index 000000000..2c95a5584 --- /dev/null +++ b/www-client/cromite/files/chromium-browser.xml @@ -0,0 +1,13 @@ + + + + + + Chromium + chromium-browser + chromium-browser %s + chromium-browser + false + + + diff --git a/www-client/cromite/files/chromium-cross-compile.patch b/www-client/cromite/files/chromium-cross-compile.patch new file mode 100644 index 000000000..430ceb7a4 --- /dev/null +++ b/www-client/cromite/files/chromium-cross-compile.patch @@ -0,0 +1,12 @@ +--- a/build/toolchain/linux/unbundle/BUILD.gn ++++ b/build/toolchain/linux/unbundle/BUILD.gn +@@ -35,7 +35,7 @@ gcc_toolchain("host") { + extra_ldflags = getenv("BUILD_LDFLAGS") + + toolchain_args = { +- current_cpu = current_cpu +- current_os = current_os ++ current_cpu = host_cpu ++ current_os = host_os + } + } diff --git a/www-client/cromite/files/chromium-launcher-r7.sh b/www-client/cromite/files/chromium-launcher-r7.sh new file mode 100644 index 000000000..bf494fe59 --- /dev/null +++ b/www-client/cromite/files/chromium-launcher-r7.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Allow the user to override command-line flags, bug #357629. +# This is based on Debian's chromium-browser package, and is intended +# to be consistent with Debian. +for f in /etc/cromite/*; do + [[ -f ${f} ]] && source "${f}" +done + +# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system +# default CHROMIUM_FLAGS (from /etc/chromium/default). +CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"} + +# Let the wrapped binary know that it has been run through the wrapper +export CHROME_WRAPPER=$(readlink -f "$0") + +PROGDIR=${CHROME_WRAPPER%/*} + +case ":$PATH:" in + *:$PROGDIR:*) + # $PATH already contains $PROGDIR + ;; + *) + # Append $PROGDIR to $PATH + export PATH="$PATH:$PROGDIR" + ;; +esac + +if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then + # Running as root with HOME owned by root. + # Pass --user-data-dir to work around upstream failsafe. + CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium + ${CHROMIUM_FLAGS}" +fi + +# Select session type and platform +if @@OZONE_AUTO_SESSION@@; then + platform= + if [[ ${XDG_SESSION_TYPE} == x11 ]]; then + platform=x11 + elif [[ ${XDG_SESSION_TYPE} == wayland ]]; then + platform=wayland + else + if [[ -n ${WAYLAND_DISPLAY} ]]; then + platform=wayland + else + platform=x11 + fi + fi + if ${DISABLE_OZONE_PLATFORM:-false}; then + platform=x11 + fi + CHROMIUM_FLAGS="--ozone-platform=${platform} ${CHROMIUM_FLAGS}" +fi + +# Set the .desktop file name +export CHROME_DESKTOP="chromium-browser-chromium.desktop" + +exec -a "cromite-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@" diff --git a/www-client/cromite/files/chromium-qt6.patch b/www-client/cromite/files/chromium-qt6.patch new file mode 100644 index 000000000..1f18a9373 --- /dev/null +++ b/www-client/cromite/files/chromium-qt6.patch @@ -0,0 +1,106 @@ +--- a/ui/qt/qt.gni ++++ b/ui/qt/qt.gni +@@ -12,9 +12,21 @@ declare_args() { + use_qt = is_linux && !is_castos && !is_msan + } + ++declare_args() { ++ if(!use_sysroot && use_qt) { ++ moc_qt5_path = "" ++ } ++} ++ + declare_args() { + use_qt6 = use_qt && use_sysroot + } + ++declare_args() { ++ if(!use_sysroot && use_qt6) { ++ moc_qt6_path = "" ++ } ++} ++ + # use_qt6 => use_qt + assert(!use_qt6 || use_qt) +--- a/ui/qt/BUILD.gn ++++ b/ui/qt/BUILD.gn +@@ -41,16 +41,19 @@ source_set("qt_interface") { + sources = [ "qt_interface.cc" ] + } + +-if (!use_sysroot) { +- action("generate_moc") { +- script = "moc_wrapper.py" +- inputs = [ "//ui/qt/qt_shim.h" ] +- outputs = [ "$root_gen_dir/qt_shim_moc.cc" ] +- args = rebase_path(inputs + outputs, root_build_dir) ++template("qt_shim") { ++ if (!use_sysroot) { ++ action("generate_moc" + invoker.qt_version) { ++ script = "moc_wrapper.py" ++ inputs = [ "//ui/qt/qt_shim.h" ] ++ outputs = [ "$root_gen_dir/qt" + invoker.qt_version + "/qt_shim_moc.cc" ] ++ args = rebase_path(inputs + outputs, root_build_dir) ++ if (invoker.moc_qt_path != "") { ++ args += [ "--path", invoker.moc_qt_path ] ++ } ++ } + } +-} + +-template("qt_shim") { + pkg_config("qt" + invoker.qt_version + "_config") { + packages = [ + "Qt" + invoker.qt_version + "Core", +@@ -90,17 +93,23 @@ template("qt_shim") { + # avoid a build-time dependency on `moc` when using the sysroot. + sources += [ "qt" + invoker.qt_version + "_shim_moc.cc" ] + } else { +- sources += get_target_outputs(":generate_moc") +- deps += [ ":generate_moc" ] ++ sources += get_target_outputs(":generate_moc" + invoker.qt_version) ++ deps += [ ":generate_moc" + invoker.qt_version ] + } + } + } + qt_shim("qt5_shim") { + qt_version = "5" ++ if (!use_sysroot) { ++ moc_qt_path = "$moc_qt5_path" ++ } + } + if (use_qt6) { + qt_shim("qt6_shim") { + qt_version = "6" ++ if (!use_sysroot) { ++ moc_qt_path = "$moc_qt6_path" ++ } + } + } + +--- a/ui/qt/moc_wrapper.py ++++ b/ui/qt/moc_wrapper.py +@@ -3,8 +3,21 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import argparse + import subprocess +-import sys + ++parser = argparse.ArgumentParser() ++parser.add_argument( ++ 'input', type=str, help='Input header file.') ++parser.add_argument( ++ 'output', type=str, help='Output file.') ++parser.add_argument( ++ '--path', required=False, type=str, default=None, ++ help='Path to moc binary.') + +-subprocess.check_call(["moc", sys.argv[1], "-o", sys.argv[2]]) ++args = parser.parse_args() ++ ++if args.path is None: ++ subprocess.check_call(["moc", args.input, "-o", args.output]) ++else: ++ subprocess.check_call([args.path + "/moc", args.input, "-o", args.output]) diff --git a/www-client/cromite/files/chromium-system-abseil.patch b/www-client/cromite/files/chromium-system-abseil.patch new file mode 100644 index 000000000..4d11d65e3 --- /dev/null +++ b/www-client/cromite/files/chromium-system-abseil.patch @@ -0,0 +1,122 @@ +--- a/third_party/abseil-cpp/absl/crc/BUILD.gn ++++ b/third_party/abseil-cpp/absl/crc/BUILD.gn +@@ -29,10 +29,6 @@ + "//third_party/abseil-cpp/absl/base", + "//third_party/abseil-cpp/absl/base:config", + "//third_party/abseil-cpp/absl/base:core_headers", +- "//third_party/abseil-cpp/absl/base:dynamic_annotations", +- "//third_party/abseil-cpp/absl/base:endian", +- "//third_party/abseil-cpp/absl/base:prefetch", +- "//third_party/abseil-cpp/absl/base:raw_logging_internal", + "//third_party/abseil-cpp/absl/memory", + "//third_party/abseil-cpp/absl/numeric:bits", + ] +@@ -58,9 +54,6 @@ + ":non_temporal_memcpy", + "//third_party/abseil-cpp/absl/base:config", + "//third_party/abseil-cpp/absl/base:core_headers", +- "//third_party/abseil-cpp/absl/base:dynamic_annotations", +- "//third_party/abseil-cpp/absl/base:endian", +- "//third_party/abseil-cpp/absl/base:prefetch", + "//third_party/abseil-cpp/absl/strings", + ] + } +@@ -97,7 +90,6 @@ + ":crc32c", + "//third_party/abseil-cpp/absl/memory", + "//third_party/abseil-cpp/absl/random", +- "//third_party/abseil-cpp/absl/random:distributions", + "//third_party/abseil-cpp/absl/strings", + ] + } +--- a/third_party/abseil-cpp/BUILD.gn ++++ b/third_party/abseil-cpp/BUILD.gn +@@ -61,7 +61,6 @@ + "//third_party/abseil-cpp/absl/base", + "//third_party/abseil-cpp/absl/base:config", + "//third_party/abseil-cpp/absl/base:core_headers", +- "//third_party/abseil-cpp/absl/base:prefetch", + "//third_party/abseil-cpp/absl/cleanup", + "//third_party/abseil-cpp/absl/container:btree", + "//third_party/abseil-cpp/absl/container:fixed_array", +@@ -77,15 +76,11 @@ + "//third_party/abseil-cpp/absl/functional:bind_front", + "//third_party/abseil-cpp/absl/functional:function_ref", + "//third_party/abseil-cpp/absl/hash", +- "//third_party/abseil-cpp/absl/log:absl_check", +- "//third_party/abseil-cpp/absl/log:absl_log", +- "//third_party/abseil-cpp/absl/log:die_if_null", + "//third_party/abseil-cpp/absl/memory", + "//third_party/abseil-cpp/absl/meta:type_traits", + "//third_party/abseil-cpp/absl/numeric:bits", + "//third_party/abseil-cpp/absl/numeric:int128", + "//third_party/abseil-cpp/absl/random", +- "//third_party/abseil-cpp/absl/random:distributions", + "//third_party/abseil-cpp/absl/status", + "//third_party/abseil-cpp/absl/status:statusor", + "//third_party/abseil-cpp/absl/strings", +@@ -201,12 +196,9 @@ + "absl/crc:crc_cord_state_test", + "absl/crc:crc_memcpy_test", + "absl/crc:non_temporal_memcpy_test", +- "absl/debugging:stacktrace_test", + "absl/functional:any_invocable_test", + "absl/hash:hash_test", + "absl/hash:low_level_hash_test", +- "absl/log:absl_check_test", +- "absl/log:absl_log_basic_test", + "absl/log:die_if_null_test", + "absl/log:flags_test", + "absl/log:globals_test", +@@ -221,7 +213,6 @@ + "absl/log/internal:stderr_log_sink_test", + "absl/memory:memory_test", + "absl/meta:type_traits_test", +- "absl/numeric:int128_test", + "absl/profiling:exponential_biased_test", + "absl/profiling:periodic_sampler_test", + "absl/status:statusor_test", +@@ -238,13 +229,9 @@ + "absl/strings:cordz_test", + "absl/strings:cordz_update_scope_test", + "absl/strings:cordz_update_tracker_test", +- "absl/strings:damerau_levenshtein_distance_test", + "absl/strings:match_test", + "absl/strings:str_replace_test", + "absl/strings:string_view_test", +- "absl/synchronization:kernel_timeout_internal_test", +- "absl/synchronization:waiter_test", +- "absl/time:time_test", + "absl/types:optional_test", + "absl/types:variant_test", + "//third_party/googletest:gtest_main", +--- a/build/linux/unbundle/absl_base.gn ++++ b/build/linux/unbundle/absl_base.gn +@@ -1,5 +1,6 @@ + import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") ++import("//third_party/abseil-cpp/absl.gni") + + pkg_config("system_absl_base") { + packages = [ "absl_base" ] +@@ -27,18 +28,12 @@ + public_configs = [ ":system_absl_base" ] + } + +-shim_headers("config_shim") { +- root_path = "." +- prefix = "absl/base/" +- headers = [ ++absl_source_set("config") { ++ public = [ + "config.h", + "options.h", + "policy_checks.h", + ] +-} +- +-source_set("config") { +- deps = [ ":config_shim" ] + public_configs = [ ":system_absl_config" ] + } + diff --git a/www-client/cromite/files/chromium-system-brotli.patch b/www-client/cromite/files/chromium-system-brotli.patch new file mode 100644 index 000000000..58c3fdde9 --- /dev/null +++ b/www-client/cromite/files/chromium-system-brotli.patch @@ -0,0 +1,11 @@ +--- a/build/linux/unbundle/brotli.gn ++++ b/build/linux/unbundle/brotli.gn +@@ -16,6 +16,7 @@ + "brotli/encode.h", + "brotli/port.h", + "brotli/types.h", ++ "brotli/shared_dictionary.h", + ] + } + + diff --git a/www-client/cromite/files/chromium-system-openjpeg-r4.patch b/www-client/cromite/files/chromium-system-openjpeg-r4.patch new file mode 100644 index 000000000..64c6121e4 --- /dev/null +++ b/www-client/cromite/files/chromium-system-openjpeg-r4.patch @@ -0,0 +1,35 @@ +description: build using system openjpeg +author: Michael Gilbert + +--- a/third_party/pdfium/BUILD.gn ++++ b/third_party/pdfium/BUILD.gn +@@ -25,7 +25,7 @@ + cflags = [] + cflags_cc = [] + ldflags = [] +- include_dirs = [ "." ] ++ include_dirs = [ ".", "/usr/include/openjpeg-2.4", "/usr/include/openjpeg-2.5" ] + defines = [] + + if (!use_system_libopenjpeg2) { +--- a/third_party/pdfium/core/fpdfapi/render/BUILD.gn ++++ b/third_party/pdfium/core/fpdfapi/render/BUILD.gn +@@ -49,6 +49,7 @@ source_set("render") { + "../../../:pdfium_noshorten_config", + ] + deps = [ ++ "../../../third_party:libopenjpeg2", + "../../../constants", + "../../fxcodec", + "../../fxcrt", +--- a/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h ++++ b/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h +@@ -12,7 +12,7 @@ + #include "core/fxcrt/unowned_ptr.h" + #include "third_party/base/span.h" + +-#if defined(USE_SYSTEM_LIBOPENJPEG2) ++#if 1 + #include + #else + #include "third_party/libopenjpeg20/openjpeg.h" diff --git a/www-client/cromite/files/chromium-ucf-dict-utility.patch b/www-client/cromite/files/chromium-ucf-dict-utility.patch new file mode 100644 index 000000000..4c8abf38b --- /dev/null +++ b/www-client/cromite/files/chromium-ucf-dict-utility.patch @@ -0,0 +1,111 @@ +Taken from +https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042 + +--- a/chrome/tools/convert_dict/convert_dict.cc ++++ b/chrome/tools/convert_dict/convert_dict.cc +@@ -24,6 +24,7 @@ + #include "build/build_config.h" + #include "chrome/tools/convert_dict/aff_reader.h" + #include "chrome/tools/convert_dict/dic_reader.h" ++#include "components/spellcheck/common/spellcheck_common.h" + #include "third_party/hunspell/google/bdict_reader.h" + #include "third_party/hunspell/google/bdict_writer.h" + +@@ -76,13 +77,32 @@ bool VerifyWords(const convert_dict::Dic + } + + int PrintHelp() { +- printf("Usage: convert_dict \n\n"); +- printf("Example:\n"); +- printf(" convert_dict en-US\nwill read en-US.dic, en-US.dic_delta, and " +- "en-US.aff from the current directory and generate en-US.bdic\n\n"); ++ printf( ++ "Usage:\n" ++ " dict-utility list\n" ++ " dict-utility convert \n"); + return 1; + } + ++int PrintList() { ++ base::FilePath root("/"); ++ std::vector languages = spellcheck::SpellCheckLanguages(); ++ ++ for (auto &language : languages) { ++ std::string language_region = ++ spellcheck::GetSpellCheckLanguageRegion(language); ++ base::FilePath language_bdic_path = ++ spellcheck::GetVersionedFileName(language, root).BaseName(); ++ ++ printf("%s\t%s\t%s\n", ++ language.c_str(), ++ language_region.c_str(), ++ language_bdic_path.value().c_str()); ++ } ++ ++ return 0; ++} ++ + } // namespace + + #if defined(OS_WIN) +@@ -91,16 +111,15 @@ int wmain(int argc, wchar_t* argv[]) { + int main(int argc, char* argv[]) { + #endif + base::EnableTerminationOnHeapCorruption(); +- if (argc != 2) ++ if (argc == 2 && strcmp(argv[1], "list") == 0) ++ return PrintList(); ++ if (argc != 5 || strcmp(argv[1], "convert") != 0) + return PrintHelp(); + + base::AtExitManager exit_manager; + base::i18n::InitializeICU(); + +- base::FilePath file_base = base::FilePath(argv[1]); +- +- base::FilePath aff_path = +- file_base.ReplaceExtension(FILE_PATH_LITERAL(".aff")); ++ base::FilePath aff_path = base::FilePath(argv[2]); + printf("Reading %" PRFilePath " ...\n", aff_path.value().c_str()); + convert_dict::AffReader aff_reader(aff_path); + if (!aff_reader.Read()) { +@@ -108,8 +127,7 @@ int main(int argc, char* argv[]) { + return 1; + } + +- base::FilePath dic_path = +- file_base.ReplaceExtension(FILE_PATH_LITERAL(".dic")); ++ base::FilePath dic_path = base::FilePath(argv[3]); + printf("Reading %" PRFilePath " ...\n", dic_path.value().c_str()); + // DicReader will also read the .dic_delta file. + convert_dict::DicReader dic_reader(dic_path); +@@ -135,8 +153,7 @@ int main(int argc, char* argv[]) { + return 1; + } + +- base::FilePath out_path = +- file_base.ReplaceExtension(FILE_PATH_LITERAL(".bdic")); ++ base::FilePath out_path = base::FilePath(argv[4]); + printf("Writing %" PRFilePath " ...\n", out_path.value().c_str()); + FILE* out_file = base::OpenFile(out_path, "wb"); + if (!out_file) { +--- a/chrome/tools/convert_dict/BUILD.gn ++++ b/chrome/tools/convert_dict/BUILD.gn +@@ -34,6 +34,7 @@ executable("convert_dict") { + "//base", + "//base:i18n", + "//build/win:default_exe_manifest", ++ "//components/spellcheck/common", + "//third_party/hunspell", + ] + } +--- a/components/spellcheck/common/spellcheck_common.h ++++ b/components/spellcheck/common/spellcheck_common.h +@@ -30,6 +30,8 @@ static const size_t kMaxSyncableDictiona + // chrome/browser/resources/settings/languages_page/edit_dictionary_page.js + static const size_t kMaxCustomDictionaryWordBytes = 99; + ++std::string GetSpellCheckLanguageRegion(base::StringPiece input_language); ++ + base::FilePath GetVersionedFileName(base::StringPiece input_language, + const base::FilePath& dict_dir); diff --git a/www-client/cromite/files/chromium-use-oauth2-client-switches-as-default.patch b/www-client/cromite/files/chromium-use-oauth2-client-switches-as-default.patch new file mode 100644 index 000000000..9d9c57bfb --- /dev/null +++ b/www-client/cromite/files/chromium-use-oauth2-client-switches-as-default.patch @@ -0,0 +1,17 @@ +diff -upr chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc chromium-89.0.4389.58/google_apis/google_api_keys.cc +--- chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc 2021-02-24 22:37:18.494007649 +0000 ++++ chromium-89.0.4389.58/google_apis/google_api_keys.cc 2021-02-24 22:35:00.865777600 +0000 +@@ -154,11 +154,11 @@ class APIKeyCache { + + std::string default_client_id = CalculateKeyValue( + GOOGLE_DEFAULT_CLIENT_ID, +- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr, ++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID, + std::string(), environment.get(), command_line, gaia_config); + std::string default_client_secret = CalculateKeyValue( + GOOGLE_DEFAULT_CLIENT_SECRET, +- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr, ++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientSecret, + std::string(), environment.get(), command_line, gaia_config); + + // We currently only allow overriding the baked-in values for the diff --git a/www-client/cromite/files/chromium.default b/www-client/cromite/files/chromium.default new file mode 100644 index 000000000..15e1ed320 --- /dev/null +++ b/www-client/cromite/files/chromium.default @@ -0,0 +1,10 @@ +# Default settings for ungoogled-chromium. This file is sourced by /bin/bash +# from the chromium launcher. + +# Uncomment this to spoof timezone to UTC +#export TZ='Etc/UTC' + +# Options to pass to ungoogled-chromium. +# See https://github.com/ungoogled-software/ungoogled-chromium#feature-overview for additional +# command-line switches. +#CHROMIUM_FLAGS="" diff --git a/www-client/cromite/files/clang-15-fixes.patch b/www-client/cromite/files/clang-15-fixes.patch new file mode 100644 index 000000000..b1bd37e9f --- /dev/null +++ b/www-client/cromite/files/clang-15-fixes.patch @@ -0,0 +1,74 @@ +--- a/chrome/browser/download/bubble/download_bubble_update_service.cc ++++ b/chrome/browser/download/bubble/download_bubble_update_service.cc +@@ -87,6 +87,7 @@ + // Helper to get an iterator to the last element in the cache. The cache + // must not be empty. + template ++typename + SortedItems::iterator GetLastIter(SortedItems& cache) { + CHECK(!cache.empty()); + auto it = cache.end(); +@@ -789,8 +790,10 @@ + } + + template ++typename + SortedItems::iterator + DownloadBubbleUpdateService::RemoveItemFromCacheByIter( ++ typename + SortedItems::iterator iter, + SortedItems& cache, + IterMap& iter_map) { +--- a/chrome/browser/download/bubble/download_bubble_update_service.h ++++ b/chrome/browser/download/bubble/download_bubble_update_service.h +@@ -208,7 +208,9 @@ + + // Removes item if we already have the iterator to it. Returns next iterator. + template ++ typename + SortedItems::iterator RemoveItemFromCacheByIter( ++ typename + SortedItems::iterator iter, + SortedItems& cache, + IterMap& iter_map); +--- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc ++++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +@@ -520,8 +520,11 @@ + row_auto_repetitions); + + bool has_nested_subgrid = false; +- auto& [grid_items, layout_data, subtree_size] = ++ auto& sizing_data = + sizing_tree->CreateSizingData(opt_subgrid_data); ++ auto& grid_items = sizing_data.grid_items; ++ auto& layout_data = sizing_data.layout_data; ++ auto& subtree_size = sizing_data.subtree_size; + + if (!must_ignore_children) { + // Construct grid items that are not subgridded. +@@ -1640,8 +1646,11 @@ + const absl::optional& opt_track_direction) const { + DCHECK(sizing_subtree); + +- auto& [grid_items, layout_data, subtree_size] = ++ auto& sizing_data = + sizing_subtree.SubtreeRootData(); ++ auto& grid_items = sizing_data.grid_items; ++ auto& layout_data = sizing_data.layout_data; ++ auto& subtree_size = sizing_data.subtree_size; + + auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) { + InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data); +--- a/media/base/cdm_promise_adapter.cc ++++ b/media/base/cdm_promise_adapter.cc +@@ -94,7 +94,9 @@ + void CdmPromiseAdapter::Clear(ClearReason reason) { + // Reject all outstanding promises. + DCHECK(thread_checker_.CalledOnValidThread()); +- for (auto& [promise_id, promise] : promises_) { ++ for (auto& [p_i, p_e] : promises_) { ++ auto& promise_id = p_i; ++ auto& promise = p_e; + TRACE_EVENT_NESTABLE_ASYNC_END1( + "media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id), + "status", "cleared"); diff --git a/www-client/cromite/files/disable-bluez.patch b/www-client/cromite/files/disable-bluez.patch new file mode 100644 index 000000000..ca216cd3c --- /dev/null +++ b/www-client/cromite/files/disable-bluez.patch @@ -0,0 +1,91 @@ +From: PF4Public@users.noreply.github.com +License: BSD +Subject: Fix building with use_bluez=false + +This is a quick and dirty fix for building chromium with use_bluez=false +It prevents initialization and usage of Bluetooth by the browser +It is not supposed to be applied for use_bluez=true +The browser will SEGFAULT upon accessing chrome://bluetooth-internals/ + +--- +--- a/headless/lib/browser/headless_browser_main_parts_posix.cc ++++ b/headless/lib/browser/headless_browser_main_parts_posix.cc +@@ -25,9 +25,8 @@ + #include "components/os_crypt/sync/os_crypt.h" + #include "headless/public/switches.h" + +-#if defined(USE_DBUS) +-#include "device/bluetooth/dbus/bluez_dbus_manager.h" +-#endif ++#include "device/bluetooth/bluetooth_adapter_factory.h" ++#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h" + + #endif // BUILDFLAG(IS_LINUX) + +@@ -134,7 +133,7 @@ + #if BUILDFLAG(IS_LINUX) + + #if defined(USE_DBUS) +- bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr); ++ bluez::DBusBluezManagerWrapperLinux::Initialize(); + #endif + + // Set up crypt config. This needs to be done before anything starts the +--- a/chrome/browser/chrome_browser_main_linux.cc ++++ b/chrome/browser/chrome_browser_main_linux.cc +@@ -35,6 +35,11 @@ + #include "chrome/browser/dbus_memory_pressure_evaluator_linux.h" + #endif + ++#if BUILDFLAG(IS_LINUX) ++#include "device/bluetooth/bluetooth_adapter_factory.h" ++#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h" ++#endif ++ + #if !BUILDFLAG(IS_CHROMEOS_ASH) + #include "base/command_line.h" + #include "base/linux_util.h" +@@ -59,7 +64,9 @@ + #endif // BUILDFLAG(IS_CHROMEOS) + + #if !BUILDFLAG(IS_CHROMEOS) +- bluez::BluezDBusManager::Initialize(nullptr /* system_bus */); ++ #if BUILDFLAG(IS_LINUX) ++ bluez::DBusBluezManagerWrapperLinux::Initialize(); ++ #endif + + // Set up crypt config. This needs to be done before anything starts the + // network service, as the raw encryption key needs to be shared with the +@@ -117,7 +124,7 @@ + #endif // defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS) + + void ChromeBrowserMainPartsLinux::PostDestroyThreads() { +-#if BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) + // No-op; per PostBrowserStart() comment, this is done elsewhere. + #else + bluez::BluezDBusManager::Shutdown(); +--- a/chrome/browser/metrics/bluetooth_metrics_provider.cc ++++ b/chrome/browser/metrics/bluetooth_metrics_provider.cc +@@ -16,9 +16,7 @@ + + bool BluetoothMetricsProvider::ProvideHistograms() { + base::UmaHistogramEnumeration("Bluetooth.StackName", +- floss::features::IsFlossEnabled() +- ? BluetoothStackName::kFloss +- : BluetoothStackName::kBlueZ); ++ BluetoothStackName::kBlueZ); + return true; + } + +--- a/device/bluetooth/adapter.cc ++++ b/device/bluetooth/adapter.cc +@@ -111,7 +111,7 @@ + adapter_info->name = adapter_->GetName(); + #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) + adapter_info->system_name = adapter_->GetSystemName(); +- adapter_info->floss = floss::features::IsFlossEnabled(); ++ adapter_info->floss = false; + #endif + adapter_info->initialized = adapter_->IsInitialized(); + adapter_info->present = adapter_->IsPresent(); diff --git a/www-client/cromite/files/gtk-fix-prefers-color-scheme-query.diff b/www-client/cromite/files/gtk-fix-prefers-color-scheme-query.diff new file mode 100644 index 000000000..cb4d09dd4 --- /dev/null +++ b/www-client/cromite/files/gtk-fix-prefers-color-scheme-query.diff @@ -0,0 +1,54 @@ +From 1c8472c1a44e63c96da7b7cb3873a2822635c18b Mon Sep 17 00:00:00 2001 +From: Rune Lillesveen +Date: Fri, 03 Dec 2021 12:28:22 +0100 +Subject: [PATCH] Make dark theme Gtk affect preferred color scheme. + +Selecting a dark Gtk theme gives a dark NativeThemeGtk and UI, but it +didn't affect the preferred color scheme on the web instance. Hence, the +prefers-color-scheme media query still matched 'light', not 'dark'. + +Observe the ui native theme instance to propagate any theme changes to +the web instance. Code copied from the NativeThemeWin implementation. + +This is a reland of: + +https://chromium-review.googlesource.com/c/chromium/src/+/1774922 + +Bug: 998903 +Change-Id: Id8147ecfbda1f3f5899a1e35b97f36382e63e899 +--- + +diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc +index 4afa399..fbaaf06e 100644 +--- a/ui/gtk/native_theme_gtk.cc ++++ b/ui/gtk/native_theme_gtk.cc +@@ -116,6 +116,13 @@ + ui::ColorProviderManager::Get().AppendColorProviderInitializer( + base::BindRepeating(AddGtkNativeCoreColorMixer)); + ++ // Add the web native theme as an observer to stay in sync with dark mode, ++ // high contrast, and preferred color scheme changes. ++ color_scheme_observer_ = ++ std::make_unique( ++ NativeTheme::GetInstanceForWeb()); ++ AddObserver(color_scheme_observer_.get()); ++ + OnThemeChanged(gtk_settings_get_default(), nullptr); + } + +diff --git a/ui/gtk/native_theme_gtk.h b/ui/gtk/native_theme_gtk.h +index 876a738..ad3b88d41 100644 +--- a/ui/gtk/native_theme_gtk.h ++++ b/ui/gtk/native_theme_gtk.h +@@ -93,6 +93,11 @@ + mutable absl::optional color_cache_[kColorId_NumColors]; + + ScopedCssProvider theme_css_override_; ++ ++ // Used to notify the web native theme of changes to dark mode, high ++ // contrast, and preferred color scheme. ++ std::unique_ptr ++ color_scheme_observer_; + }; + + } // namespace gtk diff --git a/www-client/cromite/files/libusb.gn b/www-client/cromite/files/libusb.gn new file mode 100644 index 000000000..9f56f092d --- /dev/null +++ b/www-client/cromite/files/libusb.gn @@ -0,0 +1,24 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_libusb") { + packages = [ "libusb-1.0" ] +} + +shim_headers("libusb_shim") { + root_path = "src/libusb" + headers = [ + "libusb.h", + ] +} + +source_set("libusb") { + deps = [ + ":libusb_shim", + ] + public_configs = [ ":system_libusb" ] +} diff --git a/www-client/cromite/files/perfetto-system-zlib.patch b/www-client/cromite/files/perfetto-system-zlib.patch new file mode 100644 index 000000000..e1bd9c8c0 --- /dev/null +++ b/www-client/cromite/files/perfetto-system-zlib.patch @@ -0,0 +1,11 @@ +--- a/third_party/perfetto/gn/BUILD.gn ++++ b/third_party/perfetto/gn/BUILD.gn +@@ -382,7 +382,7 @@ + if (enable_perfetto_zlib) { + group("zlib") { + if (perfetto_use_system_zlib) { +- public_configs = [ "//gn:system_zlib_config" ] ++ public_configs = [ ":system_zlib_config" ] + } else if (perfetto_root_path == "//") { + public_configs = [ "//buildtools:zlib_config" ] + public_deps = [ "//buildtools:zlib" ] diff --git a/www-client/cromite/files/restore-x86-r2.patch b/www-client/cromite/files/restore-x86-r2.patch new file mode 100644 index 000000000..ca9ebc5cf --- /dev/null +++ b/www-client/cromite/files/restore-x86-r2.patch @@ -0,0 +1,19 @@ +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -1616,15 +1616,6 @@ + } + } + +-# TODO(cassew): Add more OS's that don't support x86. +-is_valid_x86_target = +- target_os != "ios" && target_os != "mac" && +- (target_os != "linux" || use_libfuzzer || !build_with_chromium) +- +-# Note: v8_target_cpu == arm allows using the V8 arm simulator on x86 for fuzzing. +-assert( +- is_valid_x86_target || target_cpu != "x86" || v8_target_cpu == "arm", +- "'target_cpu=x86' is not supported for 'target_os=$target_os'. Consider omitting 'target_cpu' (default) or using 'target_cpu=x64' instead.") + + group("chromium_builder_perf") { + testonly = true + diff --git a/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg.patch b/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg.patch new file mode 100644 index 000000000..c78848e95 --- /dev/null +++ b/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg.patch @@ -0,0 +1,287 @@ +--- b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc ++++ a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +@@ -74,7 +74,7 @@ + codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; + } + ++ codec_context->channels = config.channel_count; +- codec_context->ch_layout.nb_channels = config.channel_count; + codec_context->sample_rate = config.samples_per_second; + + if (config.extra_data) { +@@ -124,8 +124,8 @@ + case cdm::kAudioFormatPlanarS16: + case cdm::kAudioFormatPlanarF32: { + const int decoded_size_per_channel = ++ decoded_audio_size / av_frame.channels; ++ for (int i = 0; i < av_frame.channels; ++i) { +- decoded_audio_size / av_frame.ch_layout.nb_channels; +- for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { + memcpy(output_buffer, av_frame.extended_data[i], + decoded_size_per_channel); + output_buffer += decoded_size_per_channel; +@@ -185,14 +185,13 @@ + // Success! + decoding_loop_ = std::make_unique(codec_context_.get()); + samples_per_second_ = config.samples_per_second; ++ bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; +- bytes_per_frame_ = +- codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; + output_timestamp_helper_ = + std::make_unique(config.samples_per_second); + is_initialized_ = true; + + // Store initial values to guard against midstream configuration changes. ++ channels_ = codec_context_->channels; +- channels_ = codec_context_->ch_layout.nb_channels; + av_sample_format_ = codec_context_->sample_fmt; + + return true; +@@ -292,19 +291,17 @@ + for (auto& frame : audio_frames) { + int decoded_audio_size = 0; + if (frame->sample_rate != samples_per_second_ || ++ frame->channels != channels_ || frame->format != av_sample_format_) { +- frame->ch_layout.nb_channels != channels_ || +- frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" + << " Sample Rate: " << frame->sample_rate << " vs " ++ << samples_per_second_ << ", Channels: " << frame->channels ++ << " vs " << channels_ << ", Sample Format: " << frame->format ++ << " vs " << av_sample_format_; +- << samples_per_second_ +- << ", Channels: " << frame->ch_layout.nb_channels << " vs " +- << channels_ << ", Sample Format: " << frame->format << " vs " +- << av_sample_format_; + return cdm::kDecodeError; + } + + decoded_audio_size = av_samples_get_buffer_size( ++ nullptr, codec_context_->channels, frame->nb_samples, +- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, + codec_context_->sample_fmt, 1); + if (!decoded_audio_size) + continue; +@@ -323,9 +320,9 @@ + size_t* total_size, + std::vector>* audio_frames, + AVFrame* frame) { ++ *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, ++ frame->nb_samples, ++ codec_context_->sample_fmt, 1); +- *total_size += av_samples_get_buffer_size( +- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, +- codec_context_->sample_fmt, 1); + audio_frames->emplace_back(av_frame_clone(frame)); + return true; + } +--- b/media/ffmpeg/ffmpeg_common.cc ++++ a/media/ffmpeg/ffmpeg_common.cc +@@ -345,11 +345,10 @@ + codec_context->sample_fmt, codec_context->codec_id); + + ChannelLayout channel_layout = ++ codec_context->channels > 8 +- codec_context->ch_layout.nb_channels > 8 + ? CHANNEL_LAYOUT_DISCRETE ++ : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, ++ codec_context->channels); +- : ChannelLayoutToChromeChannelLayout( +- codec_context->ch_layout.u.mask, +- codec_context->ch_layout.nb_channels); + + int sample_rate = codec_context->sample_rate; + switch (codec) { +@@ -402,7 +401,7 @@ + extra_data, encryption_scheme, seek_preroll, + codec_context->delay); + if (channel_layout == CHANNEL_LAYOUT_DISCRETE) ++ config->SetChannelsForDiscrete(codec_context->channels); +- config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); + + #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) + // These are bitstream formats unknown to ffmpeg, so they don't have +@@ -471,7 +470,7 @@ + + // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses + // said information to decode. ++ codec_context->channels = config.channels(); +- codec_context->ch_layout.nb_channels = config.channels(); + codec_context->sample_rate = config.samples_per_second(); + + if (config.extra_data().empty()) { +--- b/media/filters/audio_file_reader.cc ++++ a/media/filters/audio_file_reader.cc +@@ -113,15 +113,14 @@ + + // Verify the channel layout is supported by Chrome. Acts as a sanity check + // against invalid files. See http://crbug.com/171962 ++ if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, ++ codec_context_->channels) == +- if (ChannelLayoutToChromeChannelLayout( +- codec_context_->ch_layout.u.mask, +- codec_context_->ch_layout.nb_channels) == + CHANNEL_LAYOUT_UNSUPPORTED) { + return false; + } + + // Store initial values to guard against midstream configuration changes. ++ channels_ = codec_context_->channels; +- channels_ = codec_context_->ch_layout.nb_channels; + audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); + sample_rate_ = codec_context_->sample_rate; + av_sample_format_ = codec_context_->sample_fmt; +@@ -224,7 +223,7 @@ + if (frames_read < 0) + return false; + ++ const int channels = frame->channels; +- const int channels = frame->ch_layout.nb_channels; + if (frame->sample_rate != sample_rate_ || channels != channels_ || + frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" +--- b/media/filters/audio_file_reader_unittest.cc ++++ a/media/filters/audio_file_reader_unittest.cc +@@ -121,11 +121,11 @@ + EXPECT_FALSE(reader_->Open()); + } + ++ void RunTestFailingDecode(const char* fn) { +- void RunTestFailingDecode(const char* fn, int expect_read = 0) { + Initialize(fn); + EXPECT_TRUE(reader_->Open()); + std::vector> decoded_audio_packets; ++ EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); +- EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); + } + + void RunTestPartialDecode(const char* fn) { +@@ -219,7 +219,7 @@ + } + + TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { ++ RunTestFailingDecode("midstream_config_change.mp3"); +- RunTestFailingDecode("midstream_config_change.mp3", 42624); + } + #endif + +--- b/media/filters/audio_video_metadata_extractor.cc ++++ a/media/filters/audio_video_metadata_extractor.cc +@@ -113,15 +113,6 @@ + if (!stream) + continue; + +- void* display_matrix = +- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); +- if (display_matrix) { +- rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( +- static_cast(display_matrix)) +- .rotation; +- info.tags["rotate"] = base::NumberToString(rotation_); +- } +- + // Extract dictionary from streams also. Needed for containers that attach + // metadata to contained streams instead the container itself, like OGG. + ExtractDictionary(stream->metadata, &info.tags); +@@ -264,6 +255,8 @@ + if (raw_tags->find(tag->key) == raw_tags->end()) + (*raw_tags)[tag->key] = tag->value; + ++ if (ExtractInt(tag, "rotate", &rotation_)) ++ continue; + if (ExtractString(tag, "album", &album_)) + continue; + if (ExtractString(tag, "artist", &artist_)) +--- b/media/filters/ffmpeg_aac_bitstream_converter.cc ++++ a/media/filters/ffmpeg_aac_bitstream_converter.cc +@@ -195,15 +195,14 @@ + if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || + audio_profile_ != stream_codec_parameters_->profile || + sample_rate_index_ != sample_rate_index || ++ channel_configuration_ != stream_codec_parameters_->channels || +- channel_configuration_ != +- stream_codec_parameters_->ch_layout.nb_channels || + frame_length_ != header_plus_packet_size) { + header_generated_ = + GenerateAdtsHeader(stream_codec_parameters_->codec_id, + 0, // layer + stream_codec_parameters_->profile, sample_rate_index, + 0, // private stream ++ stream_codec_parameters_->channels, +- stream_codec_parameters_->ch_layout.nb_channels, + 0, // originality + 0, // home + 0, // copyrighted_stream +@@ -215,7 +214,7 @@ + codec_ = stream_codec_parameters_->codec_id; + audio_profile_ = stream_codec_parameters_->profile; + sample_rate_index_ = sample_rate_index; ++ channel_configuration_ = stream_codec_parameters_->channels; +- channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; + frame_length_ = header_plus_packet_size; + } + +--- b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc ++++ a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +@@ -34,7 +34,7 @@ + memset(&test_parameters_, 0, sizeof(AVCodecParameters)); + test_parameters_.codec_id = AV_CODEC_ID_AAC; + test_parameters_.profile = FF_PROFILE_AAC_MAIN; ++ test_parameters_.channels = 2; +- test_parameters_.ch_layout.nb_channels = 2; + test_parameters_.extradata = extradata_header_; + test_parameters_.extradata_size = sizeof(extradata_header_); + } +--- b/media/filters/ffmpeg_audio_decoder.cc ++++ a/media/filters/ffmpeg_audio_decoder.cc +@@ -28,7 +28,7 @@ + + // Return the number of channels from the data in |frame|. + static inline int DetermineChannels(AVFrame* frame) { ++ return frame->channels; +- return frame->ch_layout.nb_channels; + } + + // Called by FFmpeg's allocation routine to allocate a buffer. Uses +@@ -231,7 +231,7 @@ + // Translate unsupported into discrete layouts for discrete configurations; + // ffmpeg does not have a labeled discrete configuration internally. + ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( ++ codec_context_->channel_layout, codec_context_->channels); +- codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { + channel_layout = CHANNEL_LAYOUT_DISCRETE; +@@ -348,11 +348,11 @@ + // Success! + av_sample_format_ = codec_context_->sample_fmt; + ++ if (codec_context_->channels != config.channels()) { +- if (codec_context_->ch_layout.nb_channels != config.channels()) { + MEDIA_LOG(ERROR, media_log_) + << "Audio configuration specified " << config.channels() + << " channels, but FFmpeg thinks the file contains " ++ << codec_context_->channels << " channels"; +- << codec_context_->ch_layout.nb_channels << " channels"; + ReleaseFFmpegResources(); + state_ = DecoderState::kUninitialized; + return false; +@@ -403,7 +403,7 @@ + if (frame->nb_samples <= 0) + return AVERROR(EINVAL); + ++ if (s->channels != channels) { +- if (s->ch_layout.nb_channels != channels) { + DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; + return AVERROR(EINVAL); + } +@@ -436,8 +436,7 @@ + ChannelLayout channel_layout = + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE + ? CHANNEL_LAYOUT_DISCRETE ++ : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); +- : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, +- s->ch_layout.nb_channels); + + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { + DLOG(ERROR) << "Unsupported channel layout."; diff --git a/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg_duration.patch b/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg_duration.patch new file mode 100644 index 000000000..2e3838022 --- /dev/null +++ b/www-client/cromite/files/reverse-roll-src-third_party-ffmpeg_duration.patch @@ -0,0 +1,15 @@ +--- a/media/filters/audio_file_reader.cc ++++ b/media/filters/audio_file_reader.cc +@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame( + // silence from being output. In the case where we are also discarding some + // portion of the packet (as indicated by a negative pts), we further want to + // adjust the duration downward by however much exists before zero. +- if (audio_codec_ == AudioCodec::kAAC && frame->duration) { ++ if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { + const base::TimeDelta pkt_duration = ConvertFromTimeBase( + glue_->format_context()->streams[stream_index_]->time_base, +- frame->duration + std::min(static_cast(0), frame->pts)); ++ frame->pkt_duration + std::min(static_cast(0), frame->pts)); + const base::TimeDelta frame_duration = + base::Seconds(frames_read / static_cast(sample_rate_)); + diff --git a/www-client/cromite/files/unbundle-ffmpeg-av_stream_get_first_dts.patch b/www-client/cromite/files/unbundle-ffmpeg-av_stream_get_first_dts.patch new file mode 100644 index 000000000..dae1adde0 --- /dev/null +++ b/www-client/cromite/files/unbundle-ffmpeg-av_stream_get_first_dts.patch @@ -0,0 +1,12 @@ +diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn +index 16e20744706..6a079b32221 100644 +--- a/build/linux/unbundle/ffmpeg.gn ++++ b/build/linux/unbundle/ffmpeg.gn +@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") { + "libavformat", + "libavutil", + ] ++ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ] + } + + buildflag_header("ffmpeg_features") { diff --git a/www-client/cromite/files/update-dicts.sh b/www-client/cromite/files/update-dicts.sh new file mode 100644 index 000000000..c5d600e38 --- /dev/null +++ b/www-client/cromite/files/update-dicts.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Taken from +# https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042 + +self="$(readlink -f "${0}")" +self_dir="$(dirname "${self}")" +dict_utility="${self_dir}/convert_dict" + +# Defaults. +hunspell_dicts_dir="/usr/share/myspell" +user_data_dir="${HOME}/.config/chromium" + +# Parse command-line arguments. +while [[ $# -gt 0 ]]; do + arg_name="${1}" + + case "${arg_name}" in + "--hunspell-dicts-dir") + hunspell_dicts_dir="${2}" + shift; shift + ;; + "--user-data-dir") + user_data_dir="${2}" + shift; shift + ;; + *) + echo -n "Usage: ungoogled-chromium-update-dicts " + echo "[--hunspell-dicts-dir DIR] [--user-data-dir DIR]" + exit 1 + esac +done + +# List all chromium language entries. +chromium_language_entries="$("${dict_utility}" list)" + +# Iterate through chromium language entries and make *.bdic files. +chromium_dicts_dir="${user_data_dir}/Dictionaries" +mkdir -p "${chromium_dicts_dir}" +while read -r chromium_language_entry; do + while read \ + chromium_language \ + chromium_language_region \ + chromium_bdic_basename; do + + hunspell_language_region="${chromium_language_region//-/_}" + aff_path="${hunspell_dicts_dir}/${hunspell_language_region}.aff" + dic_path="${hunspell_dicts_dir}/${hunspell_language_region}.dic" + bdic_path="${chromium_dicts_dir}/${chromium_bdic_basename}" + + if \ + [[ -f "${aff_path}" ]] && \ + [[ -f "${dic_path}" ]] && \ + [[ ! -f "${bdic_path}" ]]; then + "${dict_utility}" convert "${aff_path}" "${dic_path}" "${bdic_path}" + fi + done <<< "${chromium_language_entry}" +done <<< "${chromium_language_entries}" \ No newline at end of file diff --git a/www-client/cromite/files/vaapi-av1.diff b/www-client/cromite/files/vaapi-av1.diff new file mode 100644 index 000000000..f1a62eb82 --- /dev/null +++ b/www-client/cromite/files/vaapi-av1.diff @@ -0,0 +1,51 @@ +From 1245d8c56a0e9197e20f73b33b31f2bf6cfbe4bd Mon Sep 17 00:00:00 2001 +From: Xuanxi Leng +Date: Fri, 14 Oct 2022 09:36:39 -0400 +Subject: [PATCH] VaVDA: Add 'VDAVideoDecoder' support for AV1. + +This CL adds 'VDAVideoDecoder' support for AV1. + +Bug: 1325824 +Change-Id: I7787761c080aba680543e173bef12254ab7ccafe +--- + +diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +index 37e3520..4e77924 100644 +--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc ++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +@@ -41,6 +41,7 @@ + #include "media/gpu/vaapi/vaapi_utils.h" + #include "media/gpu/vaapi/vp8_vaapi_video_decoder_delegate.h" + #include "media/gpu/vaapi/vp9_vaapi_video_decoder_delegate.h" ++#include "media/gpu/vaapi/av1_vaapi_video_decoder_delegate.h" + #include "media/gpu/vp8_decoder.h" + #include "media/gpu/vp9_decoder.h" + #include "media/video/picture.h" +@@ -229,6 +230,12 @@ + decoder_delegate_ = accelerator.get(); + decoder_.reset(new VP9Decoder(std::move(accelerator), profile, + config.container_color_space)); ++ } else if (profile >= AV1PROFILE_MIN && profile <= AV1PROFILE_MAX) { ++ auto accelerator = ++ std::make_unique(this, vaapi_wrapper_); ++ decoder_delegate_ = accelerator.get(); ++ decoder_.reset(new AV1Decoder(std::move(accelerator), profile, ++ config.container_color_space)); + } else { + VLOGF(1) << "Unsupported profile " << GetProfileName(profile); + return false; +@@ -1196,12 +1203,11 @@ + VaapiVideoDecodeAccelerator::GetSupportedProfiles() { + VideoDecodeAccelerator::SupportedProfiles profiles = + VaapiWrapper::GetSupportedDecodeProfiles(); +- // VaVDA never supported VP9 Profile 2, AV1 and HEVC, but VaapiWrapper does. ++ // VaVDA never supported VP9 Profile 2 and HEVC, but VaapiWrapper does. + // Filter them out. + base::EraseIf(profiles, [](const auto& profile) { + VideoCodec codec = VideoCodecProfileToVideoCodec(profile.profile); +- return profile.profile == VP9PROFILE_PROFILE2 || +- codec == VideoCodec::kAV1 || codec == VideoCodec::kHEVC; ++ return profile.profile == VP9PROFILE_PROFILE2 || codec == VideoCodec::kHEVC; + }); + return profiles; + } diff --git a/www-client/cromite/metadata.xml b/www-client/cromite/metadata.xml new file mode 100644 index 000000000..b90dae57f --- /dev/null +++ b/www-client/cromite/metadata.xml @@ -0,0 +1,55 @@ + + + + + PF4Public@users.noreply.github.com + + + uazo/cromite + https://github.com/uazo/cromite/issues + + + Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser! + + + Build with CFI (Control Flow Integrity) enabled. It requires "-stdlib=libc++", see #40 for more details. + Use Clang compiler instead of GCC + Patch and build the convert_dict utility. The script will be installed into /usr/lib64/chromium-browser/update-dicts.sh. More info here: https://github.com/ungoogled-software/ungoogled-chromium/issues/188#issuecomment-444752907 + Enable DCHECK feature with severity configurable at runtime. Mostly intended for debugging and development, NOT RECOMMENDED for general use. + Build chromedriver + Build with GTK4 headers. + Enable support for Google Hangouts features such as screen sharing + Build Ozone only with headless backend, NOT RECOMMENDED for general uses + Enable HEVC decoding support. Should work with system-ffmpeg, but might require additional patching for the built-in one. + Use libXNVCtrl library from x11-drivers/nvidia-drivers instead of the bundled one + Enable Official build instead of Developer build. + Allow building on a PaX-enabled kernel + Whether to enable ThinLTO optimizations. Turning ThinLTO optimizations on can substantially increase link time and binary size, but they generally also make binaries a fair bit faster. + Optimize parts of Chromium's UI written with web technologies (HTML/CSS/JS) for runtime performance purposes. This does more work at compile time for speed benefits at runtime. + Enable PGO. Requires bundled binary profile data in sources tree. Often requires masked/testing llvm. + Disable optimized assembly code that is not PIC friendly + Enable proprietary codecs like H.264, MP3 + Enable support for remote desktop and screen cast using media-video/pipewire + Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels + Use the system dev-cpp/abseil-cpp instead of the bundled one + Use the system media-libs/libaom and media-libs/dav1d instead of the bundled ones + Use the system app-arch/brotli instead of the bundled one + Use the system dev-libs/crc32c instead of the bundled one + Use the system dev-libs/double-conversion instead of the bundled one + Use the system media-video/ffmpeg instead of the bundled one + Use the system media-libs/harfbuzz instead of the bundled one + Use the system dev-libs/icu instead of the bundled one + Use the system dev-libs/jsoncpp instead of the bundled one + Use the system dev-libs/libevent instead of the bundled one + Use the system dev-libs/libusb instead of the bundled one + Use the system media-libs/libvpx instead of the bundled one + Use the system media-libs/openh264 instead of the bundled one. If disabled, it will restrict USE=bindist. + Use the system-wide media-libs/openjpeg instead of the bundled one. OpenJPEG use are exclusively for Chromium's PDF viewer. + Use system libpng instead of the bundled one + Use the system-wide dev-libs/re2 instead of the bundled one + Use the system-wide app-arch/snappy instead of the bundled one + Use the system media-libs/woff2 instead of the bundled one + Build with ThinLTO support. LTO (Link Time Optimization) achieves better runtime performance through whole-program analysis and cross-module optimization (highly recommended). + Unsupported closed-source DRM capability (required by Netflix VOD) + +