diff --git a/app-misc/openhab-bin/Manifest b/app-misc/openhab-bin/Manifest
index d46700a93f6af..78175352ac272 100644
--- a/app-misc/openhab-bin/Manifest
+++ b/app-misc/openhab-bin/Manifest
@@ -1,4 +1,4 @@
-DIST openhab-5.1.3.tar.gz 121107971 BLAKE2B c2304ba9179b337670a8ec105948d0b4026cdfff1efa8169402b896945b0056d75361f160be7f32693e81d90befb5c4936191cd8c6804bf3881094c08edfd348 SHA512 bc3f15fffa01abee96aa7cc3e303a3bf35773ba1b9d72e81196f77055f9c269017e31975a6f4f9f6d6671a4eb6003b13c3832d796f7043525a94a01b71f876c2
DIST openhab-5.1.4.tar.gz 121105550 BLAKE2B 400d68439335a90ef77b0c16669d02ff528802d8b084e0f72415a7afe59cb7f8928c48652864583349ece5af8a2331135d3e7af395480fc2e9b989eab557aa48 SHA512 c9f18277eeea1750373243e456eec4d8dd56513f6c73a35fa30ef44e5e49b5690a2f852a3f596ad47ccbec231f7c400eb0eb49021e97be6f93c82cf671c99990
DIST openhab-5.2.1.tar.gz 125042753 BLAKE2B 8a6698856564de8eee307dfc6b608091acff0bda0a871b3611579d1fa72d62d4f8dedc138f5b546dd53d7aa57f2873143e1cefbfd910543bcf3f4a1cd8fd3b26 SHA512 7592aeb1dfaac703c63144602520ec04b7e081f3ee6073a4ce9f0668cf539765efd5fae13f94b6daeadac88ce2bdc94b9c2a751ff2c5889eeff8ce10cf8d5a22
+DIST openhab-5.2.3.tar.gz 125017436 BLAKE2B 73d97cf3f96f05709599c4f4d3683368f6e3fcc77a10dc0e702711c927fc403a9bf8864e4b28d2e47269a4e081cf12e936299abd74c9125fbde076baf7d8a52b SHA512 5cc210bf4acac1d9765e5d6f745ce88963aedb3ba3021992ef483ebd273ead6de2ea947d68859cffe154cbb0b0c3a56126a55553847ce067e64b647406415cd1
DIST openhab-cli-2024-01-14 8633 BLAKE2B 0b0999abcb884b779087b92f9f3e08fee3662753692392fbb30d218d0fc25fd1fca613c32b8193a3365764c55ac3525f8369aeea4edbf61223cd0219209c4cbf SHA512 bf24ae776d4362e8a60a0c71cb025834e5f645a24377a87484477f544026f2fdd996a1781f1082e62197fce33a9dadb5972df22ce3e4cd9f73d3088ec5bc0a98
diff --git a/app-misc/openhab-bin/openhab-bin-5.1.3.ebuild b/app-misc/openhab-bin/openhab-bin-5.2.3.ebuild
similarity index 97%
rename from app-misc/openhab-bin/openhab-bin-5.1.3.ebuild
rename to app-misc/openhab-bin/openhab-bin-5.2.3.ebuild
index a3bac642e0455..622c3e827ef14 100644
--- a/app-misc/openhab-bin/openhab-bin-5.1.3.ebuild
+++ b/app-misc/openhab-bin/openhab-bin-5.2.3.ebuild
@@ -21,7 +21,7 @@ S="${WORKDIR}"
LICENSE="EPL-2.0"
SLOT="0"
-KEYWORDS="amd64 arm64"
+KEYWORDS="~amd64 ~arm64"
MY_JAVA_DEPEND="virtual/jre:21"
@@ -54,6 +54,7 @@ src_install() {
domove runtime /usr/share/openhab/runtime
domove conf /etc/openhab
+ fowners -R openhab:openhab /etc/openhab
domove userdata /var/lib/openhab
fowners -R openhab:openhab /var/lib/openhab
diff --git a/media-video/ffmpeg-chromium/ffmpeg-chromium-156.0.8078.35.ebuild b/media-video/ffmpeg-chromium/ffmpeg-chromium-156.0.8078.35.ebuild
index a7f5f98c6727a..39103678ddc31 100644
--- a/media-video/ffmpeg-chromium/ffmpeg-chromium-156.0.8078.35.ebuild
+++ b/media-video/ffmpeg-chromium/ffmpeg-chromium-156.0.8078.35.ebuild
@@ -15,7 +15,7 @@ if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://chromium.googlesource.com/chromium/third_party/ffmpeg"
else
SRC_URI="https://deps.gentoo.zip/media-video/${P}.tar.xz"
- KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64"
+ KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64"
fi
LICENSE="
diff --git a/www-apps/chromedriver-bin/Manifest b/www-apps/chromedriver-bin/Manifest
index 0c55669db531e..b3915f65f97b6 100644
--- a/www-apps/chromedriver-bin/Manifest
+++ b/www-apps/chromedriver-bin/Manifest
@@ -1,6 +1,6 @@
-DIST chromedriver-bin-154.0.8037.92.linux-arm64.zip 10936830 BLAKE2B ee99bbb0a782cb3c9c19ba5b24281a7c0cf9ca3a274b6f6766de977407d15117e7e3c9320caa6ee534555961aead08b396f2f1a7b6b26a3cae8b96195ecfa607 SHA512 40fcd6e5cbb36e29c898b475305c50ca00db8c88950cd5a4be814a031ba4e656bffc0158e56a670097d9508349e5d65bcb4010424f9b731a495940a297d9ff48
-DIST chromedriver-bin-154.0.8037.92.linux64.zip 11857075 BLAKE2B bb7dedf9391633d1877bca2684c29283a914fc964b64f0bcd0d4370175507d08a45ca14a55c8b98d29c40888f1bef25b2ba7ab1cd9a2fe7e986d206e688a6918 SHA512 30b9b5d3d978ffd0f07964e73b8f1ac5df4099893ccafc2554c6fcf89eb0aa70fbfb1bc6edfa1a305cb2bbefbe6f365d9b2f4363194964d2708f27015a69bdd3
DIST chromedriver-bin-156.0.8078.47.linux-arm64.zip 10946358 BLAKE2B 4924d8beb1117a050f79f59dc79ee68861ef5b87c15de51985f7f590e4ca7c9b41a85d928df4e221f4128377f312b49b13ad7e2f6cf9b09e2a2d5a5c9168c2e1 SHA512 d2e9bced456d20e589069b7ea6ab46f2aa328eb8947e15c675a02a93b76f67f7f9eb34b510f46f659f2b362c046411a3130d10e991bf54e11ba3fbededcc8c50
DIST chromedriver-bin-156.0.8078.47.linux64.zip 11883134 BLAKE2B 45ba20ffc5a8ee35203a3fd976816f03eef193c27f73a2aff4a4be0d6a8153068f477ba3512121dd796ed51083cfac036935f3768da120968409b8bd0f13e3c7 SHA512 1b4bede6b067698e21f6338bf73e29191f205c07e29378ba2591bec23e61468111d32a8f5a4e548e1d42f962565290149eb52caf1ed65b6ad03cdb75687d054b
DIST chromedriver-bin-156.0.8078.79.linux-arm64.zip 10973227 BLAKE2B 00214458a11df4527f1daf708c2bd5dae0ba2b72331aa6f12fba8f7adb9a7bce2edb8d18228d498450ae3af7b85645d65dd7c11bb55f08544cb86b790c5edb46 SHA512 561f539d9586b82f154e0bca3b8be4cb8c1d242884eae4f526b1d6269e9666c57bbf25a4c8cb337194b6f9210b3a56c79a4052b79efdb553b6fb5526c9fc8a86
DIST chromedriver-bin-156.0.8078.79.linux64.zip 11898513 BLAKE2B 4216d3b71f26066a2c551f9c2d3013efd8ce22847fda124b4d651cbe4964b5c1ecbf14cb49c90ca51a2f2357dc7ea4d0642a10ca626b4d33799dd5d172a4238c SHA512 c27a14b0cae8cbb76e99d9b152e0fe21628eb0d6eb6f85d6cd1329184ee4807e273940e96ba6a76b0728d9a81f8f00b8abd299ef55aa6e6fcce037c2b0dbb960
+DIST chromedriver-bin-157.0.8103.38.linux-arm64.zip 11116929 BLAKE2B 4f72f7a49aa128edc06feb544140bfdd4a533cc6bd06bb39d8fec1ffeb33975528994a863415049d6a5c6ba0e8ef9a4d1b85451c3a9a4b8e434de4aa040bf4a7 SHA512 ed25718ab62c05ecfb9cf6b983740d7114581608c6f6edf550bf1831aece168f7d4213275fa11408dc262e50cf00589f1793f1870eaf1492c96e250303c4fd8f
+DIST chromedriver-bin-157.0.8103.38.linux64.zip 11979703 BLAKE2B b6026a3004463534944677d5e221fc72733e75eb560fb994c5c6c133c7d34fb5e20ef557e608535c98ecec6362f7ce17132460e8489c5c37b419fa2b3e24f5ec SHA512 1b31198680c89794bd8d1d53fbd7c4e75f8f34e23329758d2ca687327cce3c37ed2b9f6bc47f3093f0472d4b8cbc247202e9c37ac6dd92d81eb6d1aad2c4c34e
diff --git a/www-apps/chromedriver-bin/chromedriver-bin-154.0.8037.92.ebuild b/www-apps/chromedriver-bin/chromedriver-bin-157.0.8103.38.ebuild
similarity index 97%
rename from www-apps/chromedriver-bin/chromedriver-bin-154.0.8037.92.ebuild
rename to www-apps/chromedriver-bin/chromedriver-bin-157.0.8103.38.ebuild
index b81b83c66c01c..bea1fc0954802 100644
--- a/www-apps/chromedriver-bin/chromedriver-bin-154.0.8037.92.ebuild
+++ b/www-apps/chromedriver-bin/chromedriver-bin-157.0.8103.38.ebuild
@@ -14,7 +14,7 @@ S="${WORKDIR}"
LICENSE="google-chrome"
SLOT="0"
-KEYWORDS="-* amd64 arm64"
+KEYWORDS="-* amd64"
RESTRICT="bindist mirror strip"
RDEPEND="
diff --git a/www-client/chromium-common/chromium-common-2.ebuild b/www-client/chromium-common/chromium-common-2.ebuild
deleted file mode 100644
index a16de5c60b248..0000000000000
--- a/www-client/chromium-common/chromium-common-2.ebuild
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="Common configuration files for Chromium slots"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Chromium/"
-S="${WORKDIR}"
-
-LICENSE="GPL-2+"
-SLOT="0"
-KEYWORDS="amd64 arm64 ~ppc64 ~riscv"
-RESTRICT="test" # There is no code, only Zuul.
-
-# Non-slotted Chromium will conflict
-RDEPEND="!www-client/chromium:0"
-
-src_unpack() {
- :
-}
-
-src_configure() {
- :
-}
-
-src_compile() {
- sed -e "s:/usr/lib/:/usr/$(get_libdir)/:g" "${FILESDIR}/chromium-launcher.sh" \
- > chromium-launcher.sh || die
-}
-
-src_install() {
- exeinto /usr/libexec/chromium
- doexe chromium-launcher.sh
-
- insinto /etc/chromium
- newins "${FILESDIR}/chromium.default" default
-}
diff --git a/www-client/chromium-common/files/chromium-launcher.sh b/www-client/chromium-common/files/chromium-launcher.sh
deleted file mode 100644
index 88150a9a20dc3..0000000000000
--- a/www-client/chromium-common/files/chromium-launcher.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/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/chromium/*; do
- # Skip backup files and hidden files #546394
- case "${f}" in
- *~|*.bak|*.old|*.swp|*.tmp|*/.*) continue ;;
- esac
- [[ -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"}
-
-# We rely on the slotted stub to provide CHROME_WRAPPER.
-if [[ -z "${CHROME_WRAPPER}" ]]; then
- echo "ERROR: CHROME_WRAPPER is not set. The Chromium launcher stub is misconfigured." >&2
- exit 1
-fi
-
-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.
- echo "Refusing to run as root is a safety feature. Running as root disables the sandbox." >&2
- CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium
- ${CHROMIUM_FLAGS}"
-fi
-
-# Select session type and platform; var comes from the stub launcher.sh generated by the ebuild
-if [[ ${OZONE_AUTO_SESSION} == true ]]; 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
-
-# Sanitise std{in,out,err} because they'll be shared with untrusted child
-# processes (http://crbug.com/376567).
-exec < /dev/null
-exec > >(exec cat)
-exec 2> >(exec cat >&2)
-
-exec -a "/usr/bin/${CHROME_EXEC_NAME:-chromium-browser}" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"
diff --git a/www-client/chromium-common/files/chromium.default b/www-client/chromium-common/files/chromium.default
deleted file mode 100644
index c140cdeb56662..0000000000000
--- a/www-client/chromium-common/files/chromium.default
+++ /dev/null
@@ -1,5 +0,0 @@
-# Default settings for chromium. This file is sourced by /bin/bash from
-# the chromium launcher.
-
-# Options to pass to chromium.
-#CHROMIUM_FLAGS=""
diff --git a/www-client/chromium-common/metadata.xml b/www-client/chromium-common/metadata.xml
deleted file mode 100644
index 2d09c6eed081e..0000000000000
--- a/www-client/chromium-common/metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- chromium@gentoo.org
- Chromium in Gentoo Project
-
-
- kangie@gentoo.org
- Matt Jolly
-
-
-
diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
deleted file mode 100644
index 99a2f6242e89f..0000000000000
--- a/www-client/chromium/Manifest
+++ /dev/null
@@ -1,22 +0,0 @@
-DIST chromium-150.0.7871.128-linux.tar.xz 1670297068 BLAKE2B c99df5e0961adddfcd754f1b80732beefce5d58c7e57accba0ae9d9e8216c641fad794c4d6c8fbe7d3c42430a4f8ae41a389d59f0f8eac9275bd329ba1b75577 SHA512 543f66d3164c27f138d44630fedf4e769bf9577282130ec1083430aa698c9967eb63be35d297100dd842acb6e3cf330bbe94d194ef02a8d932f0f2a78d83a9f9
-DIST chromium-150.0.7871.13-linux.tar.xz 1667467376 BLAKE2B 3f508559f329592e18ea45d2476d7197a7fbf2e36659362bb02e2d47a71dfff7ecc4979d96982b41d86058cd4a833c09075ded4492a4c60cb28fe786cfd18153 SHA512 c939a6cdd2abf10dbe32b1fe85091939876285a7ae7d68e48630f209acdd92e4a2471d7613e2c83fd712ccd0f6a9087cf48b4ad043764745e015d675c4aaf747
-DIST chromium-150.0.7871.181-linux.tar.xz 1668476496 BLAKE2B 9d6fb2cc9a12c935f16b1b7e28b0fa82cc8bc891deda1896c31d9b1a67a342d1cc16101ec750f663a06e4e1246d558d8ec01c1b7199d594971a3db938257455c SHA512 e45213d626456f72b2994e44a7026ebcc92262066c436f51c7922b9d161d1a4900ca042dfe2c617eba04c488e76de0728acad43bd542fdce68098144d25c7d30
-DIST chromium-150.0.7871.186-linux.tar.xz 1668494832 BLAKE2B 8edda676c99dab33bab5ffe6c87bcb5bc3066ee9f7bb36d1a0d0aa7b58e4009f35f4d7e4776a9d80722b54429931d6c1720c77284f2877cf925a6275d38b9dd2 SHA512 e1ee5851277c5a32d89a021b8f20736dfeab1bd046f6dbfa8d22137ff5366119cc845cdb8f87ce42a26d48703734984db4181dfa219dba093a52915f5be9976f
-DIST chromium-151.0.7872.0-linux.tar.xz 1673299600 BLAKE2B 6a2b0da9238c03fba9360b2575def84c0efd90a110ce5d08b9f86eeb1027acf96902ba76e30329b4a871ad4dc9897159bc1920d615147253b7558af12dd2d4a7 SHA512 0afe87ad10b28b01974b8154edd50b735a96e692811fd7af66ca62cd5e74292f22bbbdcc5e7ff5310c6c1ab31d62a18dd4421ee9b0366c6a9c5170307e80acbc
-DIST chromium-151.0.7922.108-linux.tar.xz 1711846220 BLAKE2B c3cfc831e42469d3e8aa42c1d8709f34353d2964c94d06247418fd246bb4b5d6b68cb9266860f14947d1673ea922cd0868018b722a79a82538ad476004a45142 SHA512 b5e63e6ebd554a4f38889450bc42e2ff9bb60a5c85c98840b871e8efa498a4d0e96db18c8240d425d8883c00f3219346736a98c655fe3f3609cace079cc765d9
-DIST chromium-151.0.7922.137-linux.tar.xz 1711946116 BLAKE2B 2bb21793c3da2ea802485d2dae324a86eeca2f9fb3e7b77294f78e41097effd4e37febd37133123e85531c1c2f0f5499443f90adb7a754545765880a460011c2 SHA512 379dede0ca1ae3137e67776608a1b899ecdfa2c5c566df92841f63f1643dbe09d021df05a6a2d1fd853fb7d0fab95e2fea6a4568c18a94fdb84758e0f668f68b
-DIST chromium-151.0.7922.169-linux.tar.xz 1712223012 BLAKE2B 509ab9d5096d59b594d52b35c33bd5fbd7de0412fadbd8fa5d0993378cc6e1e49eafcb560a63838fc6b3153de407ba8ab837ca33698f9c18472bc225836433cb SHA512 7ba2a9f420f27d05b38c4b82a2c2eefc734fbb26553183a47afdaf7f535c31b4c19bc4c7b98abede459d8d7d8174dce5005505d70b702fb9f0dc80240ada4eab
-DIST chromium-clang-llvmorg-23-init-10931-g20b6ec66-11.tar.xz 69635068 BLAKE2B 5250889dac7ca048030266b9e5eb9b08a1288acb1023fff3513555ca361f787fdb273b04d5cb5cc9960d7d13e804604ca63e65b056d1873a8f5e1d56e8f59db8 SHA512 4a1f06bacfb5894e277f3957df3adcc937f262ec91927d6fd97a2e4b88b795e2559a8498be633d6b191dd4d52a5df52669f76c59c2939689f5f88fc7457cabae
-DIST chromium-clang-llvmorg-23-init-19482-g53d18800-1.tar.xz 59093892 BLAKE2B faf8c5011b0271903a9a09a4539002088030eac34ac01c4b84581a556f761f89eac035feda5b97be350679325968db99face036c201972b01dd081ced3468edc SHA512 5d88f1ed4901c80963b6740c9b15a28c33db397f8bf31503502b00caff172e17d37f7b946da31162e04794fee763e0b7456a9fc476827c8a19cdd1e737b9b68a
-DIST chromium-openpower-7aae8a84e3.tar.bz2 441026 BLAKE2B efceb75ba53899388398a4564ef29c9fe66427e160a3e7f3375fd3eec8d1ffef335ca14865c11510e9c3719daab11dfb0954ed4a7b847dee602773d51f5e1e0f SHA512 cbe75ae78226b784904a263f7eb01e44faab71efb4a35ca46ff551ff17c0c5f1cdd8f839313ad3bb678b6ca56e4d95899f7802a548ffe7bb90582d9df5614c21
-DIST chromium-openpower-a85b64f07b.tar.bz2 440915 BLAKE2B 50164a35bae4ddd2316bc38d1f9533dc2cc8172e306683163c0ed39a1db2476e425a233e9ab3e2c44aa1cd349a49bebc87963d4c1f7c7682f58150f2dbcd4bc9 SHA512 09914581fbe8bdea84fe0564f14bdddc91b5fc9deab214b9d58001f45056b6d9ea520a2a3ff0f5e2721dfbc3c75c5d897dcee660a5dc684c2efae94fade72117
-DIST chromium-patches-150-1.tar.bz2 23403 BLAKE2B d8fee8a13aa6cddc3a465663bb1ec23384560e9fa5de5bd40fc606087570d484b8a4c208eae3da17f46a82b4ba64b8b5e21cda0336ea8729dfca36b67fd9935a SHA512 847ad4ae0d3d0090d2bbb28444bb91361f0bcc05aafa239b3a8900b0ec5934f2080fe21a783f6caf1bd8e222f2bdbb2a43ee991f1ad0cabcc9f9a6583441c1d2
-DIST chromium-patches-151-3.tar.bz2 23198 BLAKE2B 5227fb7f6e1c80297b6b7d8b4efaa31ead935ffb63e5ad47e45c70d2e7c6692cc4d015ae1dc9234c7ea3365a67db8ec2912890af2508a5132062a9b1f395b94c SHA512 3839400b31b58965d1340b26112c6c4b4ce613fd54290d141bb875aa7163107d02a10edbfdc18fb8b92c7d6e2e1b1f07b545ba5379fe070adb3040ea2ae3458b
-DIST chromium-patches-151.tar.bz2 23398 BLAKE2B 42606d6123bca47afe573df8f44b77511c1aa48c3e26cf7a9ac45af0f887ba88e71dff08ac4b1c2a2f277d337c577c19b903baf817280f29a499cbd3e7b86560 SHA512 5b81fefc84a395f7401e15db19a056140bd414bcb547beab697b54c7063db1df6c2109cc1e581601b7ac89b49c9df555ae7ba0d8fff9bed5bf554d5393cbc272
-DIST chromium-patches-copium-3c7e56fb45.tar.gz 13304 BLAKE2B 782f3b24d817aaa03cbf45dcfe679c580e62a2f7f8493ecd8398bd936c5cc635c5999f8c3b487b1b7ce1e86496eeef73e55a750424c42252b3e8c4363ccc5e19 SHA512 b8af6b95bbb7c8ea47db00912372bfbabd60d56f060a41707a94d14e37acebe693a853cfed74b8d557f8ef15491807f3121226ca7db86823dfcade85e3b2e5a1
-DIST chromium-patches-copium-b00f26bb5e.tar.gz 15099 BLAKE2B 886897afba6cb4495ab74298d8ae72643294dba1996a5a7d2939f83fb4af1cb599f7e4cd263b852fe595cf52e0a3689305d6a3c028014f9c4172df7deaf3e2dd SHA512 c337bcb6487252fa679b5910672230677aba87fa7572ecbfea32b369785326e12f06fd3d44c65f16fe32c1e83b5b8e710e81c970cdf03f24f25a68577f6984b9
-DIST chromium-profiler-0.2.tar 259952640 BLAKE2B 5e82389fce00b267280d633b26551231c558b80f0c92cd7d60271095a3503365ab673e7a46dc5f74f8a82db1f21262cb24dcc0531d954bab5fb3b175dab3394d SHA512 9fa89a5ab728419683e7495ae676567480987d68a2d589f2aa97bfcbcf123f3c8f97f8bca5f65e5e3f6e41475535add473ded83b9c7a33bb4746a9d05b298a6c
-DIST chromium-rust-toolchain-4c4205163a-5-llvmorg-23-init-10931-g20b6ec66.tar.xz 274476304 BLAKE2B 007d4f955a915f000ace0d4473601c4602c9b47b80a60e1c60b8b1872cf6d19ff18b5d21bd0e5db52f82c839c9957882da291cbc6b619ec20b5dfdcde1298778 SHA512 0366b292a26d47de85eb28a7a085f6a670ca4e0e274d1e8090dc472deacd12fcbe3abc0f2a9401c6a9857405d87c38de9c7e3af55413bbbdb677b41fc5d3732a
-DIST chromium-rust-toolchain-b998449636-2-llvmorg-23-init-19482-g53d18800.tar.xz 274790504 BLAKE2B ff04e59cbb3272790bd80e0e79a547c1439c7f12861fc92da39c4b1b5daeecf012d1cfe1b6b3896051e33aca8b379c33b7b2c4810067c8cb55ffef7c92c2d293 SHA512 0ca4419d701664c25859bfc60e7d9fe5e8e1b52552536e6db46acaf79a6ea53a00e3a10607d8c8c5f6226b674be7d96515f4a3ce8ff148db9672d826156fa6a6
-DIST chromium-testfonts-9c07d19d9c.tar.gz 33413117 BLAKE2B 95cb79288de5697b6de2a6f503f81bcfb7687ea1af0bd0e6db8cfc09af7cdaedd9a83f36dd9d0a3ac19dfca8ac7a6c3a891922a192db012688565c06da8a9cf8 SHA512 2d3602b7a924d2bb8d538882f13a05428e23bf16ea3a9cf07eb13801fe7f33261ce61f2e5dc12e5c6f61f21b392526024d1969e8a967cf1f5138c647b84025b6
-DIST rollup-wasm-node-4.57.1.tgz 792515 BLAKE2B 52fa9c4b65f3e20149c66fdd44b3c2a8b47e836d87de85535dbbf8b7243acef3d65c5be9f794eebb1533af2f16888a1cb42a75ed392ba65251cf60b73b41d559 SHA512 6f4adc247f329046a77e04de0ed94fb9b86984850ec74a1a01e93ede18b34da164a02d450524ec6341a2c700780f91d9e6bdc6b76c88f5cf0cd7739c5bf916e4
diff --git a/www-client/chromium/chromium-150.0.7871.128.ebuild b/www-client/chromium/chromium-150.0.7871.128.ebuild
deleted file mode 100644
index 8303549bf8897..0000000000000
--- a/www-client/chromium/chromium-150.0.7871.128.ebuild
+++ /dev/null
@@ -1,1772 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-10931-g20b6ec66-11"
-BUNDLED_RUST_VER="4c4205163abcbd08948b3efab796c543ba1ea687-5"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
-PATCH_V="${PV%%\.*}-1"
-COPIUM_COMMIT="b00f26bb5e0781020da5f830981472a142c6baf1"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-# Unstable in gentoo exists mostly to give devs some breathing room for beta/stable releases.
-# It shouldn't be keyworded but adventurous users are encouraged to select it;
-# there's official dev channel Google Chrome after all.
-KEYWORDS="amd64 arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( >=media-video/ffmpeg-chromium-150.0.7871.124:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # https://issues.chromium.org/issues/442698344
- # Unreleased fontconfig changed magic numbers and google have rolled to this version
- if has_version "<=media-libs/fontconfig-2.17.1"; then
- PATCHES+=( "${FILESDIR}/chromium-142-work-with-old-fontconfig.patch" )
- fi
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids; upstream is woefully out of date (2015!)
- sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos/confidentialcompute
- third_party/federated_compute/src/fcp/protos/federatedcompute
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- if tc-ld-is-mold; then
- myconf_gn+=(
- "use_mold=true"
- "use_lld=false"
- "linker_path=\"${EPREFIX}/usr/bin/mold\""
- )
- else
- myconf_gn+=( "use_lld=true" )
- fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-150.0.7871.13.ebuild b/www-client/chromium/chromium-150.0.7871.13.ebuild
deleted file mode 100644
index 286a16e7a1a87..0000000000000
--- a/www-client/chromium/chromium-150.0.7871.13.ebuild
+++ /dev/null
@@ -1,1771 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-10931-g20b6ec66-11"
-BUNDLED_RUST_VER="4c4205163abcbd08948b3efab796c543ba1ea687-5"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
-PATCH_V="${PV%%\.*}-1"
-COPIUM_COMMIT="b00f26bb5e0781020da5f830981472a142c6baf1"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="beta"
-# Unstable in gentoo exists mostly to give devs some breathing room for beta/stable releases.
-# It shouldn't be keyworded but adventurous users are encouraged to select it;
-# there's official dev channel Google Chrome after all.
-KEYWORDS="~amd64 ~arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( media-video/ffmpeg-chromium:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # https://issues.chromium.org/issues/442698344
- # Unreleased fontconfig changed magic numbers and google have rolled to this version
- if has_version "<=media-libs/fontconfig-2.17.1"; then
- PATCHES+=( "${FILESDIR}/chromium-142-work-with-old-fontconfig.patch" )
- fi
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids; upstream is woefully out of date (2015!)
- sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos/confidentialcompute
- third_party/federated_compute/src/fcp/protos/federatedcompute
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- if tc-ld-is-mold; then
- myconf_gn+=(
- "use_mold=true"
- "use_lld=false"
- "linker_path=\"${EPREFIX}/usr/bin/mold\""
- )
- else
- myconf_gn+=( "use_lld=true" )
- fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-150.0.7871.181.ebuild b/www-client/chromium/chromium-150.0.7871.181.ebuild
deleted file mode 100644
index f88a1d1c9165d..0000000000000
--- a/www-client/chromium/chromium-150.0.7871.181.ebuild
+++ /dev/null
@@ -1,1772 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-10931-g20b6ec66-11"
-BUNDLED_RUST_VER="4c4205163abcbd08948b3efab796c543ba1ea687-5"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
-PATCH_V="${PV%%\.*}-1"
-COPIUM_COMMIT="b00f26bb5e0781020da5f830981472a142c6baf1"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-# Unstable in gentoo exists mostly to give devs some breathing room for beta/stable releases.
-# It shouldn't be keyworded but adventurous users are encouraged to select it;
-# there's official dev channel Google Chrome after all.
-KEYWORDS="~amd64 arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( >=media-video/ffmpeg-chromium-150.0.7871.124:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # https://issues.chromium.org/issues/442698344
- # Unreleased fontconfig changed magic numbers and google have rolled to this version
- if has_version "<=media-libs/fontconfig-2.17.1"; then
- PATCHES+=( "${FILESDIR}/chromium-142-work-with-old-fontconfig.patch" )
- fi
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids; upstream is woefully out of date (2015!)
- sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos/confidentialcompute
- third_party/federated_compute/src/fcp/protos/federatedcompute
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- if tc-ld-is-mold; then
- myconf_gn+=(
- "use_mold=true"
- "use_lld=false"
- "linker_path=\"${EPREFIX}/usr/bin/mold\""
- )
- else
- myconf_gn+=( "use_lld=true" )
- fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-150.0.7871.186.ebuild b/www-client/chromium/chromium-150.0.7871.186.ebuild
deleted file mode 100644
index f529b8ce7deed..0000000000000
--- a/www-client/chromium/chromium-150.0.7871.186.ebuild
+++ /dev/null
@@ -1,1774 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-10931-g20b6ec66-11"
-BUNDLED_RUST_VER="4c4205163abcbd08948b3efab796c543ba1ea687-5"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
-PATCH_V="${PV%%\.*}-1"
-COPIUM_COMMIT="b00f26bb5e0781020da5f830981472a142c6baf1"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-# Unstable in gentoo exists mostly to give devs some breathing room for beta/stable releases.
-# It shouldn't be keyworded but adventurous users are encouraged to select it;
-# there's official dev channel Google Chrome after all.
-KEYWORDS="~amd64 ~arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( >=media-video/ffmpeg-chromium-150.0.7871.124:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
- if tc-ld-is-mold; then
- ewarn "Mold is currently not supported, it will not be used"
- fi
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # https://issues.chromium.org/issues/442698344
- # Unreleased fontconfig changed magic numbers and google have rolled to this version
- if has_version "<=media-libs/fontconfig-2.17.1"; then
- PATCHES+=( "${FILESDIR}/chromium-142-work-with-old-fontconfig.patch" )
- fi
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids; upstream is woefully out of date (2015!)
- sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos/confidentialcompute
- third_party/federated_compute/src/fcp/protos/federatedcompute
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
- # Currently disabled, runtime issues with mold
- #if tc-ld-is-mold; then
- #if myconf_gn+=(
- #if "use_mold=true"
- #if "use_lld=false"
- #if "linker_path=\"${EPREFIX}/usr/bin/mold\""
- #if )
- #if else
- myconf_gn+=( "use_lld=true" )
- #fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-151.0.7872.0.ebuild b/www-client/chromium/chromium-151.0.7872.0.ebuild
deleted file mode 100644
index 7a0230147f73c..0000000000000
--- a/www-client/chromium/chromium-151.0.7872.0.ebuild
+++ /dev/null
@@ -1,1772 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-10931-g20b6ec66-11"
-BUNDLED_RUST_VER="4c4205163abcbd08948b3efab796c543ba1ea687-5"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
-PATCH_V="${PV%%\.*}"
-COPIUM_COMMIT="b00f26bb5e0781020da5f830981472a142c6baf1"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="unstable"
-# Unstable in gentoo exists mostly to give devs some breathing room for beta/stable releases.
-# It shouldn't be keyworded but adventurous users are encouraged to select it;
-# there's official dev channel Google Chrome after all.
-# KEYWORDS="~amd64 ~arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( media-video/ffmpeg-chromium:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # https://issues.chromium.org/issues/442698344
- # Unreleased fontconfig changed magic numbers and google have rolled to this version
- if has_version "<=media-libs/fontconfig-2.17.1"; then
- PATCHES+=( "${FILESDIR}/chromium-142-work-with-old-fontconfig.patch" )
- fi
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids; upstream is woefully out of date (2015!)
- sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos/confidentialcompute
- third_party/federated_compute/src/fcp/protos/federatedcompute
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- if tc-ld-is-mold; then
- myconf_gn+=(
- "use_mold=true"
- "use_lld=false"
- "linker_path=\"${EPREFIX}/usr/bin/mold\""
- )
- else
- myconf_gn+=( "use_lld=true" )
- fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- # add a `-v` here if gn `hangs` to see which file it's getting stuck on.
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-151.0.7922.108.ebuild b/www-client/chromium/chromium-151.0.7922.108.ebuild
deleted file mode 100644
index 9d24a0e3061e2..0000000000000
--- a/www-client/chromium/chromium-151.0.7922.108.ebuild
+++ /dev/null
@@ -1,1816 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-19482-g53d18800-1"
-BUNDLED_RUST_VER="b998449636a48e2c4a362809085b600a0174e1f2-2"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-GO_MIN_VER="1.25.0"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="7aae8a84e327fc2078ce1625c9c70bfda77d626f"
-PATCH_V="151-3"
-COPIUM_COMMIT="3c7e56fb4523b43b47595bb3a22f77178fc76293"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-KEYWORDS="~amd64 arm64 ~ppc64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( media-video/ffmpeg-chromium:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- >=dev-lang/go-${GO_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- if tc-ld-is-mold; then
- ewarn "Mold is currently not supported, it will not be used"
- fi
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # So many fontconfig magic numbers to cover
- # TODO: once upstream roll to 2.18.2+ set that as our minimum and remove this logic.
- # <=2.17.1 -> 9
- # >2.17.1 && <2.18.2 -> 11
- # >=2.18.2 -> 12
- local fontconfig_cache_magic=9
- if has_version ">=media-libs/fontconfig-2.18.2"; then
- fontconfig_cache_magic=12
- elif has_version ">media-libs/fontconfig-2.17.1"; then
- fontconfig_cache_magic=11
- fi
-
- sed -E -i \
- -e "s#(fb5c91b2895aa445d23aebf7f9e2189c-le64\.cache-)(9|10|11|12)#\1${fontconfig_cache_magic}#g" \
- third_party/test_fonts/fontconfig/BUILD.gn || die "Failed to set fontconfig cache magic in BUILD.gn"
-
- sed -E -i \
- -e "s#(kCacheKey \+ \"/-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- -e "s#(kCacheKey \+ \"-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc || \
- die "Failed to set fontconfig cache magic in generate_fontconfig_caches.cc"
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids
- sed 's|//third_party/usb_ids/src/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/chromium/fcp/protos
- third_party/federated_compute/chromium/fcp/secagg
- third_party/federated_compute/chromium/fcp/client
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos
- third_party/federated_compute/src/fcp/client
- third_party/federated_compute/src/fcp/secagg
- third_party/federated_compute/third_party/googleapis/src/google
- third_party/federated_compute/third_party/tensorflow-federated
- third_party/federated_compute/third_party/protodatastore-cpp
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- # Currently disabled, runtime issues with mold
- #if tc-ld-is-mold; then
- # myconf_gn+=(
- # "use_mold=true"
- # "use_lld=false"
- # "linker_path=\"${EPREFIX}/usr/bin/mold\""
- # )
- #else
- myconf_gn+=( "use_lld=true" )
- #fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- # use system go
- "tint_use_system_go=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- # add a `-v` here if gn `hangs` to see which file it's getting stuck on.
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
-
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- local test_libs=(
- "libimmediate_crash_test_helper.so"
- "libmalloc_wrapper.so"
- "libtest_shared_library.so"
- "libtest_trace_processor.so"
- )
- if use test; then
- local test_lib
- for test_lib in "${test_libs[@]}"; do
- rm -f "out/Release/${test_lib}" || die "Failed to remove ${test_lib}"
- done
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-151.0.7922.137.ebuild b/www-client/chromium/chromium-151.0.7922.137.ebuild
deleted file mode 100644
index 7b7db328bbb15..0000000000000
--- a/www-client/chromium/chromium-151.0.7922.137.ebuild
+++ /dev/null
@@ -1,1872 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-19482-g53d18800-1"
-BUNDLED_RUST_VER="b998449636a48e2c4a362809085b600a0174e1f2-2"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.16.0-r1"
-GO_MIN_VER="1.25.0"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="7aae8a84e327fc2078ce1625c9c70bfda77d626f"
-PATCH_V="151-3"
-COPIUM_COMMIT="3c7e56fb4523b43b47595bb3a22f77178fc76293"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-KEYWORDS="~amd64 ~arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( media-video/ffmpeg-chromium:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- || (
- $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}')
- >=sys-devel/mold-2.41.0
- )
- !official? ( >=sys-devel/mold-2.41.0 )
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- >=dev-lang/go-${GO_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- if tc-ld-is-mold; then
- ewarn "Mold is currently not supported, it will not be used"
- fi
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # So many fontconfig magic numbers to cover
- # TODO: once upstream roll to 2.18.2+ set that as our minimum and remove this logic.
- # <=2.17.1 -> 9
- # >2.17.1 && <2.18.2 -> 11
- # >=2.18.2 -> 12
- local fontconfig_cache_magic=9
- if has_version ">=media-libs/fontconfig-2.18.2"; then
- fontconfig_cache_magic=12
- elif has_version ">media-libs/fontconfig-2.17.1"; then
- fontconfig_cache_magic=11
- fi
-
- sed -E -i \
- -e "s#(fb5c91b2895aa445d23aebf7f9e2189c-le64\.cache-)(9|10|11|12)#\1${fontconfig_cache_magic}#g" \
- third_party/test_fonts/fontconfig/BUILD.gn || die "Failed to set fontconfig cache magic in BUILD.gn"
-
- sed -E -i \
- -e "s#(kCacheKey \+ \"/-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- -e "s#(kCacheKey \+ \"-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc || \
- die "Failed to set fontconfig cache magic in generate_fontconfig_caches.cc"
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids
- sed 's|//third_party/usb_ids/src/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/chromium/fcp/protos
- third_party/federated_compute/chromium/fcp/secagg
- third_party/federated_compute/chromium/fcp/client
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos
- third_party/federated_compute/src/fcp/client
- third_party/federated_compute/src/fcp/secagg
- third_party/federated_compute/third_party/googleapis/src/google
- third_party/federated_compute/third_party/tensorflow-federated
- third_party/federated_compute/third_party/protodatastore-cpp
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-
- if ! use official; then
- ln -s /usr/bin/mold buildtools/third_party/mold/cipd/mold || die
- fi
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- # Currently disabled, runtime issues with mold
- #if tc-ld-is-mold; then
- # myconf_gn+=(
- # "use_mold=true"
- # "use_lld=false"
- # "linker_path=\"${EPREFIX}/usr/bin/mold\""
- # )
- #else
- myconf_gn+=( "use_lld=true" )
- #fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- # use system go
- "tint_use_system_go=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- # add a `-v` here if gn `hangs` to see which file it's getting stuck on.
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # Since 151.0.7922.137
- 'CheckDeathTest.*'
- 'EnumSetDeathTest.*'
- 'OptionalRefDeathTest.*'
- 'RawRefDeathTest.*'
- 'AlternateTestParams/PartitionAllocDeathTest.CheckTriggered*'
- 'CallbackHelpersTest.*'
- 'SafeRefTest.*'
- 'SpanTest.*'
- 'WeakValueTableTest.*'
- 'PlatformSharedMemoryRegionTest.*'
- 'RefCountedOverflowTest.*'
- 'SingleThreadTaskRunnerCurrentDefaultHandleTest.*'
- 'TestFutureDeathTest.*'
- 'WeakPtrDeathTest.*'
- 'SafeRefDeathTest.*'
- 'LinkedListDeathTest.*'
- 'BindDeathTest.*'
- 'ReallocProtectedIteratorDeathTest.*'
- 'PASpanTest.*'
- 'BackupRefPtrTest.*'
- 'All/Base64Test.Overflow*'
- 'ValuesTest.*'
- 'TaskEnvironmentTest.*'
- 'CheckedObserverListTest.*'
- 'MemoryConsumerRegistryTest.*'
- ProtectedMemoryDeathTest.FailsIfDefinedOutsideOfProtectMemoryRegion
- StructuredSharedMemoryDeathTest.DuplicateRegion
- CheckedContiguousIteratorDeathTest.OutOfBounds
- HeapArrayDeathTest.TakeFirstWithOverSize
- CallbackDeathTest.RunNullCallbackChecks
- ObserverListThreadSafeDeathTest.CrossThreadRemovalRestricted
- SequencedTaskRunnerCurrentDefaultHandleDeathTest.OverrideWithNull
- TestFutureWithoutTaskEnvironmentDeathTest.WaitShouldDcheckWithoutTaskEnvironment
- ScopedThreadPriorityDeathTest.NoRealTime
- ReallocProtectedIteratorDeathTest.StringReallocCrashes
- BarrierCallbackTest.ErrorToCallCallbackWithZeroCallbacks
- BarrierClosureTest.ChecksIfCalledForZeroClosures
- SupportsUserDataTest.ReentrantSetUserDataDuringRemoval
- TimeBase.AddSubInfinities
- LibcppHardeningTest.Assertions
- IDMapTest.RemovedValueHandling
- MultiMemoryConsumerTest.DuplicateInterventionsCheck
- PersistentMemoryAllocatorTest.DelayedAllocationTest
- SequenceCheckerTest.MoveOffSequenceBanned
- ThreadCheckerTest.MoveOffThreadBanned
- TokenType.TokenFromNullUnguessableToken
- ZipTest.CheckForIterationPastTheEnd
- MemoryConsumerTraitsTest.ActiveConsumerWithPassiveTraitsFails
- SingleThreadTaskRunnerMainThreadDefaultHandleTest.Basic
-
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
-
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- local test_libs=(
- "libimmediate_crash_test_helper.so"
- "libmalloc_wrapper.so"
- "libtest_shared_library.so"
- "libtest_trace_processor.so"
- )
- if use test; then
- local test_lib
- for test_lib in "${test_libs[@]}"; do
- rm -f "out/Release/${test_lib}" || die "Failed to remove ${test_lib}"
- done
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/chromium-151.0.7922.169-r1.ebuild b/www-client/chromium/chromium-151.0.7922.169-r1.ebuild
deleted file mode 100644
index 3eaffc873df5e..0000000000000
--- a/www-client/chromium/chromium-151.0.7922.169-r1.ebuild
+++ /dev/null
@@ -1,1864 +0,0 @@
-# Copyright 2009-2026 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# PACKAGING NOTES
-
-# Upstream roll their bundled Clang every two weeks, and the bundled Rust
-# is rolled regularly and depends on that. While we do our best to build
-# with system Clang, we may eventually hit the point where we need to use
-# the bundled Clang due to the use of prerelease features.
-
-# USE=bundled-toolchain is intended for users who want to use the same toolchain
-# as the upstream releases. It's also a good fallback in case we fall behind
-# and need to get a release out quickly (less likely with `dev` in-tree).
-# We can't rely on it as a default since the toolchain is only shipped for x86-64;
-# other architectures will need to use system toolchain.
-
-# Since m133 we are using CI-generated tarballs from
-# https://github.com/chromium-linux-tarballs/chromium-tarballs/
-
-# These are bit-for-bit identical to the official releases, but are built
-# using an external CI system that we have some control over, in case
-# issues pop up again with official tarball generation.
-
-GN_MIN_VER=0.2374
-# chromium-tools/get-chromium-toolchain-strings.py (or just use Chromicler)
-# Node for M145+ should be 24.12.0 but that's not packaged in Gentoo yet. See #969145
-TEST_FONT="9c07d19d9c5ee1ff94f717e6fb17e0c8c354e6f9"
-BUNDLED_CLANG_VER="llvmorg-23-init-19482-g53d18800-1"
-BUNDLED_RUST_VER="b998449636a48e2c4a362809085b600a0174e1f2-2"
-RUST_SHORT_HASH=${BUNDLED_RUST_VER:0:10}-${BUNDLED_RUST_VER##*-}
-NODE_VER="24.12.0"
-GO_MIN_VER="1.25.0"
-ESBUILD_VER="0.25.1"
-ROLLUP_VER="4.57.1" # currently manual.
-VIRTUALX_REQUIRED="pgo"
-
-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"
-
-LLVM_COMPAT=( 21 )
-PYTHON_COMPAT=( python3_{11..14} )
-PYTHON_REQ_USE="xml(+)"
-RUST_MIN_VER=1.91.0
-RUST_NEEDS_LLVM="yes please"
-RUST_OPTIONAL="yes" # Not actually optional, but we don't need system Rust (or LLVM) with USE=bundled-toolchain
-RUST_REQ_USE="rustfmt" # Upstream run rustfmt on bindgen output, so we need it to be available.
-
-inherit check-reqs chromium-2 desktop flag-o-matic llvm-r1 multiprocessing ninja-utils pax-utils
-inherit python-any-r1 readme.gentoo-r1 rust systemd toolchain-funcs virtualx xdg-utils
-
-DESCRIPTION="Open-source version of Google Chrome web browser"
-HOMEPAGE="https://www.chromium.org/"
-PPC64_HASH="7aae8a84e327fc2078ce1625c9c70bfda77d626f"
-PATCH_V="151-3"
-COPIUM_COMMIT="3c7e56fb4523b43b47595bb3a22f77178fc76293"
-SRC_URI="https://github.com/chromium-linux-tarballs/chromium-tarballs/releases/download/${PV}/chromium-${PV}-linux.tar.xz
- https://deps.gentoo.zip/www-client/chromium/rollup-wasm-node-${ROLLUP_VER}.tgz
- https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
- !bundled-toolchain? (
- https://codeberg.org/selfisekai/copium/archive/${COPIUM_COMMIT}.tar.gz
- -> chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- )
- bundled-toolchain? (
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${BUNDLED_CLANG_VER}.tar.xz
- -> chromium-clang-${BUNDLED_CLANG_VER}.tar.xz
- https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/rust-toolchain-${BUNDLED_RUST_VER}-${BUNDLED_CLANG_VER%-*}.tar.xz
- -> chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz
- )
- test? (
- https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> chromium-testfonts-${TEST_FONT:0:10}.tar.gz
- )
- ppc64? (
- https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- )
- pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
-
-# https://gitweb.gentoo.org/proj/chromium-tools.git/tree/get-chromium-licences.py @ 145.0.7632.76
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 Base64 Boost-1.0 CC-BY-3.0 CC-BY-4.0 Clear-BSD FFT2D FTL"
-LICENSE+=" IJG ISC LGPL-2 LGPL-2.1 MIT MPL-1.1 MPL-2.0 Ms-PL PSF-2 SGI-B-2.0 SSLeay SunSoft Unicode-3.0"
-LICENSE+=" Unicode-DFS-2015 Unlicense UoI-NCSA ZLIB libtiff openssl"
-LICENSE+=" rar? ( unRAR )"
-
-SLOT="stable"
-KEYWORDS="amd64 arm64"
-
-IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-zstd"
-IUSE="+X ${IUSE_SYSTEM_LIBS} bindist bundled-toolchain cups debug ffmpeg-chromium gtk4 +hangouts headless kerberos +official pax-kernel pgo"
-IUSE+=" +proprietary-codecs pulseaudio qt6 +rar +screencast selinux test +vaapi +wayland +widevine cpu_flags_ppc_vsx3"
-RESTRICT="
- !bindist? ( bindist )
- !test? ( test )
- arm64? ( test )" # Tests require CFI, which requires LTO, which is broken on arm64 with LLVM 21.
-
-REQUIRED_USE="
- !headless? ( || ( X wayland ) )
- pgo? ( X !wayland )
- screencast? ( wayland )
- ffmpeg-chromium? ( bindist proprietary-codecs )
-"
-
-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:=
-"
-
-# sys-libs/zlib: https://bugs.gentoo.org/930365; -ng is not compatible.
-# We _could_ use the bundled minizip, but that's against policy.
-COMMON_SNAPSHOT_DEPEND="
- system-icu? ( >=dev-libs/icu-73.0:= )
- >=dev-libs/libxml2-2.12.4:=[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-zstd? ( >=app-arch/zstd-1.5.5:= )
- >=media-libs/libwebp-0.4.0:=
- media-libs/mesa:=[gbm(+)]
- >=media-libs/openh264-2.6.0:=
- sys-libs/zlib:=
- !headless? (
- dev-libs/glib:2
- >=media-libs/alsa-lib-1.0.19:=
- media-video/pipewire:=
- pulseaudio? ( media-libs/libpulse:= )
- sys-apps/pciutils:=
- kerberos? ( virtual/krb5 )
- vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
- X? (
- x11-base/xorg-proto:=
- x11-libs/libX11:=
- x11-libs/libxcb:=
- x11-libs/libXext:=
- )
- x11-libs/libxkbcommon:=
- wayland? (
- screencast? ( media-video/pipewire:= )
- dev-libs/libffi:=
- dev-libs/wayland:=
- )
- )
-"
-
-COMMON_DEPEND="
- ${COMMON_SNAPSHOT_DEPEND}
- app-arch/bzip2:=
- dev-libs/expat:=
- net-misc/curl[ssl]
- sys-apps/dbus:=
- media-libs/flac:=
- sys-libs/zlib:=[minizip]
- !headless? (
- >=app-accessibility/at-spi2-core-2.46.0:2
- media-libs/mesa:=[X?,wayland?]
- virtual/udev
- x11-libs/cairo:=
- x11-libs/gdk-pixbuf:2
- x11-libs/pango:=
- cups? ( >=net-print/cups-1.3.11:= )
- qt6? ( dev-qt/qtbase:6[gui,widgets] )
- X? ( ${COMMON_X_DEPEND} )
- )
-"
-RDEPEND="${COMMON_DEPEND}
- !www-client/chromium:0
- >=www-client/chromium-common-2
- !headless? (
- || (
- x11-libs/gtk+:3[X?,wayland?]
- gui-libs/gtk:4[X?,wayland?]
- )
- qt6? ( dev-qt/qtbase:6[X?,wayland?] )
- )
- virtual/ttf-fonts
- selinux? ( sec-policy/selinux-chromium )
- bindist? (
- !ffmpeg-chromium? ( >=media-video/ffmpeg-6.1-r1:0/58.60.60[chromium] )
- ffmpeg-chromium? ( media-video/ffmpeg-chromium:${PV%%\.*} )
- )
-"
-# For M149+ pipewire is a mandatory build-time dependency, but it's optional at runtime for most configurations.
-DEPEND="${COMMON_DEPEND}
- !headless? (
- media-video/pipewire
- 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? (
- qt6? ( dev-qt/qtbase:6 )
- )
- !bundled-toolchain? ( $(llvm_gen_dep '
- llvm-core/clang:${LLVM_SLOT}
- llvm-core/llvm:${LLVM_SLOT}
- llvm-core/lld:${LLVM_SLOT}
- official? (
- !ppc64? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[cfi] )
- ) ')
- ${RUST_DEPEND}
- )
- pgo? (
- >=dev-python/selenium-3.141.0
- >=dev-util/web_page_replay_go-20220314
- )
- >=dev-util/bindgen-0.72.1
- >=dev-build/gn-${GN_MIN_VER}
- >=dev-lang/go-${GO_MIN_VER}
- app-alternatives/ninja
- dev-lang/perl
- >=dev-util/gperf-3.2
- dev-util/esbuild:${ESBUILD_VER}
- dev-vcs/git
- >=net-libs/nodejs-${NODE_VER}[inspector]
- sys-apps/hwdata
- >=sys-devel/bison-2.4.3
- sys-devel/flex
- virtual/pkgconfig
- x11-misc/xdg-utils
-"
-
-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.
-"
-
-python_check_deps() {
- python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
-}
-
-pre_build_checks() {
- # Check build requirements: bugs #471810, #541816, #914220
- # We're going to start doing maths here on the size of an unpacked source tarball,
- # this should make updates easier as chromium continues to balloon in size.
- # xz -l /var/cache/distfiles/chromium-${PV}*.tar.xz
- local base_disk=9 # Round up
- use test && base_disk=$((base_disk + 5))
- local extra_disk=1 # Always include a little extra space
- local memory=4
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2))
- if tc-is-lto || use pgo; then
- memory=$((memory * 2 + 1))
- tc-is-cross-compiler && extra_disk=$((extra_disk * 2)) # Double the requirements
- use pgo && extra_disk=$((extra_disk + 4))
- fi
- if is-flagq '-g?(gdb)?([1-9])'; then
- if use custom-cflags; then
- extra_disk=$((extra_disk + 5))
- fi
- memory=$((memory * 2))
- fi
- local CHECKREQS_MEMORY="${memory}G"
- local CHECKREQS_DISK_BUILD="$((base_disk + extra_disk))G"
- check-reqs_${EBUILD_PHASE_FUNC}
-}
-
-pkg_pretend() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
- fi
-
- if use headless; then
- local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt6" "vaapi" "wayland")
- for myiuse in ${headless_unused_flags[@]}; do
- use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set."
- done
- fi
-
- if ! use bindist && use ffmpeg-chromium; then
- ewarn "Ignoring USE=ffmpeg-chromium, USE=bindist is not set."
- fi
-}
-
-pkg_setup() {
- if [[ ${MERGE_TYPE} != binary ]]; then
- # The pre_build_checks are all about compilation resources, no need to run it for a binpkg
- pre_build_checks
-
- # We haven't massaged any CFLAGS yet, so we want to do this before we force CC/CXX to prevent warnings.
- local want_lto="false"
- tc-is-lto && want_lto="true"
-
- # The linux:unbundle toolchain in GN grabs CC, CXX, CPP (etc) from the environment
- # We'll set these to clang here then use llvm-utils functions to very explicitly set these
- # to a sane value.
- # This is effectively the 'force-clang' path if GCC support is re-added.
- if use !bundled-toolchain; then
- llvm-r1_pkg_setup
- rust_pkg_setup
-
- if tc-ld-is-mold; then
- ewarn "Mold is currently not supported, it will not be used"
- fi
-
- # Forcing clang; respect llvm_slot_x to enable selection of impl via LLVM_COMPAT
- AR=llvm-ar
- CPP="${CHOST}-clang++-${LLVM_SLOT} -E"
- NM=llvm-nm
- CC="${CHOST}-clang-${LLVM_SLOT}"
- CXX="${CHOST}-clang++-${LLVM_SLOT}"
- fi
-
- # LTO in Chromium means LLVM ThinLTO, if GCC support is re-added
- # We'll need to handle that here too.
- use_lto="false"
- local lto_usable="true"
- if [[ "$want_lto" == "true" ]]; then
- if use arm64 && [[ "${LLVM_SLOT}" -lt 22 ]]; then
- einfo "LTO is broken with LLVM 21 on arm64, ignoring CFLAGS."
- lto_usable="false"
- else
- use_lto="true"
- fi
- # We can rely on GN to do this for us; without this builds
- # take significantly longer with LTO enabled.
- filter-lto
- fi
-
- if [[ "$use_lto" == "false" ]] && use official && [[ "$lto_usable" == "true" ]]; then
- einfo "USE=official selected and LTO not detected."
- einfo "It is _highly_ recommended that LTO be enabled for performance reasons"
- einfo "and to be consistent with the upstream \"official\" build optimisations."
- fi
-
- if [[ "$use_lto" == "false" ]] && use test; then
- die "Tests require CFI which requires LTO"
- fi
-
- export use_lto
-
- if tc-is-cross-compiler; then
- use pgo && die "The pgo USE flag cannot be used when cross-compiling"
- CPP="${CBUILD}-clang++-${LLVM_SLOT} -E"
- fi
-
- # I hate doing this but upstream Rust have yet to come up with a better solution for
- # us poor packagers. Required for Split LTO units, which are required for CFI.
- export RUSTC_BOOTSTRAP=1
-
- # Sanity checks for development convenience
- if ver_test $(gn --version || die) -lt ${GN_MIN_VER}; then
- die "dev-build/gn >= ${GN_MIN_VER} is required to build this Chromium"
- fi
-
- # Sometimes, when adding a new LLVM slot, devs (me) forget to install an appropriate lld.
- if tc-ld-is-lld; then
- local lld_ver=$(ld.lld --version | awk '{split($2,a,"."); print a[1]}' || die "Failed to check lld version")
- if [[ ${lld_ver} -lt ${LLVM_SLOT} ]]; then
- die "Your lld version (${lld_ver}) is too old for the selected LLVM slot (${LLVM_SLOT}). Please install a newer lld or select an older LLVM slot."
- fi
- fi
- fi
-
- chromium_suid_sandbox_check_kernel_config
-}
-
-src_unpack() {
- unpack ${P}-linux.tar.xz
- unpack chromium-patches-${PATCH_V}.tar.bz2
- # These should only be required when we're not using the official toolchain
- if use !bundled-toolchain; then
- unpack chromium-patches-copium-${COPIUM_COMMIT:0:10}.tar.gz
- fi
-
- use pgo && unpack chromium-profiler-0.2.tar
-
- if use test; then
- # This just contains a bunch of font files that need to be unpacked (or moved) to the correct location.
- local testfonts_dir="${WORKDIR}/${P}/third_party/test_fonts/test_fonts"
- local testfonts_tar="${DISTDIR}/chromium-testfonts-${TEST_FONT:0:10}.tar.gz"
- einfo "Unpacking test fonts ..."
- tar xf "${testfonts_tar}" -C "${testfonts_dir}" || die "Failed to unpack testfonts"
- fi
-
- # We need to manually unpack this since M126 else we'd unpack one toolchain over the other.
- # Since we're doing that anyway let's unpack to sensible locations to make symlink creation easier.
- if use bundled-toolchain; then
- einfo "Unpacking bundled Clang ..."
- mkdir -p "${WORKDIR}"/clang || die "Failed to create clang directory"
- tar xf "${DISTDIR}/chromium-clang-${BUNDLED_CLANG_VER}.tar.xz" -C "${WORKDIR}/clang" || die "Failed to unpack Clang"
- einfo "Unpacking bundled Rust ..."
- local rust_dir="${WORKDIR}/rust-toolchain"
- mkdir -p "${rust_dir}" || die "Failed to create rust toolchain directory"
- tar xf "${DISTDIR}/chromium-rust-toolchain-${RUST_SHORT_HASH}-${BUNDLED_CLANG_VER%-*}.tar.xz" -C "${rust_dir}" ||
- die "Failed to unpack Rust"
- fi
-
- if use ppc64; then
- unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
- fi
-
- # This is a dirty hack, but we need rollup to build successfully and it's proving to be challenging
- # to build locally due to deps
- unpack rollup-wasm-node-${ROLLUP_VER}.tgz
-}
-
-remove_compiler_builtins() {
- # We can't use the bundled compiler builtins with the system toolchain
- # We used to `grep` then `sed`, but it was indirect. Combining the two into a single
- # `awk` command is more efficient and lets us document the logic more clearly.
-
- local pattern=' configs += [ "//build/config/clang:compiler_builtins" ]'
- local target='build/config/compiler/BUILD.gn'
-
- local tmpfile
- tmpfile=$(mktemp) || die "Failed to create temporary file."
-
- if awk -v pat="${pattern}" '
- BEGIN {
- match_found = 0
- }
-
- # If the delete countdown is active, decrement it and skip to the next line.
- d > 0 { d--; next }
-
- # If the current line matches the pattern...
- $0 == pat {
- match_found = 1 # ...set our flag to true.
- d = 2 # Set delete counter for this line and the next two.
- prev = "" # Clear the buffered previous line so it is not printed.
- next
- }
-
- # For any other line, print the buffered previous line.
- NR > 1 { print prev }
-
- # Buffer the current line to be printed on the next cycle.
- { prev = $0 }
-
- END {
- # Print the last line if it was not part of a deleted block.
- if (d == 0) { print prev }
-
- # If the pattern was never found, exit with a failure code.
- if (match_found == 0) {
- exit 1
- }
- }
- ' "${target}" > "${tmpfile}"; then
- # AWK SUCCEEDED (exit code 0): The pattern was found and edited.
- # This is to avoid gawk's `-i inplace` option which users complain about.
- mv "${tmpfile}" "${target}"
- else
- # AWK FAILED (exit code 1): The pattern was not found.
- rm -f "${tmpfile}"
- die "Awk patch failed: Pattern not found in ${target}."
- fi
-}
-
-src_prepare() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # We'll fill this in as we go. Patches go in chromium-patches.
- local PATCHES=()
-
- PATCHES+=(
- "${WORKDIR}/chromium-patches-${PATCH_V}/common/"
- )
-
- # So many fontconfig magic numbers to cover
- # TODO: once upstream roll to 2.18.2+ set that as our minimum and remove this logic.
- # <=2.17.1 -> 9
- # >2.17.1 && <2.18.2 -> 11
- # >=2.18.2 -> 12
- local fontconfig_cache_magic=9
- if has_version ">=media-libs/fontconfig-2.18.2"; then
- fontconfig_cache_magic=12
- elif has_version ">media-libs/fontconfig-2.17.1"; then
- fontconfig_cache_magic=11
- fi
-
- sed -E -i \
- -e "s#(fb5c91b2895aa445d23aebf7f9e2189c-le64\.cache-)(9|10|11|12)#\1${fontconfig_cache_magic}#g" \
- third_party/test_fonts/fontconfig/BUILD.gn || die "Failed to set fontconfig cache magic in BUILD.gn"
-
- sed -E -i \
- -e "s#(kCacheKey \+ \"/-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- -e "s#(kCacheKey \+ \"-le64\.cache-)(9|10|11|12)(\")#\1${fontconfig_cache_magic}\3#g" \
- third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc || \
- die "Failed to set fontconfig cache magic in generate_fontconfig_caches.cc"
-
- if use bundled-toolchain; then
- # We need to symlink the toolchain into the expected location
- einfo "Symlinking Clang toolchain to expected location ..."
- mkdir -p third_party/llvm-build/ || die "Failed to create llvm-build directory"
- # the 'Chromium Linux Tarballs' seem to already have 'Release+Asserts/{lib,bin}'; not sure if this is an
- # upstream change - we're using the same scripts to build, theoretically. We'll still attempt to create
- # llvm-build, but we'll rm Release+Asserts and symlink directly.
- if [[ -d third_party/llvm-build/Release+Asserts ]]; then
- rm -r third_party/llvm-build/Release+Asserts || die "Failed to remove third_party/llvm-build/Release+Asserts"
- fi
- ln -s "${WORKDIR}"/clang third_party/llvm-build/Release+Asserts || die "Failed to bundle Clang"
- einfo "Symlinking Rust toolchain to expected location ..."
- # As above, so below
- if [[ -d third_party/rust-toolchain ]]; then
- rm -r third_party/rust-toolchain || die "Failed to remove third_party/rust-toolchain"
- fi
- ln -s "${WORKDIR}"/rust-toolchain third_party/rust-toolchain || die "Failed to bundle rust"
- cp "${WORKDIR}"/rust-toolchain/VERSION \
- "${WORKDIR}"/rust-toolchain/INSTALLED_VERSION || die "Failed to set rust version"
- else
- # We don't need our toolchain patches if we're using the official toolchain
-
- # Copium patches go here.
- PATCHES+=(
- "${WORKDIR}/copium/cr143-libsync-__BEGIN_DECLS.patch"
- "${WORKDIR}/copium/cr149-unbundle-minizip-undo-unicode.patch"
- )
-
- # Automate conditional application of chromium-patches
- # The directory structure is expected to be something like:
- # chromium-patches-145/
- # ├── toolchain/
- # │ ├── cr123-foo.patch
- # │ └── cr135-bar.patch
- # ├── llvm/
- # │ ├── cr144-baz.patch
- # │ └── lt-23/
- # │ └── cr145-bleeding-edge-llvm-feature.patch
- # Where `lt-23` means "apply this patch if the LLVM version is less than 23".
- # Only categories in `slot_map` will be checked for version constraints.
- shopt -s nullglob
- local -A slot_map=( [llvm]="${LLVM_SLOT}" [rust]="${RUST_SLOT}" )
-
- for category in "${WORKDIR}/chromium-patches-${PATCH_V}"/*/; do
- local category_name="${category%/}"
- category_name="${category_name##*/}"
-
- # Skip arch-specific categories
- if [[ "${category_name}" == "ppc64le" ]]; then
- use ppc64 || continue
- fi
-
- # We applied common patches above, no need to apply them again here
- [[ "${category_name}" == "common" ]] && continue
-
- # Unconditional patches for this category
- local category_patches=( "${category}"*.patch )
- [[ ${#category_patches[@]} -gt 0 ]] && PATCHES+=( "${category}" )
-
- # Version-constrained subdirectories (e.g., llvm/lt-23/)
- for constraint_dir in "${category}"*/; do
- local dir_name="${constraint_dir%/}"
- dir_name="${dir_name##*/}"
- if [[ "${dir_name}" =~ ^lt-(.*)$ && -v slot_map[${category_name}] ]]; then
- ver_test "${slot_map[${category_name}]}" -lt "${BASH_REMATCH[1]}" &&
- PATCHES+=( "${constraint_dir}" )
- fi
- done
- done
-
- shopt -u nullglob
-
- # Strictly speaking this doesn't need to be gated (no bundled toolchain for ppc64); it keeps the logic together
- if use ppc64; then
- local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches"
- # patch causes build errors on 4K page systems (https://bugs.gentoo.org/show_bug.cgi?id=940304)
- local page_size_patch="ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch"
- local isa_3_patch="ppc64le/core/baseline-isa-3-0.patch"
- # Apply the OpenPOWER patches (check for page size and isa 3.0)
- openpower_patches=( $(grep -E "^ppc64le|^upstream" "${patchset_dir}/series" | grep -v "${page_size_patch}" |
- grep -v "${isa_3_patch}" || die) )
- for patch in "${openpower_patches[@]}"; do
- PATCHES+=( "${patchset_dir}/${patch}" )
- done
- if [[ $(getconf PAGESIZE) == 65536 ]]; then
- PATCHES+=( "${patchset_dir}/${page_size_patch}" )
- fi
- # We use vsx3 as a proxy for 'want isa3.0' (POWER9)
- if use cpu_flags_ppc_vsx3 ; then
- PATCHES+=( "${patchset_dir}/${isa_3_patch}" )
- fi
- fi
-
- remove_compiler_builtins
-
- # We can't rely on the eselect'd Rust to actually include rustfmt, so we'll point to the selected slot specifically.
- local suffix=""
- if [[ "${RUST_TYPE}" == "binary" ]]; then
- suffix="-bin-${RUST_SLOT}"
- else
- suffix="-${RUST_SLOT}"
- fi
- sed -i "s|/bin/rustfmt|/bin/rustfmt${suffix}|g" build/rust/rust_bindgen_generator.gni ||
- die "Failed to update rustfmt path"
-
- fi
-
- # Do this before we apply patches since (e.g.) ppc64 needs to patch rollup and it's easier in ${S}
- einfo "Moving rollup wasm-node package into place ..."
- mkdir -p third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to create node_modules/@rollup/wasm-node"
- mv "${WORKDIR}"/package/* third_party/devtools-frontend/src/node_modules/@rollup/wasm-node ||
- die "Failed to move rollup package"
-
- default
-
- # Sanity check esbuild version before we start removing files.
- # We _could_ patch the version check out - in theory esbuild upstream are being super conservative after
- # arch(AUR) packaged an `esbuild` binary and set ESBUILD_BINARY_PATH=/usr/bin/esbuild, causing much breakage,
- # but this is fine too and exactly matches what upstream are expecting.
- # https://github.com/evanw/esbuild/issues/2894
- local esbuild_js="${S}/third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js"
- local found
- found=$(awk -F'"' '/if \(binaryVersion !==/ {print $2}' "${esbuild_js}")
- if [[ "${found}" != "${ESBUILD_VER}" ]]; then
- die "esbuild version mismatch: expected ${ESBUILD_VER}, found ${found}"
- fi
-
- elog "Removing bundled binaries from source tree ..."
- # Purge bundled ELF files: These are non-portable and will cause issues if used instead of system versions.
- # Use `--wasm` to also remove WebAssembly binaries, if desired - they're portable so shouldn't break builds.
- ${EPYTHON} "${FILESDIR}/bin-finder.py" --elf "${S}" | awk '{print $1}' | xargs rm -f ||
- die "Failed to remove bundled binaries"
-
- # And now we restore any that we actually need, from the host system
- local esbuild_path="${S}/third_party/devtools-frontend/src/third_party/esbuild"
- local -A restore_list=(
- ["/usr/bin/esbuild-${ESBUILD_VER}"]="${esbuild_path}/esbuild"
- ["/usr/bin/gperf"]="${S}/third_party/gperf/cipd/bin/gperf"
- ["/usr/bin/node"]="${S}/third_party/node/linux/node-linux-x64/bin/node"
- )
-
- for src in "${!restore_list[@]}"; do
- dst="${restore_list[${src}]}"
- if [[ -f "${src}" ]]; then
- einfo "Symlinking ${src} ..."
- # Make sure the parent dir exists; some tarballs don't include (e.g.) node's bindir
- mkdir -p "$(dirname "${dst}")" || die "Failed to create directory for ${dst}"
- ln -s "${src}" "${dst}" || die "Failed to symlink ${dst} from ${src}"
- if [[ ! -L "${dst}" || "$(readlink -f "${dst}")" != "${src}" ]]; then
- die "Symlink verification failed for ${dst} -> ${src}"
- fi
- else
- die "Expected to find ${src} to restore ${dst}, but it does not exist."
- fi
- done
-
- # adjust python interpreter version
- sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
-
- # Use the system copy of hwdata's usb.ids
- sed 's|//third_party/usb_ids/src/usb.ids|/usr/share/hwdata/usb.ids|g' \
- -i services/device/public/cpp/usb/BUILD.gn || die "Failed to set system usb.ids path"
-
- # remove_bundled_libraries.py walks the source tree and looks for paths containing the substring 'third_party'
- # whitelist matches use the right-most matching path component, so we need to whitelist from that point down.
- local keeplibs=(
- base/third_party/cityhash
- base/third_party/double_conversion
- base/third_party/icu
- base/third_party/nspr
- base/third_party/superfasthash
- base/third_party/symbolize
- base/third_party/xdg_user_dirs
- buildtools/third_party/libc++
- buildtools/third_party/libc++abi
- net/third_party/mozilla_security_manager
- net/third_party/quic
- net/third_party/uri_template
- third_party/abseil-cpp
- third_party/angle
- third_party/angle/src/common/third_party/xxhash
- third_party/angle/src/third_party/ceval
- third_party/angle/src/third_party/libXNVCtrl
- third_party/angle/src/third_party/volk
- third_party/anonymous_tokens
- third_party/apple_apsl
- third_party/axe-core
- third_party/bidimapper
- third_party/blink
- third_party/boringssl
- third_party/boringssl/src/third_party/fiat
- third_party/breakpad
- third_party/breakpad/breakpad/src/third_party/curl
- third_party/brotli
- 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/third_party/typ
- 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/compiler-rt # Since M137 atomic is required; we could probably unbundle this as a target of opportunity.
- third_party/content_analysis_sdk
- third_party/cpuinfo
- third_party/crabbyavif
- third_party/crashpad
- third_party/crashpad/crashpad/third_party/lss
- third_party/crashpad/crashpad/third_party/zlib
- third_party/crc32c
- third_party/cros_system_api
- third_party/d3
- third_party/dav1d
- third_party/dawn
- third_party/dawn/third_party/gn/webgpu-cts
- third_party/dawn/third_party/OpenGL-Registry
- third_party/dawn/third_party/renderdoc
- third_party/dawn/third_party/webgpu-headers
- 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/csp_evaluator
- 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/json5
- third_party/devtools-frontend/src/front_end/third_party/legacy-javascript
- 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/marked
- third_party/devtools-frontend/src/front_end/third_party/puppeteer
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/mitt
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/parsel-js
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/rxjs
- third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/third_party/urlpattern-polyfill
- third_party/devtools-frontend/src/front_end/third_party/source-map-scopes-codec
- third_party/devtools-frontend/src/front_end/third_party/third-party-web
- 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/front_end/third_party/web-vitals
- third_party/devtools-frontend/src/third_party
- third_party/dom_distiller_js
- third_party/dragonbox
- third_party/eigen3
- third_party/emoji-segmenter
- third_party/farmhash
- third_party/fast_float
- third_party/fdlibm
- third_party/federated_compute/chromium/fcp/confidentialcompute
- third_party/federated_compute/chromium/fcp/protos
- third_party/federated_compute/chromium/fcp/secagg
- third_party/federated_compute/chromium/fcp/client
- third_party/federated_compute/src/fcp/base
- third_party/federated_compute/src/fcp/confidentialcompute
- third_party/federated_compute/src/fcp/protos
- third_party/federated_compute/src/fcp/client
- third_party/federated_compute/src/fcp/secagg
- third_party/federated_compute/third_party/googleapis/src/google
- third_party/federated_compute/third_party/tensorflow-federated
- third_party/federated_compute/third_party/protodatastore-cpp
- third_party/ffmpeg
- third_party/fft2d
- third_party/flatbuffers
- third_party/fp16
- third_party/freetype
- third_party/fusejs
- third_party/fxdiv
- 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/gperf # We symlink system gperf, but this will purge the symlink since we tidy up afterwards.
- third_party/highway
- third_party/hunspell
- third_party/ink/src/ink/brush
- third_party/ink/src/ink/color
- third_party/ink/src/ink/geometry
- third_party/ink/src/ink/rendering
- third_party/ink/src/ink/rendering/skia/common_internal
- third_party/ink/src/ink/rendering/skia/native
- third_party/ink/src/ink/rendering/skia/native/internal
- third_party/ink/src/ink/strokes
- third_party/ink/src/ink/types
- third_party/inspector_protocol
- third_party/ipcz
- third_party/jinja2
- third_party/jsoncpp
- third_party/khronos
- third_party/lens_server_proto
- third_party/leveldatabase
- third_party/libaddressinput
- third_party/libaom
- third_party/libaom/source/libaom/third_party/fastfeat
- third_party/libaom/source/libaom/third_party/vector
- third_party/libaom/source/libaom/third_party/x86inc
- third_party/libc++
- third_party/libdrm
- third_party/libgav1
- third_party/libjingle
- third_party/libpfm4
- third_party/libphonenumber
- third_party/libpng
- third_party/libsecret
- third_party/libsrtp
- third_party/libsync
- third_party/libtess2/libtess2
- third_party/libtess2/src/Include
- third_party/libtess2/src/Source
- third_party/liburlpattern
- third_party/libva_protected_content
- third_party/libvpx
- third_party/libvpx/source/libvpx/third_party/x86inc
- third_party/libwebm
- third_party/libx11
- third_party/libxcb-keysyms
- third_party/libxml/chromium
- third_party/libyuv
- third_party/libzip
- third_party/lit
- third_party/llvm-libc
- third_party/llvm-libc/src/shared/
- third_party/lottie
- third_party/lss
- third_party/lzma_sdk
- third_party/mako
- third_party/markupsafe
- third_party/material_color_utilities
- third_party/metrics_proto
- third_party/minigbm
- third_party/ml_dtypes
- third_party/modp_b64
- third_party/nasm
- third_party/nearby
- third_party/neon_2_sse
- third_party/node
- third_party/oak/chromium/proto
- third_party/oak/chromium/proto/attestation
- third_party/omnibox_proto
- third_party/one_euro_filter
- third_party/openscreen
- third_party/openscreen/src/third_party/
- third_party/openscreen/src/third_party/tinycbor/src/src
- third_party/opus
- third_party/ots
- third_party/pdfium
- third_party/pdfium/third_party/agg23
- third_party/pdfium/third_party/bigint
- third_party/pdfium/third_party/freetype
- third_party/pdfium/third_party/lcms
- third_party/pdfium/third_party/libopenjpeg
- third_party/pdfium/third_party/libtiff
- third_party/perfetto
- third_party/perfetto/protos/third_party/android
- third_party/perfetto/protos/third_party/chromium
- third_party/perfetto/protos/third_party/pprof
- third_party/perfetto/protos/third_party/primes
- third_party/perfetto/protos/third_party/simpleperf
- third_party/pffft
- third_party/ply
- third_party/polymer
- third_party/private_membership
- third_party/private-join-and-compute
- third_party/protobuf
- third_party/protobuf/third_party/utf8_range
- third_party/pthreadpool
- third_party/puffin
- third_party/pyjson5
- third_party/pyyaml
- third_party/rapidhash
- third_party/re2
- third_party/readability
- third_party/rnnoise
- third_party/rust
- third_party/ruy
- third_party/s2cellid
- third_party/search_engines_data
- third_party/securemessage
- third_party/selenium-atoms
- third_party/sentencepiece
- third_party/sentencepiece/src/third_party/darts_clone
- third_party/shell-encryption
- third_party/simdutf
- third_party/simplejson
- third_party/six
- third_party/skia
- third_party/skia/include/third_party/vulkan
- third_party/smhasher
- third_party/snappy
- third_party/spirv-headers
- third_party/spirv-tools
- 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/SPIRV-Headers/include/spirv
- third_party/swiftshader/third_party/SPIRV-Tools
- third_party/swiftshader/third_party/subzero
- third_party/tensorflow_models
- third_party/tensorflow-text
- third_party/tflite
- third_party/tflite/src/third_party/fft2d
- third_party/tflite/src/third_party/xla/third_party/tsl
- third_party/tflite/src/third_party/xla/xla/tsl/framework
- third_party/tflite/src/third_party/xla/xla/tsl/lib/random
- third_party/tflite/src/third_party/xla/xla/tsl/platform
- third_party/tflite/src/third_party/xla/xla/tsl/protobuf
- third_party/tflite/src/third_party/xla/xla/tsl/util
- 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/widevine
- third_party/woff2
- third_party/wuffs
- third_party/x11proto
- third_party/xcbproto
- third_party/xnnpack
- third_party/zlib/google
- third_party/zxcvbn-cpp
- url/third_party/mozilla
- v8/third_party/glibc
- v8/third_party/inspector_protocol
- v8/third_party/rapidhash-v8
- v8/third_party/siphash
- v8/third_party/utf8-decoder
- v8/third_party/v8
- v8/third_party/valgrind
-
- # gyp -> gn leftovers
- third_party/speech-dispatcher
- third_party/usb_ids
- )
-
- if use rar; then
- keeplibs+=( third_party/unrar )
- fi
-
- if use test; then
- keeplibs+=(
- third_party/breakpad/breakpad/src/processor
- third_party/fuzztest
- third_party/google_benchmark/src/include/benchmark
- third_party/google_benchmark/src/src
- third_party/test_fonts
- third_party/test_fonts/fontconfig
- third_party/test_fonts/test_fonts
- )
- fi
-
- # USE=system-*
- if ! use system-harfbuzz; then
- keeplibs+=( third_party/harfbuzz )
- fi
-
- if ! use system-icu; then
- keeplibs+=( third_party/icu )
- fi
-
- if ! use system-zstd; then
- keeplibs+=( third_party/zstd )
- fi
-
- # Arch-specific
- if use arm64 || use ppc64 ; then
- keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
- fi
- # 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
- # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh
- # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh
- # since we're not in a git repo
- sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \
- 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
-
- # Sanity check keeplibs, on major version bumps it is often necessary to update this list
- # and this enables us to hit them all at once.
- # There are some entries that need to be whitelisted (TODO: Why? The file is understandable, the rest seem odd)
- whitelist_libs=(
- net/third_party/quic
- third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
- third_party/libjingle
- third_party/mesa
- third_party/skia/third_party/vulkan
- third_party/vulkan
- )
- local not_found_libs=()
- for lib in "${keeplibs[@]}"; do
- if [[ ! -d "${lib}" ]] && ! has "${lib}" "${whitelist_libs[@]}"; then
- not_found_libs+=( "${lib}" )
- fi
- done
-
- if [[ ${#not_found_libs[@]} -gt 0 ]]; then
- eerror "The following \`keeplibs\` directories were not found in the source tree:"
- for lib in "${not_found_libs[@]}"; do
- eerror " ${lib}"
- done
- die "Please update the ebuild."
- fi
-
- # Remove most bundled libraries. Some are still needed.
- einfo "Unbundling third-party libraries ..."
- build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
-
- # Interferes with our bundled clang path; we don't want stripped binaries anyway.
- sed -i -e 's|${clang_base_path}/bin/llvm-strip|/bin/true|g' \
- -e 's|${clang_base_path}/bin/llvm-objcopy|/bin/true|g' \
- build/linux/strip_binary.gni || die
-}
-
-chromium_configure() {
- # Calling this here supports resumption via FEATURES=keepwork
- python_setup
-
- # 974899: sometimes people try to build with a non-Unicode locale and python gets very upset
- python_export_utf8_locale || die "Chromium builds require a UTF-8 locale."
-
- # Bug 491582.
- export TMPDIR="${WORKDIR}/temp"
- mkdir -p -m 755 "${TMPDIR}" || die
-
- # https://bugs.gentoo.org/654216
- addpredict /dev/dri/ #nowarn
-
- # Use system-provided libraries.
- # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
- # TODO: use_system_hunspell (upstream changes needed).
- # TODO: use_system_protobuf (bug #525560).
- # TODO: use_system_sqlite (http://crbug.com/22208).
-
- # libevent: https://bugs.gentoo.org/593458
- local gn_system_libraries=(
- flac
- fontconfig
- freetype
- # Need harfbuzz_from_pkgconfig target
- #harfbuzz-ng
- libjpeg
- libwebp
- libxml
- libxslt
- openh264
- zlib
- )
-
- if use system-icu; then
- gn_system_libraries+=( icu )
- fi
-
- if use system-zstd; then
- gn_system_libraries+=( zstd )
- fi
-
- build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" ||
- die "Failed to replace GN files for system libraries"
-
- # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file
- # drop the last line, then append the freetype line and a new curly brace to end the block
- local freetype_gni="build/config/freetype/freetype.gni"
- sed -i -e '$d' ${freetype_gni} || die
- echo " enable_freetype = true" >> ${freetype_gni} || die
- echo "}" >> ${freetype_gni} || die
-
- if use !custom-cflags; then
- replace-flags "-Os" "-O2"
- strip-flags
- # Debug info section overflows without component build
- # Prevent linker from running out of address space, bug #471810 .
- filter-flags "-g*"
- # 949123: Several multimedia components explicitly build with specific CFLAGS and
- # use runtime detection to enable optimisations; unfortunately any of our CFLAGS are suffixed
- # to the end of the command line, which causes build failures.
- # Since M150 `skia` will begin breaking for x86_64 due to compilation of `avx512` code paths;
- # we need to filter these for all arches.
- filter-flags "-march*" "-mtune*" "-mcpu*"
-
- fi
-
- # We don't use the same clang version as upstream, and with -Werror
- # we need to make sure that we don't get superfluous warnings.
- append-flags -Wno-unknown-warning-option
- if tc-is-cross-compiler; then # can you cross-compile with the bundled toolchain?
- export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
- export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
- fi
-
- # Start building our GN options
- local myconf_gn=() # Tip: strings must be quoted, bools or numbers are fine
-
- if use !bundled-toolchain; then
- # We already forced the "correct" clang via pkg_setup
-
- if tc-is-cross-compiler; then
- CC="${CC} -target ${CHOST} --sysroot ${ESYSROOT}"
- CXX="${CXX} -target ${CHOST} --sysroot ${ESYSROOT}"
- BUILD_AR=${AR}
- BUILD_CC=${CC}
- BUILD_CXX=${CXX}
- BUILD_NM=${NM}
- fi
-
- # Make sure the build system will use the right tools, bug #340795.
- tc-export AR CC CXX NM
-
- strip-unsupported-flags
- append-ldflags -Wl,--undefined-version # https://bugs.gentoo.org/918897#c32
-
- myconf_gn+=(
- "is_clang=true"
- "clang_use_chrome_plugins=false"
- "use_clang_modules=false" # M141 enables this for the linux platform by default.
- 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
- # From M127 we need to provide a location for libclang and the clang resource dir so that bindgen can find them
- "bindgen_libclang_path=\"$(get_llvm_prefix)/$(get_libdir)\""
- "bindgen_clang_resource_dir=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\""
- "bindgen_extra_clang_args=[\"-I${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include\"]"
- "clang_base_path=\"${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/\""
- "rust_bindgen_root=\"${EPREFIX}/usr/\""
- "rust_sysroot_absolute=\"$(get_rust_prefix)\""
- "rustc_version=\"${RUST_SLOT}\""
- )
-
- # Currently disabled, runtime issues with mold
- #if tc-ld-is-mold; then
- # myconf_gn+=(
- # "use_mold=true"
- # "use_lld=false"
- # "linker_path=\"${EPREFIX}/usr/bin/mold\""
- # )
- #else
- myconf_gn+=( "use_lld=true" )
- #fi
-
- if [[ ${LLVM_SLOT} -lt 23 ]]; then
- # Workaround for -fsanitize-ignore-for-ubsan-feature (added in LLVM 23)
- myconf_gn+=( 'clang_has_ubsan_feature_ignore=false' )
- fi
-
- if ! tc-is-cross-compiler; then
- myconf_gn+=( 'host_toolchain="//build/toolchain/linux/unbundle:default"' )
- else
- tc-export BUILD_{AR,CC,CXX,NM}
- myconf_gn+=(
- 'host_toolchain="//build/toolchain/linux/unbundle:host"'
- 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
- "host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
- "pkg_config=\"$(tc-getPKG_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=
- fi
-
- fi # !bundled-toolchain
-
- local myarch
- myarch="$(tc-arch)"
- case ${myarch} in
- amd64)
- # Bug 530248, 544702, 546984, 853646.
- use !custom-cflags && filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
- -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
- myconf_gn+=( 'target_cpu="x64"' )
- ;;
- arm64)
- myconf_gn+=( 'target_cpu="arm64"' )
- ;;
- ppc64)
- myconf_gn+=( 'target_cpu="ppc64"' )
- ;;
- *)
- die "Failed to determine target arch, got '${myarch}'."
- ;;
- esac
-
- # Common options
-
- myconf_gn+=(
- # Disable code formating of generated files
- "blink_enable_generated_code_formatting=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.
- "dcheck_always_on=$(usex debug true false)"
- "dcheck_is_configurable=$(usex debug true false)"
- # Chromium builds provided by Linux distros should disable the testing config
- "disable_fieldtrial_testing_config=true"
- # Custom patch: Enable building Chromium as individual channels (e.g. stable, beta, dev) that
- # use different profile directories, desktop entries, etc. This enables slotting the ebuild.
- "enable_channel_branding=true"
- # 131 began laying the groundwork for replacing freetype with
- # "Rust-based Fontations set of libraries plus Skia path rendering"
- # We now need to opt-in
- "enable_freetype=true"
- "enable_hangout_services_extension=$(usex hangouts true false)"
- # Don't need nocompile checks and GN crashes with our config (verify with modern GN)
- "enable_nocompile_tests=false"
- # pseudolocales are only used for testing
- "enable_pseudolocales=false"
- "enable_widevine=$(usex widevine true false)"
- # Disable fatal linker warnings, bug 506268.
- "fatal_linker_warnings=false"
- # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
- # Note: these are for Gentoo use ONLY. For your own distribution,
- # please get your own set of keys. Feel free to contact chromium@gentoo.org for more info.
- # note: OAuth2 is patched in; check patchset for details.
- 'google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"'
- # Component build isn't generally intended for use by end users. It's mostly useful
- # for development and debugging.
- "is_component_build=false"
- # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
- "is_debug=false"
- "is_official_build=$(usex official true false)"
- # Enable ozone wayland and/or headless support
- "ozone_auto_platforms=false"
- "ozone_platform_headless=true"
- # Enables building without non-free unRAR licence
- "safe_browsing_use_unrar=$(usex rar true false)"
- "thin_lto_enable_optimizations=${use_lto}"
- "treat_warnings_as_errors=false"
- # Use in-tree libc++ (buildtools/third_party/libc++ and buildtools/third_party/libc++abi)
- # instead of the system C++ library for C++ standard library support.
- # default: true, but let's be explicit (forced since 120 ; USE removed 127).
- "use_custom_libcxx=true"
- # Enable ozone wayland and/or headless support
- "use_ozone=true"
- # The sysroot is the oldest debian image that chromium supports, we don't need it
- "use_sysroot=false"
- # See dependency logic in third_party/BUILD.gn
- "use_system_harfbuzz=$(usex system-harfbuzz true false)"
- "use_thin_lto=${use_lto}"
- # Only enabled for clang, but gcc has endian macros too
- "v8_use_libm_trig_functions=true"
- # use system go
- "tint_use_system_go=true"
- )
-
- if use bindist ; then
- myconf_gn+=(
- # If this is set to false Chromium won't be able to load any proprietary codecs
- # even if provided with an ffmpeg capable of h264/aac decoding
- "proprietary_codecs=true"
- 'ffmpeg_branding="Chrome"'
- # build ffmpeg as an external component (libffmpeg.so) that we can remove / substitute
- "is_component_ffmpeg=true"
- )
- else
- myconf_gn+=(
- "proprietary_codecs=$(usex proprietary-codecs true false)"
- "ffmpeg_branding=\"$(usex proprietary-codecs Chrome Chromium)\""
- )
- fi
-
- if use headless; then
- myconf_gn+=(
- "enable_print_preview=false"
- "enable_remoting=false"
- 'ozone_platform="headless"'
- "rtc_use_pipewire=false"
- "use_alsa=false"
- "use_cups=false"
- "use_gio=false"
- "use_glib=false"
- "use_gtk=false"
- "use_kerberos=false"
- "use_libpci=false"
- "use_pangocairo=false"
- "use_pulseaudio=false"
- "use_qt5=false"
- "use_qt6=false"
- "use_udev=false"
- "use_vaapi=false"
- "use_xkbcommon=false"
- )
- else
- myconf_gn+=(
- "gtk_version=$(usex gtk4 4 3)"
- # link pulseaudio directly (DT_NEEDED) instead of using dlopen.
- # helps with automated detection of ABI mismatches and prevents silent errors.
- "link_pulseaudio=$(usex pulseaudio true false)"
- "ozone_platform_wayland=$(usex wayland true false)"
- "ozone_platform_x11=$(usex X true false)"
- "ozone_platform=\"$(usex wayland wayland x11)\""
- "rtc_use_pipewire=$(usex screencast true false)"
- # As above - link directly instead of dlopening
- "rtc_link_pipewire=$(usex screencast true false)"
- "use_cups=$(usex cups true false)"
- "use_kerberos=$(usex kerberos true false)"
- "use_pulseaudio=$(usex pulseaudio true false)"
- "use_qt5=false"
- "use_system_libffi=$(usex wayland true false)"
- "use_system_minigbm=true"
- "use_vaapi=$(usex vaapi true false)"
- "use_xkbcommon=true"
- )
- if use qt6; then
- local cbuild_libdir
- cbuild_libdir="$(get_libdir)"
- if tc-is-cross-compiler; then
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
- cbuild_libdir="$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt)"
- cbuild_libdir="${cbuild_libdir:2}"
- cbuild_libdir="${cbuild_libdir/% }"
- fi
- myconf_gn+=(
- "use_qt6=true"
- "moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\""
- )
- else
- myconf_gn+=( "use_qt6=false" )
- 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
-
- 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
- if use !ppc64; then
- myconf_gn+=( "is_cfi=${use_lto}" )
- else
- myconf_gn+=( "is_cfi=false" ) # requires llvm-runtimes/compiler-rt-sanitizers[cfi]
- fi
- # Don't add symbols to build
- myconf_gn+=( "symbol_level=0" )
- fi
-
- if use pgo; then
- myconf_gn+=( "chrome_pgo_phase=${1}" )
- if [[ "$1" == "2" ]]; then
- myconf_gn+=( "pgo_data_path=${2}" )
- fi
- else
- myconf_gn+=( "chrome_pgo_phase=0" )
- fi
-
- # Odds and ends
-
- # skipping typecheck is only supported on amd64, bug #876157
- if ! use amd64; then
- myconf_gn+=( "devtools_skip_typecheck=false" )
- fi
-
- # 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 && use ppc64; then
- myconf_gn+=( "v8_enable_external_code_space=false" )
- fi
-
- # Since we build from tarballs, we need to set the channel here so that it can be used in the build.
- export CHROME_VERSION_EXTRA="${SLOT}"
-
- einfo "Configuring Chromium ..."
- # add a `-v` here if gn `hangs` to see which file it's getting stuck on.
- set -- gn gen --args="${myconf_gn[*]}${EXTRA_GN:+ ${EXTRA_GN}}" out/Release
- echo "$@"
- "$@" || die "Failed to configure Chromium"
-}
-
-src_configure() {
- chromium_configure $(usex pgo 1 0)
-}
-
-chromium_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=
-
- # Build mksnapshot and pax-mark it.
- if use pax-kernel; then
- local x
- for x in mksnapshot v8_context_snapshot_generator code_cache_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 chromedriver chrome_sandbox $(use test && echo "base_unittests")
-
- pax-mark m out/Release/chrome
-
- # This codepath does minimal patching, so we're at the mercy of upstream
- # CFLAGS. This is fine - we're not intending to force this on users
- # and we do a lot of flag 'management' anyway.
- if use bundled-toolchain; then
- QA_FLAGS_IGNORED="
- usr/lib64/chromium-browser/chrome
- usr/lib64/chromium-browser/chrome-sandbox
- usr/lib64/chromium-browser/chromedriver
- usr/lib64/chromium-browser/chrome_crashpad_handler
- usr/lib64/chromium-browser/libEGL.so
- usr/lib64/chromium-browser/libGLESv2.so
- usr/lib64/chromium-browser/libVkICD_mock_icd.so
- usr/lib64/chromium-browser/libVkLayer_khronos_validation.so
- usr/lib64/chromium-browser/libqt6_shim.so
- usr/lib64/chromium-browser/libvk_swiftshader.so
- usr/lib64/chromium-browser/libvulkan.so.1
- "
- fi
-}
-
-# This function is called from virtx, and must always return so that Xvfb
-# session isn't left running. If we return 1, virtx will call die().
-chromium_profile() {
- einfo "Profiling for PGO"
-
- pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
-
- # Remove old profdata in case profiling was interrupted.
- rm -rf "${1}" || return 1
-
- if ! "${EPYTHON}" ./chromium_profiler.py \
- --chrome-executable "${S}/out/Release/chrome" \
- --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
- --add-arg no-sandbox --add-arg disable-dev-shm-usage \
- --profile-output "${1}"; then
- eerror "Profiling failed"
- return 1
- fi
-
- popd >/dev/null || return 1
-}
-
-src_compile() {
- if use pgo; then
- local profdata
-
- profdata="${WORKDIR}/chromium.profdata"
-
- if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
- chromium_compile
- virtx chromium_profile "$profdata"
-
- touch "${WORKDIR}/.pgo-profiled" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
- # Remove phase 1 output
- rm -r out/Release || die
-
- chromium_configure 2 "$profdata"
-
- touch "${WORKDIR}/.pgo-phase-2-configured" || die
- fi
-
- if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
- chromium_compile
- touch "${WORKDIR}/.pgo-phase-2-compiled" || die
- fi
- else
- chromium_compile
- fi
-
- mv out/Release/chromedriver{.unstripped,} || die
-
- rm -f out/Release/locales/*.pak.info || die
-
- # Generate support files (desktop file, manpage, etc.) See: #684550 #706786 #968958
- ${EPYTHON} "${FILESDIR}/generate-support-files.py" \
- --installdir "/usr/$(get_libdir)/chromium-browser" \
- --channel "${SLOT}" ||
- die "Failed to generate support files"
-}
-
-src_test() {
- # Tests may be flaky with usersandbox, and the test runner executes significantly faster without.
- # If you seem to be excluding too many tests for a particular milestone: comment them out, reboot, and
- # run the tests again. If that doesn't help, try FEATURES="-usersandbox" and send it because obviously the
- # chromium gods are not smiling upon you today. Do some runtime testing, obvs.
- local skip_tests=(
- # Wildcard exclusions (if all tests in a test suite are broken)
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedAllocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocDeathTest.RepeatedReallocReturnNullDirect/*'
- 'AlternateTestParams/PartitionAllocTest.*' # 200+ tests, >= 1 crashes entire test runner with usersandbox.
- 'CheckExitCodeAfterSignalHandlerDeathTest.*'
- 'CriticalProcessAndThreadSpotChecks/HangWatcherAnyCriticalThreadTests.*'
- 'LazyThreadPoolTaskRunnerEnvironmentTest.*' # M142
- 'ToolsSanityTest.BadVirtualCall*'
- # Since 151.0.7922.137
- 'CheckDeathTest.*'
- 'EnumSetDeathTest.*'
- 'OptionalRefDeathTest.*'
- 'RawRefDeathTest.*'
- 'AlternateTestParams/PartitionAllocDeathTest.CheckTriggered*'
- 'CallbackHelpersTest.*'
- 'SafeRefTest.*'
- 'SpanTest.*'
- 'WeakValueTableTest.*'
- 'PlatformSharedMemoryRegionTest.*'
- 'RefCountedOverflowTest.*'
- 'SingleThreadTaskRunnerCurrentDefaultHandleTest.*'
- 'TestFutureDeathTest.*'
- 'WeakPtrDeathTest.*'
- 'SafeRefDeathTest.*'
- 'LinkedListDeathTest.*'
- 'BindDeathTest.*'
- 'ReallocProtectedIteratorDeathTest.*'
- 'PASpanTest.*'
- 'BackupRefPtrTest.*'
- 'All/Base64Test.Overflow*'
- 'ValuesTest.*'
- 'TaskEnvironmentTest.*'
- 'CheckedObserverListTest.*'
- 'MemoryConsumerRegistryTest.*'
- ProtectedMemoryDeathTest.FailsIfDefinedOutsideOfProtectMemoryRegion
- StructuredSharedMemoryDeathTest.DuplicateRegion
- CheckedContiguousIteratorDeathTest.OutOfBounds
- HeapArrayDeathTest.TakeFirstWithOverSize
- CallbackDeathTest.RunNullCallbackChecks
- ObserverListThreadSafeDeathTest.CrossThreadRemovalRestricted
- SequencedTaskRunnerCurrentDefaultHandleDeathTest.OverrideWithNull
- TestFutureWithoutTaskEnvironmentDeathTest.WaitShouldDcheckWithoutTaskEnvironment
- ScopedThreadPriorityDeathTest.NoRealTime
- ReallocProtectedIteratorDeathTest.StringReallocCrashes
- BarrierCallbackTest.ErrorToCallCallbackWithZeroCallbacks
- BarrierClosureTest.ChecksIfCalledForZeroClosures
- SupportsUserDataTest.ReentrantSetUserDataDuringRemoval
- TimeBase.AddSubInfinities
- LibcppHardeningTest.Assertions
- IDMapTest.RemovedValueHandling
- MultiMemoryConsumerTest.DuplicateInterventionsCheck
- PersistentMemoryAllocatorTest.DelayedAllocationTest
- SequenceCheckerTest.MoveOffSequenceBanned
- ThreadCheckerTest.MoveOffThreadBanned
- TokenType.TokenFromNullUnguessableToken
- ZipTest.CheckForIterationPastTheEnd
- MemoryConsumerTraitsTest.ActiveConsumerWithPassiveTraitsFails
- SingleThreadTaskRunnerMainThreadDefaultHandleTest.Basic
-
- # requires en-us locale
- SysStrings.SysNativeMBAndWide
- SysStrings.SysNativeMBToWide
- SysStrings.SysWideToNativeMB
- # Specific test cases
- CancelableEventTest.BothCancelFailureAndSucceedOccurUnderContention
- FilePathTest.FromUTF8Unsafe_And_AsUTF8Unsafe
- HistogramTesterTest.PumaTestUniqueSample
- ImmediateCrashTest.ExpectedOpcodeSequence # M150
- PathServiceTest.CheckedGetFailure
- PlatformThreadTest.CanChangeThreadType
- RawPtrTest.SetLookupUsesGetForComparison # M146 ; also broken for alpine in M144.
- RustLogIntegrationTest.CheckAllSeverity
- StackCanary.ChangingStackCanaryCrashesOnReturn
- StackTraceDeathTest.StackDumpSignalHandlerIsMallocFree
- TestLauncherTools.TruncateSnippetFocusedMatchesFatalMessagesTest
- ThreadPoolEnvironmentConfig.CanUseBackgroundPriorityForWorker
- DriveInfoTest.GetFileDriveInfo
-
- )
- local test_filter="-$(IFS=:; printf '%s' "${skip_tests[*]}")"
- # test-launcher-bot-mode enables parallelism and plain output
- # Check individual tests with --gtest_filter= --single-process-tests
- ./out/Release/base_unittests --test-launcher-bot-mode \
- --test-launcher-jobs="$(get_makeopts_jobs)" \
- --gtest_filter="${test_filter}" || die "Tests failed!"
-}
-
-src_install() {
- local browser_suffix
- if [[ "${SLOT}" != "stable" ]]; then
- browser_suffix="-${SLOT}"
- else
- browser_suffix=""
- fi
- local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
- exeinto "${CHROMIUM_HOME}"
- doexe out/Release/chrome
-
- newexe out/Release/chrome_sandbox chrome-sandbox
- fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
-
- doexe out/Release/chromedriver
- doexe out/Release/chrome_crashpad_handler
-
- ozone_auto_session () {
- use X && use wayland && ! use headless && echo true || echo false
- }
-
- cat <<- EOF > "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
- #!/bin/bash
- # Wrapper to launch slotted Chromium via the chromium-common launcher script.
- export CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
- export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
- export CHROME_VERSION_EXTRA="${SLOT}"
- export CHROME_WRAPPER="\$(readlink -f "\$0")"
- export OZONE_AUTO_SESSION=$(ozone_auto_session)
-
- exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
- EOF
-
- chmod 755 "${D}${CHROMIUM_HOME}/chromium-launcher.sh" || die
-
- # It is important that we name the target "chromium-browser",
- # xdg-utils expect it; bug #355517.
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${browser_suffix}
- # keep the old symlink around for consistency
- dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${browser_suffix}
-
- dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${browser_suffix}
-
- pushd out/Release/locales > /dev/null || die
- chromium_remove_language_paks
- popd > /dev/null || die
-
- insinto "${CHROMIUM_HOME}"
- doins out/Release/*.bin
- doins out/Release/*.pak
-
- if use bindist; then
- # We built libffmpeg as a component library, but we can't distribute it
- # with proprietary codec support. Remove it and make a symlink to the requested
- # system library.
- rm -f out/Release/libffmpeg.so \
- || die "Failed to remove bundled libffmpeg.so (with proprietary codecs)"
- # symlink the libffmpeg.so from either ffmpeg-chromium or ffmpeg[chromium].
- einfo "Creating symlink to libffmpeg.so from $(usex ffmpeg-chromium ffmpeg-chromium ffmpeg[chromium])..."
- dosym ../chromium/libffmpeg.so$(usex ffmpeg-chromium .${PV%%\.*} "") \
- /usr/$(get_libdir)/chromium-browser/libffmpeg.so
- fi
-
- local test_libs=(
- "libimmediate_crash_test_helper.so"
- "libmalloc_wrapper.so"
- "libtest_shared_library.so"
- "libtest_trace_processor.so"
- )
- if use test; then
- local test_lib
- for test_lib in "${test_libs[@]}"; do
- rm -f "out/Release/${test_lib}" || die "Failed to remove ${test_lib}"
- done
- fi
-
- (
- shopt -s nullglob
- local files=(out/Release/*.so out/Release/*.so.[0-9])
- [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
- )
-
- 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
-
- # 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${browser_suffix}.png
- done
-
- # Install desktop entry
- domenu out/Release/chromium-browser${browser_suffix}.desktop
-
- # Install GNOME default application entry (bug #303100).
- insinto /usr/share/gnome-control-center/default-apps
- doins out/Release/chromium-browser${browser_suffix}.xml
-
- # Install AppStream metadata
- insinto /usr/share/appdata
- doins out/Release/chromium-browser${browser_suffix}.appdata.xml
-
- # Install manpage; bug #684550
- doman out/Release/chromium-browser${browser_suffix}.1
- dosym chromium-browser${browser_suffix}.1 /usr/share/man/man1/chromium${browser_suffix}.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 && [[ -z "${REPLACING_VERSIONS}" ]]; then
- if use vaapi; then
- elog "Hardware-accelerated video decoding configuration:"
- elog
- elog "Chromium supports multiple backends for hardware acceleration. To enable one,"
- elog " Add to CHROMIUM_FLAGS in /etc/chromium/default:"
- elog
- elog "1. VA-API with OpenGL (recommended for most users):"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL"
- elog " VaapiVideoDecoder may need to be added as well, but try without first."
- elog
- if use wayland; then
- elog "2. Enhanced Wayland/EGL performance:"
- elog " --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
- elog
- fi
- if use X; then
- elog "$(usex wayland "3" "2"). VA-API with Vulkan:"
- elog " --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
- elog
- if use wayland; then
- elog " NOTE: Vulkan acceleration requires X11 and will not work under Wayland sessions."
- elog " Use OpenGL-based acceleration instead when running under Wayland."
- elog
- fi
- fi
- elog "Additional options:"
- elog " To enable hardware-accelerated encoding (if supported)"
- elog " add 'AcceleratedVideoEncoder' to your feature list"
- elog " VaapiIgnoreDriverChecks bypasses driver compatibility checks"
- elog " (may be needed for newer/unsupported hardware)"
- elog
- else
- elog "This Chromium build was compiled without VA-API support, which provides"
- elog "hardware-accelerated video decoding."
- 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 "behavior you need to pass --gtk-version=4, e.g. by adding it"
- elog "to CHROMIUM_FLAGS in /etc/chromium/default."
- fi
- fi
-
- if systemd_is_booted && ! [[ -f "/etc/machine-id" ]]; then
- ewarn "The lack of an '/etc/machine-id' file on this system booted with systemd"
- ewarn "indicates that the Gentoo handbook was not followed to completion."
- ewarn ""
- ewarn "Chromium is known to behave unpredictably with this system configuration;"
- ewarn "please complete the configuration of this system before logging any bugs."
- fi
-
- # Stable slot doesn't change profile directory, and it's vanishingly unlikely that users will downgrade from dev.
- if [[ -n "${REPLACING_VERSIONS}" ]]; then
- local replacing_non_slotted=false
- # there could be more than one PVR
- for version in ${REPLACING_VERSIONS}; do
- if ver_test "${version}" -le "145.0.7632.116"; then
- replacing_non_slotted=true
- break
- fi
- done
- if ${replacing_non_slotted}; then
- ewarn "This version of Chromium has replaced a non-slotted ebuild."
- if [[ ${SLOT} != "stable" ]]; then
- ewarn "This channel has its own profile directory, so your existing profile will not be used."
- ewarn "To use your existing profile, either copy or move it to the new location."
- ewarn "See https://wiki.gentoo.org/wiki/Chromium#Profile_Directories for more information."
- ewarn ""
- fi
- ewarn "Any existing Progressive Web Apps (PWAs) will need to be reinstalled,"
- ewarn "or have the path in the desktop files updated to point to the new wrapper script."
- fi
- fi
-}
diff --git a/www-client/chromium/files/bin-finder.py b/www-client/chromium/files/bin-finder.py
deleted file mode 100644
index 4b506156252e7..0000000000000
--- a/www-client/chromium/files/bin-finder.py
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/usr/bin/env python3
-# A simple script to find ELF and WebAssembly executables in a directory tree.
-# Spdx-License-Identifier: GPL-2.0-or-later
-import os
-import struct
-import argparse
-
-# Magic numbers
-ELF_MAGIC = b"\x7fELF"
-WASM_MAGIC = b"\x00asm"
-
-# Machine ID Mapping for things in Chromium
-ELF_MACHINE_MAP = {
- 0x02: "SPARC",
- 0x03: "x86",
- 0x08: "MIPS",
- 0x12: "SPARC",
- 0x14: "PowerPC",
- 0x15: "PowerPC64",
- 0x28: "ARM",
- 0x2B: "SPARC V9",
- 0x34: "SuperH",
- 0x3E: "x86_64",
- 0xB7: "AArch64",
- 0xA4: "Hexagon",
- 0xF3: "RISC-V",
-}
-
-# Extensions that are guaranteed non-ELF/non-WASM.
-# Derived from `tar tvf chromium-*.tar.xz` (all exts with ≥80 occurrences,
-# minus .bin/.out/.node/.a which can legitimately be ELF).
-# fmt: off
-_SKIP_EXTENSIONS = frozenset({
- # C / C++ / Objective-C
- '.c', '.cc', '.cpp', '.cxx', '.h', '.hh', '.hpp', '.hxx',
- '.inc', '.inl', '.m', '.mm', '.tq',
- # Assembly
- '.S', '.asm', '.s',
- # Compiled languages
- '.cs', '.dart', '.go', '.java', '.kt', '.rs', '.swift',
- # Scripting & interpreted languages
- '.bat', '.cjs', '.coffee', '.cts', '.js', '.mjs', '.mts',
- '.php', '.pl', '.py', '.pyi', '.rb', '.sh', '.ts',
- # Web & markup
- '.css', '.htm', '.html', '.scss', '.template', '.tmpl',
- '.tpl', '.ui', '.xml', '.xsd', '.xsl',
- # Shader & GPU languages
- '.comp', '.frag', '.glsl', '.hlsl', '.metal', '.rts',
- '.sksl', '.tesc', '.tese', '.vert', '.vk', '.wgsl',
- # Protocol / schema / interface definitions
- '.fbs', '.idl', '.mojom', '.pbtxt', '.pdl', '.proto',
- '.test-mojom', '.textpb', '.textproto',
- # Compiler IR & intermediate formats
- '.bc', '.dxbc', '.ll', '.mlir', '.spv', '.spvasm', '.td',
- # Build systems & project files
- '.BUILD', '.am', '.bazel', '.build', '.bzl', '.cmake',
- '.gn', '.gni', '.grd', '.grdp', '.gyp', '.gypi', '.in',
- '.lock', '.mak', '.mk', '.star',
- # Configuration & data serialisation
- '.cfg', '.conf', '.hjson', '.json', '.json5', '.toml',
- '.yaml', '.yml',
- # Documentation & text
- '.dox', '.man', '.md', '.mdoc', '.po', '.rst', '.txt',
- # Hashes & signatures
- '.sha1', '.sha256',
- # Cryptographic material
- '.crl', '.crt', '.der', '.key', '.pem',
- # Test & comparison data
- '.chromium', '.errors', '.expected', '.golden',
- '.mock-http-headers', '.output', '.ref', '.snap',
- '.stderr', '.test',
- # VCS & tooling config
- '.clang-format', '.eslintrc', '.gitattributes', '.gitignore',
- '.nycrc', '.pydeps', '.yapf',
- # Translation & locale
- '.ucm', '.xtb',
- # Images
- '.avif', '.bmp', '.gif', '.ico', '.icon', '.jpeg', '.jpg',
- '.pdf', '.png', '.svg', '.tiff', '.webp',
- # Audio & video
- '.flac', '.mkv', '.mp3', '.mp4', '.ogg', '.opus', '.wav',
- '.webm',
- # Fonts
- '.otf', '.ttf', '.woff', '.woff2',
- # Archives
- '.7z', '.bz2', '.gz', '.tar', '.xz', '.zip', '.zst',
- # Source maps
- '.map',
- # Chromium-specific data
- '.ctb', '.filter', '.hlo', '.onc', '.orth', '.plist',
- '.skrp', '.utb',
- # Miscellaneous non-executable data
- '.csv', '.dat', '.data', '.def', '.dict', '.diff', '.info',
- '.log', '.m4', '.orig', '.pac', '.patch', '.pb', '.rc',
- '.sql', '.t', '.tflite',
-})
-# fmt: on
-
-# Minimum file size for a valid ELF header (20 bytes needed for parsing)
-_MIN_FILE_SIZE = 20
-
-
-def get_elf_info(fd):
- """Parses ELF header using the file's own endianness."""
- os.lseek(fd, 0, os.SEEK_SET)
- header = os.read(fd, 20)
-
- if len(header) < 20:
- return None
-
- # Offset 4: 1=32-bit, 2=64-bit
- bit_mode = "32-bit" if header[4] == 1 else "64-bit"
-
- # Offset 5: 1=LSB (Little Endian), 2=MSB (Big Endian)
- endian_byte = header[5]
- endian = "<" if endian_byte == 1 else ">"
- endian_name = "LSB" if endian_byte == 1 else "MSB"
-
- # Machine ID is 2 bytes at offset 18
- machine_id = struct.unpack(f"{endian}H", header[18:20])[0]
-
- # Object Type is 2 bytes at offset 16
- obj_type_id = struct.unpack(f"{endian}H", header[16:18])[0]
- obj_types = {1: "relocatable", 2: "executable", 3: "shared object", 4: "core"}
- obj_type = obj_types.get(obj_type_id, "unknown type")
-
- arch = ELF_MACHINE_MAP.get(machine_id, f"Unknown (0x{machine_id:x})")
- return f"ELF {bit_mode} {endian_name} {arch} ({obj_type})"
-
-
-def scan_path(root_path, show_elf, show_wasm):
- try:
- with os.scandir(root_path) as it:
- for entry in it:
- if entry.is_dir(follow_symlinks=False):
- scan_path(entry.path, show_elf, show_wasm)
- elif entry.is_file(follow_symlinks=False):
- # Skip files with known non-ELF/WASM extensions
- ext = os.path.splitext(entry.name)[1].lower()
- if ext in _SKIP_EXTENSIONS:
- continue
-
- # Skip files too small for a valid ELF header
- try:
- if entry.stat(follow_symlinks=False).st_size < _MIN_FILE_SIZE:
- continue
- except OSError:
- continue
-
- fd = None
- try:
- fd = os.open(entry.path, os.O_RDONLY | os.O_NOFOLLOW)
-
- magic = os.read(fd, 4)
-
- if magic == ELF_MAGIC and show_elf:
- info = get_elf_info(fd)
- if info:
- print(f"{entry.path} -> {info}")
-
- elif magic == WASM_MAGIC and show_wasm:
- print(f"{entry.path} -> WebAssembly binary")
-
- # Performance: Drop from page cache
- os.posix_fadvise(fd, 0, 0, os.POSIX_FADV_DONTNEED)
- except (PermissionError, OSError):
- continue
- finally:
- if fd is not None:
- os.close(fd)
- except (PermissionError, OSError):
- pass
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(description="Fast Linux binary sniffer")
- parser.add_argument("directory", help="Directory to scan")
- parser.add_argument("--elf", action="store_true", help="Only show ELF files")
- parser.add_argument("--wasm", action="store_true", help="Only show WASM files")
-
- args = parser.parse_args()
-
- # If neither is specified, default to showing both
- show_elf = args.elf or (not args.elf and not args.wasm)
- show_wasm = args.wasm or (not args.elf and not args.wasm)
-
- scan_path(args.directory, show_elf, show_wasm)
diff --git a/www-client/chromium/files/chromium-142-work-with-old-fontconfig.patch b/www-client/chromium/files/chromium-142-work-with-old-fontconfig.patch
deleted file mode 100644
index f8c2e403ea392..0000000000000
--- a/www-client/chromium/files/chromium-142-work-with-old-fontconfig.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0103e0e07f3cfd1a1e426b63354881cc547022e1 Mon Sep 17 00:00:00 2001
-From: Matt Jolly
-Date: Sat, 20 Sep 2025 11:47:38 +1000
-Subject: [PATCH] build with actually released fontconfig
-
-https://chromium.googlesource.com/chromium/src/+/9af749d9dfb0f4a5aaa0463bcad126973e3d5363
-
-rolls Chromium's fontconfig to include
-
-https://chromium.googlesource.com/external/fontconfig.git/+/59da606145558a0041eb90d9c80a26a6f0c1d348%5E%21/
-
-which _is_ available upstream, but is not in _any_ fontconfig release;
-this change updates the fontconfig cache magic number from `9` to `10`.
-
-As a result, any Chromium build using an unbundled fontconfig (like, say,
-every Linux distro...) will fail if building test targets, despite fontconfig
-being one of the few libraries supported by
-`build/linux/unbundle/replace_gn_files.py`.
-
-Further changes to work around regressions in fontations also configure bundled
-fontconfig to suffix `-reindex1` to the cache path which, as per the above, also
-breaks builds using system fontconfig.
-
-https://github.com/chromium/chromium/commit/bbf7b467a342847e94eadf02777ab70073807fa7
-
-And further changes in M142 have bumped the cache version to `11`. Hopefully this stabilises
-soon and fontconfig gets a release.
-
-This patch reverts enough of these changes to allow Chromium to build with
-unbundled (and actually released) fontconfig versions again.
-
-See-also: https://issues.chromium.org/issues/442698344
-Signed-off-by: Matt Jolly
---- a/third_party/test_fonts/fontconfig/BUILD.gn
-+++ b/third_party/test_fonts/fontconfig/BUILD.gn
-@@ -49,7 +49,7 @@ if (is_linux || is_chromeos) {
- args = []
- inputs = [ "$root_out_dir/etc/fonts/fonts.conf" ]
- outputs = [
-- "$root_out_dir/fontconfig_caches/fb5c91b2895aa445d23aebf7f9e2189c-le64.cache-11",
-+ "$root_out_dir/fontconfig_caches/fb5c91b2895aa445d23aebf7f9e2189c-le64.cache-9",
- "$root_out_dir/fontconfig_caches/CACHEDIR.TAG",
- ]
- }
---- a/third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
-+++ b/third_party/test_fonts/fontconfig/generate_fontconfig_caches.cc
-@@ -56,7 +56,7 @@ int main() {
- FcFini();
-
- // Check existence of intended fontconfig cache file.
-- auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-11";
-+ auto cache = fontconfig_caches + "/" + kCacheKey + "-le64.cache-9";
- bool cache_exists = access(cache.c_str(), F_OK) == 0;
- return !cache_exists;
- }
---
-2.50.1
diff --git a/www-client/chromium/files/generate-support-files.py b/www-client/chromium/files/generate-support-files.py
deleted file mode 100644
index 0f9d5825e548f..0000000000000
--- a/www-client/chromium/files/generate-support-files.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python3
-# Spdx-License-Identifier: GPL-2.0-or-later
-# A wrapper script to generate support files, see #684550 #706786 #968958
-# Use upstream's python installer script to generate support files
-# This replaces fragile sed commands and handles @@include@@ directives.
-# It'll also verify that all substitution markers have been resolved, meaning that
-# future changes to templates that add new variables will be caught during the build.
-import sys
-import argparse
-from pathlib import Path
-
-# Add upstream installer script to search path
-sys.path.insert(0, str(Path.cwd() / "chrome/installer/linux/common"))
-import installer
-
-
-def main():
- parser = argparse.ArgumentParser()
- parser.add_argument(
- "-i",
- "--installdir",
- required=True,
- help="Installation directory (e.g. /usr/lib/chromium-browser)",
- )
- parser.add_argument(
- "-c",
- "--channel",
- default="stable",
- choices=["stable", "beta", "unstable", "dev", "canary"],
- help="Channel to build for (default: stable)",
- )
- args = parser.parse_args()
-
- # Normalise channel name (upstream uses 'unstable' for dev)
- channel = args.channel
- if channel == "dev":
- channel = "unstable"
-
- # Define suffixes based on channel
- channel_suffix = ""
- menu_suffix = ""
-
- if channel != "stable":
- channel_suffix = f"-{channel}"
- menu_suffix = f" ({channel})"
-
- # Configure contexts strictly for file generation
- # Common variables used across templates
- context = {
- "BUGTRACKERURL": "https://bugs.gentoo.org/enter_bug.cgi?product=Gentoo Linux&component=Current packages",
- "DEVELOPER_NAME": "The Chromium Authors",
- "EXTRA_DESKTOP_ENTRIES": "",
- "FULLDESC": "An open-source browser project that aims to build a safer, faster, and more stable way to experience the web.",
- "HELPURL": "https://wiki.gentoo.org/wiki/Chromium",
- "INSTALLDIR": args.installdir, # Note: We've patched the installer scripts to automatically append the channel suffix, but we'll use the arg since we bypass all that.
- "MAINTMAIL": "chromium@gentoo.org", # Must be a bare email address for appstream metadata
- "MENUNAME": f"Chromium{menu_suffix}",
- "PACKAGE": f"chromium-browser{channel_suffix}",
- "PRODUCTURL": "https://www.chromium.org/",
- "PROGNAME": "chrome",
- "PROJECT_LICENSE": "BSD, LGPL-2, LGPL-2.1, MPL-1.1, MPL-2.0, Apache-2.0, and others",
- "SHORTDESC": "Open-source foundation of many web browsers including Google Chrome",
- "STARTUP_WM_CLASS": f"chromium-browser{channel_suffix}",
- # Use a distinct scheme handler for slotted installs to avoid conflicts
- "URI_SCHEME": f"x-scheme-handler/chromium{channel_suffix}",
- "USR_BIN_SYMLINK_NAME": f"chromium-browser{channel_suffix}",
- }
-
- # upstream is currently (M145) converting from upper to lower case
- # we need to support both until we drop old versions _and_ the conversion is complete.
- for key in list(context):
- context[key.lower()] = context[key]
-
- # Generate Desktop file
- installer.process_template(
- Path("chrome/installer/linux/common/desktop.template"),
- Path(f"out/Release/chromium-browser{channel_suffix}.desktop"),
- context,
- )
-
- # Generate Manpage
- installer.process_template(
- Path("chrome/app/resources/manpage.1.in"),
- Path(f"out/Release/chromium-browser{channel_suffix}.1"),
- context,
- )
-
- # Generate AppData (AppStream)
- installer.process_template(
- Path("chrome/installer/linux/common/appdata.xml.template"),
- Path(f"out/Release/chromium-browser{channel_suffix}.appdata.xml"),
- context,
- )
-
- # Generate GNOME Default Apps entry
- installer.process_template(
- Path("chrome/installer/linux/common/default-app.template"),
- Path(f"out/Release/chromium-browser{channel_suffix}.xml"),
- context,
- )
-
-
-if __name__ == "__main__":
- main()
diff --git a/www-client/chromium/metadata.xml b/www-client/chromium/metadata.xml
deleted file mode 100644
index 8665b904a10fe..0000000000000
--- a/www-client/chromium/metadata.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
- kangie@gentoo.org
- Matt Jolly
-
-
- emi@genchu.org
- Emi
-
-
- chromium@gentoo.org
- Chromium in Gentoo Project
-
-
-
- chromium/chromium
- Matt.Jolly/chromium-patches
-
-
diff --git a/www-client/google-chrome-beta/Manifest b/www-client/google-chrome-beta/Manifest
index 93c3d77513b80..f542e5da3ebe7 100644
--- a/www-client/google-chrome-beta/Manifest
+++ b/www-client/google-chrome-beta/Manifest
@@ -1,6 +1,6 @@
-DIST google-chrome-beta_156.0.8078.4-1_amd64.deb 144860768 BLAKE2B 8d1802e9fcefb1be2d946ddc74430dabe490b49041291dc3bd907ec62ff506b627662388fa038f33a2001a7b11afb27d23581725fb685403569a1bd7915f28f1 SHA512 4f43eed048a4a648a42f9d28a7ab9e7db8a911be7066e13b0811ea941886abc1421390d5d66cfefbe915e373e67f979395679343ebaaef7b19dde84215ef87cd
-DIST google-chrome-beta_156.0.8078.4-1_arm64.deb 136586204 BLAKE2B 66e88833ebad934229dab42af8e9d078643aea0382e438ba458f6f3251ff6eec464a87ff507cfd5dccfedbd1372b02c38809fe51cc788241bb0289eb5dd3c3f7 SHA512 1dede01b45ff8f6bac8c7fd4db06866edfe93407859297d2e8f9557356e6845d8841a5b24e013153479d903be932bbb6e7ece9a8ad6e48ace3882037ef8f23f9
DIST google-chrome-beta_157.0.8103.6-1_amd64.deb 146776016 BLAKE2B c6be5502b766db1ed629c5ebcc4d478c4d7b8bedb73492aa1702faa174d09f510a26ba1750ac2355ff65369432bd0f9020c2e4c29929c9c9340c749ea1b37b33 SHA512 6ddb804e2ad4b7c9adaf64e025014d46c0ad07866915849340c860356a8ede2374f051575f8b7916e5657f47306c7f7e84711238fbd5e0bddc5cc70ec3f8987b
DIST google-chrome-beta_157.0.8103.6-1_arm64.deb 138959112 BLAKE2B e6d22f7b426eafd34ac1277f4d2a7f2ecd6fe79f8fba7677e537964a3362761440ed8da38a6f3fe127eb85b5f1f9a8913dd75e2e2004092f14d24f94cec54195 SHA512 fb875947090416f98b0501dd418694094e61f1cfbf735a5a0f6a47b33069a7c4a740359abb7c4be8638e8f0f6caf8852733e27794f82ba63053e7f24b7cc0a6b
+DIST google-chrome-beta_158.0.8127.18-1_amd64.deb 152667100 BLAKE2B 630bfedca5b194b4f94cfd3856e4cfe3a9ccb4c22a50261e6ceea47520e0f80560afbdf9909079050dda8a788131a73140cdfb41d644b4100ad7f4622546aa33 SHA512 8a4a711ef38b35079d0e89a558cbc9cf74a13077c7f4b947587a1631e960a20c44b8250cc1c1033cfa074fa1838ae0a6a18b0d5197479a410a938dd1490171d3
+DIST google-chrome-beta_158.0.8127.18-1_arm64.deb 141821012 BLAKE2B 84e0ceb338c56f94c06c330f23860afa1a5189832202f178d17db211c03cf45c9f60ef8c9c83fa493ed65f0e47fde707a46df69340b8df93f1d184015fc1c6a9 SHA512 a294a9c81231a3741291cc3f073fee3d253d6c6542a3d6976cb4437d84a397f4d671117d4658cff2ec46c3429ec7279d360493b5b973de8cd2b0d5762ae26d9c
DIST google-chrome-beta_158.0.8127.2-1_amd64.deb 151811532 BLAKE2B 77c1c6f8a152f8b26133fe46a334787a05255e7c465c04ece3a17572be40101ac9ca2afba634d3b144948f4a817d62312c0085f115be728b9c806d2eaaae3462 SHA512 2e460c53e452d8dcae1dd229c6ad282314d3dc70637c137f2987c5401784906dbbcecc84451e1a47fbd6aeb77cdd5ed83aeb5f7752c39dab0b3b4117771c1b8d
DIST google-chrome-beta_158.0.8127.2-1_arm64.deb 141797012 BLAKE2B 8930412df9e095338a2354a5ab2ce228c7d2c10f738c71590efdc7eaf7c18a186f272a5d5781c0e6e92899cfafa69e2b20300e9df1abf6654317f42321e96a50 SHA512 f1c4ea37aa59d3bf9e283300142979137ad2e0a4a3aa145d072117758212a1298f12e6324d4ea6ef6d85310042d1ecaf52e16eb07d1a79cb7baf98daa4a4d91c
diff --git a/www-client/google-chrome-beta/google-chrome-beta-156.0.8078.4.ebuild b/www-client/google-chrome-beta/google-chrome-beta-158.0.8127.18.ebuild
similarity index 100%
rename from www-client/google-chrome-beta/google-chrome-beta-156.0.8078.4.ebuild
rename to www-client/google-chrome-beta/google-chrome-beta-158.0.8127.18.ebuild
diff --git a/www-client/google-chrome/Manifest b/www-client/google-chrome/Manifest
index 1a6172814467a..86903fad939bf 100644
--- a/www-client/google-chrome/Manifest
+++ b/www-client/google-chrome/Manifest
@@ -1,6 +1,6 @@
-DIST google-chrome-stable_154.0.8037.92-1_amd64.deb 142883344 BLAKE2B de3f3f7272319f62aa12d034e8feac4b3dd0ed7b7b1a76e113d78c1908b25c90a33f19d9b3018f2c4da155c9575624c8c9457387a176cd8ea33092a04f6eb081 SHA512 528f474f27254d188c9bc837b863f559d37ff1037b16053387075c0d0d3314c5506312112fa19c36c9d2c321fb83b8b38f77a6703ab1920a8e1d751c9c900101
-DIST google-chrome-stable_154.0.8037.92-1_arm64.deb 134430076 BLAKE2B 8397b0855b070db490852d2cc27535c38d9820d272c681b6dafc5338ac394e8496711c7e3470ffee819255f72a8badad84c054bb5adc6f45d3dcab875ef240e4 SHA512 2f5fc99557158172f001bbef10c031be6be7f25564bb7655289956d05468f89c42972608987de47ccd3e2ec1d4db6ed1f5ac6f734a914150252de46c202d3b6a
DIST google-chrome-stable_156.0.8078.47-1_amd64.deb 144849192 BLAKE2B a401589aef8cbccc1a2f7adce44a83ca44338d95e241bf384ef2654e4a7456cb77169fd28c835cce1e3e8b8e30379cb692bf7d84aa2c3707d9ebcbb51e6df861 SHA512 ffd886eb17c3993aef9fe440a2ab56c7b82b95555c693eb81efe09eeb3cf308434a69293bec36b7e363f55d453925c1b2763c989b66d847df67e714ef237b3fc
DIST google-chrome-stable_156.0.8078.47-1_arm64.deb 136588320 BLAKE2B df690a06124bc7cd5bf80543d14e3ec83aa2496d8d037c492b7fcddd10193005c2e2eff005629e1a107175b5dbc44a3273d3416018b156899d72cc03a7d2acf4 SHA512 732099a8779c4389f7eb3605b2c624a3e659d3a0eeee8d225e80d48813d53468fdd8d5048f670b4d69eecb64e96c573f712f8eabd6d9e28386d4fa0ce0820486
DIST google-chrome-stable_156.0.8078.79-1_amd64.deb 145633696 BLAKE2B bda5895101716ca07952d87a05514c0561f96024cbc8542464c360508a152c855542d7077927173c66e14065d64f6c2aa26e047c7317e818d545ce4e6eec8a94 SHA512 68ea17afbc84d788ed9e1b6c2c16e979a5e5773b1ae6b6b30e4485d0c39547d7f3a74f028bc5e134cc1412c8534cfdf31b4f85e9f3016fc8b70430d768324315
DIST google-chrome-stable_156.0.8078.79-1_arm64.deb 137373656 BLAKE2B 34f75eb13a20ab24f7d9872109349f26e0804508bec3cfa2af26db7a338e50571ba5eb8625849c308d944f7cce84ba61809d65da0ebc3488b362db7343ec1e87 SHA512 6510cdee61b3ee83c352c460ceb47fedc4caae638dbb380c523d57ea396e02174ffa5073f1932f4108f8416b62482c4759f993e8ccddf3a268737729b8c00d16
+DIST google-chrome-stable_157.0.8103.38-1_amd64.deb 147633324 BLAKE2B f13c8bdb2eee5aa1902c70a3d46dfa0e532570f31188e0e9b8fc4601a87fd2efa72ba4570bb7939c794ca38034ffc8d81e646cc0be91b5c67d5dd6dbe8979a87 SHA512 92a77ba2ef2fce868ecfef0e288e4ef6f6c7b390cb249eb592287a3ce42d21fc36181f4dd234ff072cfa927abcb24cfd9dfa3bdb736d1dcf23eae6adaf91e706
+DIST google-chrome-stable_157.0.8103.38-1_arm64.deb 139364644 BLAKE2B dcb40d324317d8f45c66a11ab8e20718aa6237281ee08e667762bab80e1ef8410346cef83ffc41ff31150ef05faffb100096785657a5c3d63ea1d6efb8199acc SHA512 09d20ed5c76fe9f7b5a3d085bf1e3f78772ab376764e4318c9b497ce4a2c47b0b901b7daf0107dc2c4955869e21e9390e394ed43a9558d2358845a33cae67222
diff --git a/www-client/google-chrome/google-chrome-154.0.8037.92.ebuild b/www-client/google-chrome/google-chrome-157.0.8103.38.ebuild
similarity index 100%
rename from www-client/google-chrome/google-chrome-154.0.8037.92.ebuild
rename to www-client/google-chrome/google-chrome-157.0.8103.38.ebuild
diff --git a/www-client/microsoft-edge-beta/Manifest b/www-client/microsoft-edge-beta/Manifest
index 0079bb851d4d6..339f251943100 100644
--- a/www-client/microsoft-edge-beta/Manifest
+++ b/www-client/microsoft-edge-beta/Manifest
@@ -1,3 +1,3 @@
-DIST microsoft-edge-beta_157.0.4341.24-1_amd64.deb 201128746 BLAKE2B 9fe407f991e8817a2238bfc10045f2365280f9327dabdc29c8b76b9adf66bd20a5e8ac946986f9fac0d4f14ae9be72c2bfdeec4976bb73638776a8ff351e27a6 SHA512 036eabef41a0bcfd089f3e46ae2819ba86e42d71fbbb9187d341e81aaff3aefb175b617471d4984afa68cf512815b6d1798ff5749cc2c05aa6cc0b3d43c2dfa3
DIST microsoft-edge-beta_157.0.4341.30-1_amd64.deb 201172886 BLAKE2B 3c34837037f842234125e194dea899ce7e4bb8c66343415e9e0a06b17cb33188dea0255b7f7638ce2225c2dd79b72ac5c6714e5f5a5514e26d05ae0998eed910 SHA512 5f24a9a53447542ccb05d55fba9fb4cd235d5ced7618999f6a186490b3db5a90e1e539a5d281be311e93aa637afa200b4f5a6cc4157528917238bf502f868752
DIST microsoft-edge-beta_157.0.4341.36-1_amd64.deb 201196050 BLAKE2B 1ce4c66b3aca9c344f0af4b29a1b295c38d86065327b098b6ffb71113b67daf17b7a506dbfb95a9ec5695b7bc08d4f57f13e50f44e833455d08e18e10bb013b4 SHA512 8947d47e1d8a0cb8955149404f4c93f30dfa4e801154940f64cb37c1353dcd16aaacf874a781e31aad54517bbde31edc55b7bb0388a7a455211cac3f8a7f07ef
+DIST microsoft-edge-beta_158.0.4370.1-1_amd64.deb 205536682 BLAKE2B 5c40cfe8ac4c2b861bcd22d2c508c581d4b6562c4ff75e6241bedb0daa2f31f7a223d88e52e9a82064f9b266a1bf45f3be9437859cb4431c5705387a9c5ddf17 SHA512 006d50b99277d322bea8622d124f7013e531c11e47eb022273218ab06485e13dfaa4a33fb38f4fbf9cb19ee5a8a9eb8a06dfb2f85b48f9910de9e23271e7f709
diff --git a/www-client/microsoft-edge-beta/microsoft-edge-beta-157.0.4341.24.ebuild b/www-client/microsoft-edge-beta/microsoft-edge-beta-158.0.4370.1.ebuild
similarity index 100%
rename from www-client/microsoft-edge-beta/microsoft-edge-beta-157.0.4341.24.ebuild
rename to www-client/microsoft-edge-beta/microsoft-edge-beta-158.0.4370.1.ebuild
diff --git a/www-client/microsoft-edge-dev/Manifest b/www-client/microsoft-edge-dev/Manifest
index 5c1c30b12553c..ef2ee3362a949 100644
--- a/www-client/microsoft-edge-dev/Manifest
+++ b/www-client/microsoft-edge-dev/Manifest
@@ -1,3 +1,3 @@
-DIST microsoft-edge-dev_157.0.4329.0-1_amd64.deb 200692094 BLAKE2B 90f0d0993a8c0eaeefb8361ca0fedb56e20349e27ccdb14c7727ad548363beba8e64e165d665184957e3b0c1fd4e62d889adb6fa303ed5efd0492782a80d0acc SHA512 44a87e6bde50566029b363bb7f70c7d41670915c1997c94036dae8ea283d902cc9642ce91a0823c2014f9ebff8357fdca8f60aec636cc79ef4aeb32f73dd4320
DIST microsoft-edge-dev_158.0.4344.0-1_amd64.deb 200824210 BLAKE2B ca2215469e2935b8725c2426754e3c2199212160c52c208e9ba9c58b7c9e56b2e758d5964c61669c9251439721d62bfce53126779005e616447f57c6e4c372da SHA512 216bac52bd8c0ddfaf202f3dde351f021f58033e02e0b107081371e35cbe312760b171f69b6ad4d357c15003e148ef3867913b43bf29d24909853f127b68b34c
DIST microsoft-edge-dev_158.0.4357.0-1_amd64.deb 202202634 BLAKE2B fbbc7cc7d6f6e09740191292dfecc4a8dc27019cfdf718596114d42504930349b35c7e55ff5e6e295287433441d2944283aa71e3e2dc50c484ead044bd637a13 SHA512 8f30d7f067a1828d64beefc6cc54e58694a5397e88030aef81b6ff74a4aedbcf1931826d6e2513055ac6eb868c008d3ce4cd181850825b3fbbec6b815daed42d
+DIST microsoft-edge-dev_159.0.4378.0-1_amd64.deb 205342898 BLAKE2B 2c32885693a7237f540afb826bd61a73c992a6d197d68e5882774bfcbeb350d3111c9e118be6cb950646523fcfc02e14d16eec99b4e3d90b2fced3f824379b92 SHA512 e7c7b0f0321ca147a7f8714b35e91f7d914fb0df308821783ab9dbb490390e79768720a0949c056fc53a9a9e90694b98d4b4372e523c191174e1d4e6bee209d2
diff --git a/www-client/microsoft-edge-dev/microsoft-edge-dev-157.0.4329.0.ebuild b/www-client/microsoft-edge-dev/microsoft-edge-dev-159.0.4378.0.ebuild
similarity index 100%
rename from www-client/microsoft-edge-dev/microsoft-edge-dev-157.0.4329.0.ebuild
rename to www-client/microsoft-edge-dev/microsoft-edge-dev-159.0.4378.0.ebuild
diff --git a/www-client/opera-developer/Manifest b/www-client/opera-developer/Manifest
index 7966945998230..90198e98ecda1 100644
--- a/www-client/opera-developer/Manifest
+++ b/www-client/opera-developer/Manifest
@@ -1,6 +1,6 @@
-DIST opera-developer_138.0.6038.0_amd64.deb 145483810 BLAKE2B 8a42a25a5f5d6265c7e27565e746e2cf2bd50145d27f9c7ad7d3a6c64caa8cff561ebbfe140d7794f77d34d8f3abec8c80969ebd9c750034b26f890e6000967a SHA512 d8ade99eddef03e2c470351acadebfa68943216f5dfa5d6d6c872d1897dd6c91b9a3bc38045f32fd51a789b2fa90aa19f4ff0f9c0aa7131fae8f92133a8c3440
-DIST opera-developer_138.0.6038.0_arm64.deb 154459740 BLAKE2B 3599f0c75e8c09b270201a38b1915f6687ec6ec66b7d49bb01c925906a1822412e20370fc7064622b2018410702a8949cf590a20e5670b575923de54728846f6 SHA512 d55f4f84a31bd984b06770a454e12b729857f1b5c4df2d079f60de8b8a60d2264606a00a76c0ea488f1b58ac4ae2adf99b9d4237ae11625f0432c9243fbe88f3
DIST opera-developer_139.0.6051.0_amd64.deb 146953004 BLAKE2B e5a504dde8a710583fd3d54cb51e7701b013102aea532b00edaa740c1302eb96bdbbfe322476c14d2da7861b9c915b05d325469ac102f8b8e21072422050dcc0 SHA512 3701319eb7d999688367f773de58c5e6979027ec3cbdc24194fb93fb3047e10156120718a4821c087d69a2621b4c1da61e6acc1a001a49323a6754c78c6bd713
DIST opera-developer_139.0.6051.0_arm64.deb 155497376 BLAKE2B 89646989aa08098f7ad0271d16a457d51b7988807b743e812b33615a6eeb2b5bf83ebbd77d5823778be7ee6ee8e8e3b4e8d107b3691a367eba09e8f8eeff2775 SHA512 ed9be9d7bbb55b959388b899f9e9b74d967d6cb4a36d0e68d07d70324e5bf61189279829905aa16afa02274f801a0eb3258a910be3054e6c552958e142edbad8
DIST opera-developer_140.0.6066.0_amd64.deb 146666444 BLAKE2B 5df2f2bf91288904a823e5a431ec49bf70e17979cae08bab00a9c58a8c5b08e912e7be242516732d64cd86beddb72cb5f753892d1db1392a46c8ffccea23c6f2 SHA512 8318cda6099bd058634350ffc1772c3fedf540e21190778b9b9a54e8f1f4d6ce801b73f7b47da08c409ef863f077c920f26e789bea35e690ba17f4d7b7dad5cd
DIST opera-developer_140.0.6066.0_arm64.deb 155351760 BLAKE2B 5b48e4b26be2107990bd5cc91b778e89c05e2802ae18dae9a8062d4e7bf6a12bb486a6c2b6ef8061c6dd4ba96f4732edc703bd42e6a5c86d5f251c63d2715660 SHA512 153a2bdb039805fe0813c32c170ea3683682d6ef9c79bbb676cd030b2850f7b0aa066b1c78d6bb25cc806fe28692670cadeb5478cb36f3ccefb306d82d86118e
+DIST opera-developer_140.0.6072.0_amd64.deb 146744138 BLAKE2B 91e766b56a4d8264cbbbeeeb64a40b574d984cbe89ae580ab7729c12fa46b678bfe60119f7ae65219fc8933afd696510510da1299e80242814c676179b92e925 SHA512 33f0a5fc76594f41249b7f7aa4c549f81e202e0e4135ab27e5b7a48691c12b7a8cba61e3d564958ddc89299a038ee139b8f7176fdd1df960940d46fb570f06b0
+DIST opera-developer_140.0.6072.0_arm64.deb 155385596 BLAKE2B 682cbbc49f9ffce81f8a8d93887255604be23ad605ed7361c431c040b31c1ebd99d6ecc9b9d3fa623d6f7d2c5137cdd4d1710f37dac7cea947b782e53d585255 SHA512 72de060c632e0d4a80922cd4d3cd415f8994a42a29899812a4629ce0c27eafc4b2ff14eb56362cdf7b75f2b032c1ccbc1a1bbdf487c38a968df838bda36f9265
diff --git a/www-client/opera/opera-139.0.6053.22.ebuild b/www-client/opera-developer/opera-developer-140.0.6072.0.ebuild
similarity index 100%
rename from www-client/opera/opera-139.0.6053.22.ebuild
rename to www-client/opera-developer/opera-developer-140.0.6072.0.ebuild
diff --git a/www-client/opera/Manifest b/www-client/opera/Manifest
index cc4c598d57b19..25498855897d5 100644
--- a/www-client/opera/Manifest
+++ b/www-client/opera/Manifest
@@ -1,2 +1,2 @@
-DIST opera-stable_139.0.6053.22_amd64.deb 146620916 BLAKE2B 0245f461e7e1ed3634febb175be4a8487f987fdda1c53c65e8e6898ab1f4c8d1f58f6f16b069de51e188582df390cb693654a10733acfa03b91a017bd727a2b8 SHA512 63edfc66797114192eac9c09879f044554e1d616bc9882b5ab5724afbb5251ff5f413f9c0034aaa34dbb845686f014a04b9d6de1052236a12da788bf8abdcef2
-DIST opera-stable_139.0.6053.22_arm64.deb 155051200 BLAKE2B 228307309cf581878b10aa4251675ebfbc7f963097e87d65bea4b1fcb756c0fbe1f905e8d7a1392547a7da01d0121146c219aec74418797ddda2c6aba006cdfc SHA512 26e435d436c5c5bc3dc5449eee89457ef8dfaf29d6a10324be3e2479a61616189d47a0d663b0a42dc73f33bff2d6137b9c3f5239d5602a1e94b7c855b9849741
+DIST opera-stable_139.0.6053.38_amd64.deb 147257374 BLAKE2B bcca56e3e33996937d2df7729ca655ad2b1599f90e2bb5d4914f3ca57a0d350dc1b396e4880792d24f7ddd68568682bf7aa4842a2e5d424f0b4ab97587ed281b SHA512 34373c6b33c31460f97d604e8cfcc67b5c09c13d37802da696f97de4959acb8a651d736f7ca4d82489ed153a145e05ac55943283ffa830403fa991d9ab565e93
+DIST opera-stable_139.0.6053.38_arm64.deb 155624424 BLAKE2B 791d82c6c4071789833aefb1b7dff9b992efb8abcfeaa7cae9d849e15a4581acfee26a3904ea633cc658095cadc8c9088408976455b801c946776928bcc74cdb SHA512 5036a89cfe33e96fffb9484a2ade37e1940e32bbabe18beb7d6a1f5e89251f7353f14098936845cca8188f4e2d84a6de21419e5a85d91e407b004a0bdea3b4cd
diff --git a/www-client/opera-developer/opera-developer-138.0.6038.0.ebuild b/www-client/opera/opera-139.0.6053.38.ebuild
similarity index 99%
rename from www-client/opera-developer/opera-developer-138.0.6038.0.ebuild
rename to www-client/opera/opera-139.0.6053.38.ebuild
index 9e07d5e923a0f..5e9264c99a68b 100644
--- a/www-client/opera-developer/opera-developer-138.0.6038.0.ebuild
+++ b/www-client/opera/opera-139.0.6053.38.ebuild
@@ -31,7 +31,7 @@ fi
# Commit ref from `strings libffmpeg.so | grep -F "FFmpeg version"` matches this Chromium version
# or use Chromicler to handle bumps.
# Does not _need_ to be updated for every new version of Opera, only when it breaks.
-CHROMIUM_VERSION="153"
+CHROMIUM_VERSION="155"
SRC_URI="
amd64? ( ${SRC_URI_BASE[*]/%//${PV}/linux/${MY_PN}_${PV}_amd64.deb} )
arm64? ( https://deb.opera.com/opera-stable/pool/non-free/o/${MY_PN}/${MY_PN}_${PV}_arm64.deb )
diff --git a/www-client/vivaldi-snapshot/Manifest b/www-client/vivaldi-snapshot/Manifest
index ed1d71d3d7ebe..11f6dcdeaf3aa 100644
--- a/www-client/vivaldi-snapshot/Manifest
+++ b/www-client/vivaldi-snapshot/Manifest
@@ -1,4 +1,4 @@
-DIST vivaldi-snapshot_8.3.4191.10-1_amd64.deb 143221672 BLAKE2B 4145bd3f7196c20ec1ad12919ad8a1512dc772e86dc88a4da03d2f8ed28b68fa09622d9a8a72734a3fc0033f49d59a41643c127e4b0541ffa51c250033cb4f10 SHA512 eeb1258de9e76513e1c891805ed638412878fffbb1e5b6afb3d51572b01ffb6114030b451b83ff7dbcd8677e766a708713529ad8af4eaadb8604e084e0b5fada
-DIST vivaldi-snapshot_8.3.4191.10-1_arm64.deb 135501564 BLAKE2B 238f9e79af89075177e9e44f974e7b4e72d6712676274b236e2a031acd08089a88ff0cb8051db86638ca375529b01cd5d53852546e06d0de5b6db87417f657ae SHA512 13f6867bb862d1ea4c160c11051b1fab3021438fe06258fb84b4376dea1c69d4549fd415f59fa8a6cd6373c5a97a3466e0665b2a26d6fda209170dd7505ba155
DIST vivaldi-snapshot_8.3.4191.15-1_amd64.deb 143254792 BLAKE2B 7de1a3ac9eb2a7f99901b451deb89c0317253f71d046bc2d6daba4863cba36db365f26b1f5647287233e16d019b04706619418c4341d877479a5b7f4bea06de4 SHA512 1a09f9e9879472eb74d279cdeb850cecfdb4cf6ce288dc5ea228b6f29850dfa03d2ae8f831c6903943ab8c5d439ee06d685b04e6d6155030166bc20ca4d7a20e
DIST vivaldi-snapshot_8.3.4191.15-1_arm64.deb 135522704 BLAKE2B 2382b27db58ad27826b4a4cd37eda1c5e340a50889a5b5b638bc06e51e63a2e1c30923eccf5d8cca5d03fcce8c2d00aa4d3497572611814e1c9c5781f52c4801 SHA512 555700d1cd919d2aee62ff03c56b9962c6606da2262c7086fb32fb8efe862929a542a6667072066035873ab4c14761997c2bd9a1a1cbe66200754336b6a61cf7
+DIST vivaldi-snapshot_8.3.4191.23-1_amd64.deb 143219052 BLAKE2B 228f87117397741174fd0cb21cb34fc82b1c9087e0cb1ac095bc959ea9ec428dee4686ac4bfddf2e13157a8d57f233a23d9782100e152e3352b513186d753b4b SHA512 7df74b6a5efe1bb37f1dbddb8b3b14dd356353e206b88659446d0cc5e255f004dbdb39f49f14a60ff62ea8ecdac9096b25a2e59c9d9fc7d77729fe94fd766b77
+DIST vivaldi-snapshot_8.3.4191.23-1_arm64.deb 135506152 BLAKE2B 70810bd5e2e34b7995cc3eec0d2f9ac8c48961d5c5359e777284d3bc00b919eab75548d479226b706a1547915d53ce353bd2379b419b40a9761b710c65ec37ed SHA512 bc58c99154f4f13413be9ef0536174cb038ae80f1ef602c625ecbda83a04d165a8dfeaf41ea6133954005ce8c8ac1871d0682404d8b016aeebc4457a8cb1d983
diff --git a/www-client/vivaldi-snapshot/vivaldi-snapshot-8.3.4191.10.ebuild b/www-client/vivaldi-snapshot/vivaldi-snapshot-8.3.4191.23.ebuild
similarity index 100%
rename from www-client/vivaldi-snapshot/vivaldi-snapshot-8.3.4191.10.ebuild
rename to www-client/vivaldi-snapshot/vivaldi-snapshot-8.3.4191.23.ebuild
diff --git a/www-client/vivaldi/Manifest b/www-client/vivaldi/Manifest
index 258a501f7a1c0..3dc435a11df50 100644
--- a/www-client/vivaldi/Manifest
+++ b/www-client/vivaldi/Manifest
@@ -1,4 +1,4 @@
-DIST vivaldi-stable_8.2.4133.94-1_amd64.deb 138320856 BLAKE2B 514756070f4cd59e6ea0fa0a712de2c31ad1bf1c816f3aff141ff44c395a4c8b014f4e470687ede785da5758fdda84bc1ad2d2cd6730a0cbf9356f6110bd7659 SHA512 d1975310e40ff57c1ada505bf7744175014df44294593cdea6968bc170715d80a05481ae963f62350a62258fb20ee5aa961e7ffbdac32c0e496e726f99f69735
-DIST vivaldi-stable_8.2.4133.94-1_arm64.deb 131212016 BLAKE2B 355de4f65038f6afcc041aa22ba284dcbdb52a11f5cad012e8029d4c84b254bebbb69b7d9d0c1bc587565d6e6951d7f05893368362f814c2a09c4f721b3feea7 SHA512 aa79f5da0dce13575cbe8bffb72025cc420362e213fc7afa0d78f6afc476ee84c9c5483279f67f7fbf1a5a1ac7c92d30246ebc45108c25aa66eca46d5a40efaf
DIST vivaldi-stable_8.2.4133.96-1_amd64.deb 138358448 BLAKE2B 2014383d699be578b5e3933d1a12dae386d8a7bdad922fb06402d0cd99990df3d5d812bb2fe1d9a27b6054777ffd4934c6f918d8b5912c38dda1de1b484ba051 SHA512 997ca219600da872a750f318da420a0d3e55b33525c39caed7dee065a89fd477f6be050f6a1cd327fa1a0886cd89e98edd7284ce05d605d04d47a638fcaacc19
DIST vivaldi-stable_8.2.4133.96-1_arm64.deb 131203124 BLAKE2B 94ea49ec4e27f9b6fed95e947b12e973666f48ffc651b85829ee4969bb5951436fef7133d7508c2cc34f8dc750a98b7da48b33e694012310776eaf234e8964d3 SHA512 a32b564a72b6db77ba5fd4e8a3cf455cda2f475f9e7333fb32346a60046eaa21e4602308e9d8295eab112e043f26b53291919d8b39014c99c3c23d74480a1a49
+DIST vivaldi-stable_8.3.4191.28-1_amd64.deb 143283708 BLAKE2B b17a6e82837ba149b5e2ad87a8047c3291a6de5f6eb0d74d5ab07ad01d21b8ba2dba7c49010ff2f60226fafcb19f8373db8d85661ef0fc5f3d23e3dfe4dbef9e SHA512 238f84592190a50178bae1a5b35f45320ebba1cda7e7597a9301012748a0dbb115d959fd7d65fbd6981561af10b6674a5353c0dad47afb66c4b7b70ec077db3f
+DIST vivaldi-stable_8.3.4191.28-1_arm64.deb 135561764 BLAKE2B a7ffd7571be194772c5ddd0467e52c832307008da1a50c4058b7be28bcd596426a90a220ae1a0f2f49639a108433ddb84138180dc38ca114faca8d448d5840cb SHA512 9715c5304519a6d1278e46d367d76240afd4e96f160fcc438bcd8ed721b4d909ce1b0edefa17dbff1523efdcd3ab222d21f7791f253839e01f864ce00a5b6b40
diff --git a/www-client/vivaldi/vivaldi-8.2.4133.94.ebuild b/www-client/vivaldi/vivaldi-8.3.4191.28.ebuild
similarity index 99%
rename from www-client/vivaldi/vivaldi-8.2.4133.94.ebuild
rename to www-client/vivaldi/vivaldi-8.3.4191.28.ebuild
index 078e8240f2b9e..cae3be2599eae 100644
--- a/www-client/vivaldi/vivaldi-8.2.4133.94.ebuild
+++ b/www-client/vivaldi/vivaldi-8.3.4191.28.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-CHROMIUM_VERSION="152"
+CHROMIUM_VERSION="156"
CHROMIUM_LANGS="
af
am
diff --git a/www-plugins/chrome-binary-plugins/Manifest b/www-plugins/chrome-binary-plugins/Manifest
index 62f48fd08f571..a4161fe578360 100644
--- a/www-plugins/chrome-binary-plugins/Manifest
+++ b/www-plugins/chrome-binary-plugins/Manifest
@@ -1,15 +1,15 @@
-DIST google-chrome-beta_156.0.8078.4-1_amd64.deb 144860768 BLAKE2B 8d1802e9fcefb1be2d946ddc74430dabe490b49041291dc3bd907ec62ff506b627662388fa038f33a2001a7b11afb27d23581725fb685403569a1bd7915f28f1 SHA512 4f43eed048a4a648a42f9d28a7ab9e7db8a911be7066e13b0811ea941886abc1421390d5d66cfefbe915e373e67f979395679343ebaaef7b19dde84215ef87cd
-DIST google-chrome-beta_156.0.8078.4-1_arm64.deb 136586204 BLAKE2B 66e88833ebad934229dab42af8e9d078643aea0382e438ba458f6f3251ff6eec464a87ff507cfd5dccfedbd1372b02c38809fe51cc788241bb0289eb5dd3c3f7 SHA512 1dede01b45ff8f6bac8c7fd4db06866edfe93407859297d2e8f9557356e6845d8841a5b24e013153479d903be932bbb6e7ece9a8ad6e48ace3882037ef8f23f9
DIST google-chrome-beta_157.0.8103.6-1_amd64.deb 146776016 BLAKE2B c6be5502b766db1ed629c5ebcc4d478c4d7b8bedb73492aa1702faa174d09f510a26ba1750ac2355ff65369432bd0f9020c2e4c29929c9c9340c749ea1b37b33 SHA512 6ddb804e2ad4b7c9adaf64e025014d46c0ad07866915849340c860356a8ede2374f051575f8b7916e5657f47306c7f7e84711238fbd5e0bddc5cc70ec3f8987b
DIST google-chrome-beta_157.0.8103.6-1_arm64.deb 138959112 BLAKE2B e6d22f7b426eafd34ac1277f4d2a7f2ecd6fe79f8fba7677e537964a3362761440ed8da38a6f3fe127eb85b5f1f9a8913dd75e2e2004092f14d24f94cec54195 SHA512 fb875947090416f98b0501dd418694094e61f1cfbf735a5a0f6a47b33069a7c4a740359abb7c4be8638e8f0f6caf8852733e27794f82ba63053e7f24b7cc0a6b
+DIST google-chrome-beta_158.0.8127.18-1_amd64.deb 152667100 BLAKE2B 630bfedca5b194b4f94cfd3856e4cfe3a9ccb4c22a50261e6ceea47520e0f80560afbdf9909079050dda8a788131a73140cdfb41d644b4100ad7f4622546aa33 SHA512 8a4a711ef38b35079d0e89a558cbc9cf74a13077c7f4b947587a1631e960a20c44b8250cc1c1033cfa074fa1838ae0a6a18b0d5197479a410a938dd1490171d3
+DIST google-chrome-beta_158.0.8127.18-1_arm64.deb 141821012 BLAKE2B 84e0ceb338c56f94c06c330f23860afa1a5189832202f178d17db211c03cf45c9f60ef8c9c83fa493ed65f0e47fde707a46df69340b8df93f1d184015fc1c6a9 SHA512 a294a9c81231a3741291cc3f073fee3d253d6c6542a3d6976cb4437d84a397f4d671117d4658cff2ec46c3429ec7279d360493b5b973de8cd2b0d5762ae26d9c
DIST google-chrome-beta_158.0.8127.2-1_amd64.deb 151811532 BLAKE2B 77c1c6f8a152f8b26133fe46a334787a05255e7c465c04ece3a17572be40101ac9ca2afba634d3b144948f4a817d62312c0085f115be728b9c806d2eaaae3462 SHA512 2e460c53e452d8dcae1dd229c6ad282314d3dc70637c137f2987c5401784906dbbcecc84451e1a47fbd6aeb77cdd5ed83aeb5f7752c39dab0b3b4117771c1b8d
DIST google-chrome-beta_158.0.8127.2-1_arm64.deb 141797012 BLAKE2B 8930412df9e095338a2354a5ab2ce228c7d2c10f738c71590efdc7eaf7c18a186f272a5d5781c0e6e92899cfafa69e2b20300e9df1abf6654317f42321e96a50 SHA512 f1c4ea37aa59d3bf9e283300142979137ad2e0a4a3aa145d072117758212a1298f12e6324d4ea6ef6d85310042d1ecaf52e16eb07d1a79cb7baf98daa4a4d91c
-DIST google-chrome-stable_154.0.8037.92-1_amd64.deb 142883344 BLAKE2B de3f3f7272319f62aa12d034e8feac4b3dd0ed7b7b1a76e113d78c1908b25c90a33f19d9b3018f2c4da155c9575624c8c9457387a176cd8ea33092a04f6eb081 SHA512 528f474f27254d188c9bc837b863f559d37ff1037b16053387075c0d0d3314c5506312112fa19c36c9d2c321fb83b8b38f77a6703ab1920a8e1d751c9c900101
-DIST google-chrome-stable_154.0.8037.92-1_arm64.deb 134430076 BLAKE2B 8397b0855b070db490852d2cc27535c38d9820d272c681b6dafc5338ac394e8496711c7e3470ffee819255f72a8badad84c054bb5adc6f45d3dcab875ef240e4 SHA512 2f5fc99557158172f001bbef10c031be6be7f25564bb7655289956d05468f89c42972608987de47ccd3e2ec1d4db6ed1f5ac6f734a914150252de46c202d3b6a
DIST google-chrome-stable_156.0.8078.47-1_amd64.deb 144849192 BLAKE2B a401589aef8cbccc1a2f7adce44a83ca44338d95e241bf384ef2654e4a7456cb77169fd28c835cce1e3e8b8e30379cb692bf7d84aa2c3707d9ebcbb51e6df861 SHA512 ffd886eb17c3993aef9fe440a2ab56c7b82b95555c693eb81efe09eeb3cf308434a69293bec36b7e363f55d453925c1b2763c989b66d847df67e714ef237b3fc
DIST google-chrome-stable_156.0.8078.47-1_arm64.deb 136588320 BLAKE2B df690a06124bc7cd5bf80543d14e3ec83aa2496d8d037c492b7fcddd10193005c2e2eff005629e1a107175b5dbc44a3273d3416018b156899d72cc03a7d2acf4 SHA512 732099a8779c4389f7eb3605b2c624a3e659d3a0eeee8d225e80d48813d53468fdd8d5048f670b4d69eecb64e96c573f712f8eabd6d9e28386d4fa0ce0820486
DIST google-chrome-stable_156.0.8078.79-1_amd64.deb 145633696 BLAKE2B bda5895101716ca07952d87a05514c0561f96024cbc8542464c360508a152c855542d7077927173c66e14065d64f6c2aa26e047c7317e818d545ce4e6eec8a94 SHA512 68ea17afbc84d788ed9e1b6c2c16e979a5e5773b1ae6b6b30e4485d0c39547d7f3a74f028bc5e134cc1412c8534cfdf31b4f85e9f3016fc8b70430d768324315
DIST google-chrome-stable_156.0.8078.79-1_arm64.deb 137373656 BLAKE2B 34f75eb13a20ab24f7d9872109349f26e0804508bec3cfa2af26db7a338e50571ba5eb8625849c308d944f7cce84ba61809d65da0ebc3488b362db7343ec1e87 SHA512 6510cdee61b3ee83c352c460ceb47fedc4caae638dbb380c523d57ea396e02174ffa5073f1932f4108f8416b62482c4759f993e8ccddf3a268737729b8c00d16
+DIST google-chrome-stable_157.0.8103.38-1_amd64.deb 147633324 BLAKE2B f13c8bdb2eee5aa1902c70a3d46dfa0e532570f31188e0e9b8fc4601a87fd2efa72ba4570bb7939c794ca38034ffc8d81e646cc0be91b5c67d5dd6dbe8979a87 SHA512 92a77ba2ef2fce868ecfef0e288e4ef6f6c7b390cb249eb592287a3ce42d21fc36181f4dd234ff072cfa927abcb24cfd9dfa3bdb736d1dcf23eae6adaf91e706
+DIST google-chrome-stable_157.0.8103.38-1_arm64.deb 139364644 BLAKE2B dcb40d324317d8f45c66a11ab8e20718aa6237281ee08e667762bab80e1ef8410346cef83ffc41ff31150ef05faffb100096785657a5c3d63ea1d6efb8199acc SHA512 09d20ed5c76fe9f7b5a3d085bf1e3f78772ab376764e4318c9b497ce4a2c47b0b901b7daf0107dc2c4955869e21e9390e394ed43a9558d2358845a33cae67222
DIST google-chrome-unstable_156.0.8072.0-1_amd64.deb 144573000 BLAKE2B 3212d057c97f25d6f5d417e214f2b432931ff357766b5889ea298375c02d7e57b0901b34d9796638cbf45ccf97e018da880682771dffbe25b70375204a3098cf SHA512 8114d6c511e6cafb2d38747e3bdb56e208eb8ebd12bc36bf7f0d54bf930cc4ddfce78bfbcac52502c0dc93c14a407b41dafde1c10861d89c72bcc575ca66211d
DIST google-chrome-unstable_156.0.8072.0-1_arm64.deb 136466616 BLAKE2B f5d269426f151ef6f208107de7305f8c05eade97051c299077fca981ccc8cb6f9a433b90f6180bfcdcc4f4a1ac7756ee5d532ce2183ee75be8ea1d1967d37069 SHA512 cbe08929f18d7461bd868075bedddbaef84d18283ccf5e671cffb5b38cd6e096398053bded512498b51fe08ef3f955f14edd7276e4091d0ba8ef229b0c4ea1ff
DIST google-chrome-unstable_158.0.8106.0-1_amd64.deb 147679128 BLAKE2B 7cf35bdc85e22b9e83c0fb0378b952cb48e8fc937044846bae26d6b0c43423b090a161de2eab13dfbdc35b269f6242810ce761ffb9fcab81b5dd1f1a1eb3b6f6 SHA512 3c556358bcc307388b25e0f666d221d379554dc39d024dda254383d58385cbc6cd20f03233d43189485ec183d494623d6005793c2f3541ecf3eccb1d97236313
diff --git a/www-plugins/chrome-binary-plugins/chrome-binary-plugins-154.0.8037.92.ebuild b/www-plugins/chrome-binary-plugins/chrome-binary-plugins-157.0.8103.38.ebuild
similarity index 100%
rename from www-plugins/chrome-binary-plugins/chrome-binary-plugins-154.0.8037.92.ebuild
rename to www-plugins/chrome-binary-plugins/chrome-binary-plugins-157.0.8103.38.ebuild
diff --git a/www-plugins/chrome-binary-plugins/chrome-binary-plugins-156.0.8078.4_beta.ebuild b/www-plugins/chrome-binary-plugins/chrome-binary-plugins-158.0.8127.18_beta.ebuild
similarity index 100%
rename from www-plugins/chrome-binary-plugins/chrome-binary-plugins-156.0.8078.4_beta.ebuild
rename to www-plugins/chrome-binary-plugins/chrome-binary-plugins-158.0.8127.18_beta.ebuild