commit:     908da804d868b8eef3b2c2680adacad48155da39
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 16 07:07:18 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Thu Jan 16 08:00:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=908da804

www-client/chromium: keyword 132.0.6834.83 for ~ppc64

Switch to Raptor Engineering GitLab as the source for our
patchset. Use existing M133 logic as piloted in #940304.

This:

- Enables builds on 4k page size systems
- Enables builds for ISA3.0 (POWER9) based on USE=cpu_flags_ppc_vsx3
- Is generally better than what we were doing previously!

Closes: https://bugs.gentoo.org/940304
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 www-client/chromium/Manifest                      |  1 +
 www-client/chromium/chromium-132.0.6834.83.ebuild | 50 +++++++++++++++--------
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
index 2b6c88e7820d..61fa8bcd3464 100644
--- a/www-client/chromium/Manifest
+++ b/www-client/chromium/Manifest
@@ -11,6 +11,7 @@ DIST chromium-132.0.6834.83-linux.tar.xz 2193406712 BLAKE2B 
65cd156a97bcb4888ed3
 DIST chromium-133.0.6943.6-linux-testdata.tar.xz 299258632 BLAKE2B 
55e59061701aa0a2da4822519c3d267bf2d5da99c1b4bfe139423f4c085a9972b648c5ab3e2463ad768f6fd14207b6c1d26c2424af1ccc50144cc4e402265566
 SHA512 
b099e1136e7c58952a6c0d25904c41c0e929db2fe7124f76f8ee82b8c56ae118ce02b784b7ca898d2f02d2703999f158803988aceeced17d824c6047e8fddc47
 DIST chromium-133.0.6943.6-linux.tar.xz 2297438504 BLAKE2B 
58b09f6e1bde370a1ff02ea94356e9a3e241b205ff63146aa25823023acbd7052d1a05d77c14c796962ccd35fd29c0ee7554906f58b3b3a40dea02115b4cc352
 SHA512 
e1378af355ae503426af127fd3bfe7d85ff77f8fe66bb3c6f00b38cc872de43566e31e5d2200bc25c721077dae69462d7af5b67bedeaf644819f04f81d55adfe
 DIST chromium-openpower-a85b64f07b.tar.bz2 387899 BLAKE2B 
b01fda2d64ce73068d1536a10cc0896f07a4b714cdb25698b1df8b3252baa0c21c4209b307cf1cb554854f6d0bfe3cd35e06aaa8d02ac5d409a119335084c324
 SHA512 
05eee81677e8766808441c939bee68e2e6c58ec91f471d88a40181d2eda78614a0a6d27d92ff8f9dda564d12f3451bace4ff2727594748c5c238a3533038019b
+DIST chromium-openpower-c11b515d9a.tar.bz2 396039 BLAKE2B 
c05653e6bb62188c18864e783197853f4c41f88d1c928044a0ea0cb4677bc17806fac266ab100cbbcec3cb0d964bf2172917df95679927c1f1a88fa34aef4f53
 SHA512 
e9d9bbb2dd8d998060c78dfd5bbaedc548a8c44b442f6259304797326c585046144a6bb8aa4e24c44b3b56068189bee8a01267db2a392e90fd5603d06c0ef9ff
 DIST chromium-patches-130-2.tar.bz2 10151 BLAKE2B 
b46515a3e01153d8c4e5c3ee1f6e9f905265bf88b698d46c8ceed0f90d36a057b8bb30a860e8d934bf0b85f9c0a671bef2c9a00349228fa076b7aec37ff62ca0
 SHA512 
e1ecca666c3998ee285426751be3220a5b67a057f2c92b1f45c7b786efb8d0b0e1d49ba70471fa74155f79f22811d240af636f61007191756c9981b53d3b23de
 DIST chromium-patches-131-1.tar.bz2 4932 BLAKE2B 
72006a6d751ae1207352547cdeef87f8cc9f9639283238da201d879c6fcd0f8bc499669cb030d8b4c2216fcd2730de46b0a071007b3d69a2bbdd22ba38bcd279
 SHA512 
11d7f861c007e9e28e5192fb354940180aea0e01e6e8ae77547e2dffd7b541b11f1acfe0fd0c8b6b4cbfc6c39ddfa79c8c08db42c1292ad329d49027d1406fc3
 DIST chromium-patches-132.tar.bz2 5040 BLAKE2B 
d5bd84dd90b395c6a15135637f51f931c72a2f301b1c24e9b938c744f2767fa36857b8edfdf5c44cf085a1efcb40475401fec226ce43446442f32fb174b55355
 SHA512 
29833b306a34ab6562ee58eb03669818da7235cd36666b27d829bcbd3c4d0035a530fb6be1c33cf88c1c11d43e68e3781f9b9602c0c004e7a37ffa69f9ee17c7

diff --git a/www-client/chromium/chromium-132.0.6834.83.ebuild 
b/www-client/chromium/chromium-132.0.6834.83.ebuild
index 80e260d2af88..918925ada49d 100644
--- a/www-client/chromium/chromium-132.0.6834.83.ebuild
+++ b/www-client/chromium/chromium-132.0.6834.83.ebuild
@@ -29,7 +29,7 @@ inherit python-any-r1 qmake-utils readme.gentoo-r1 rust 
systemd toolchain-funcs
 
 DESCRIPTION="Open-source version of Google Chrome web browser"
 HOMEPAGE="https://www.chromium.org/";
-PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
+PPC64_HASH="c11b515d9addc3f8b516502e553ace507eb81815"
 PATCH_V="${PV%%\.*}"
 SRC_URI="https://chromium-tarballs.distfiles.gentoo.org/${P}-linux.tar.xz
                
https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${PATCH_V}/chromium-patches-${PATCH_V}.tar.bz2
@@ -38,7 +38,7 @@ 
SRC_URI="https://chromium-tarballs.distfiles.gentoo.org/${P}-linux.tar.xz
                https://chromium-fonts.storage.googleapis.com/${TEST_FONT} -> 
chromium-testfonts-${TEST_FONT:0:10}.tar.gz
        )
        ppc64? (
-               
https://gitlab.solidsilicon.io/public-development/open-source/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2
 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
+               
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
 )"
 
@@ -47,12 +47,12 @@ SLOT="0/stable"
 # Dev exists mostly to give devs some breathing room for beta/stable releases;
 # it shouldn't be keyworded but adventurous users can select it.
 if [[ ${SLOT} != "0/dev" ]]; then
-       KEYWORDS="~amd64 ~arm64"
+       KEYWORDS="~amd64 ~arm64 ~ppc64"
 fi
 
 IUSE_SYSTEM_LIBS="+system-harfbuzz +system-icu +system-png +system-zstd"
 IUSE="+X ${IUSE_SYSTEM_LIBS} bindist cups debug ffmpeg-chromium gtk4 +hangouts 
headless kerberos +official pax-kernel pgo +proprietary-codecs pulseaudio"
-IUSE+=" qt5 qt6 +screencast selinux test +vaapi +wayland +widevine"
+IUSE+=" qt5 qt6 +screencast selinux test +vaapi +wayland +widevine 
cpu_flags_ppc_vsx3"
 RESTRICT="
        !bindist? ( bindist )
        !test? ( test )
@@ -367,11 +367,6 @@ src_prepare() {
        # Calling this here supports resumption via FEATURES=keepwork
        python_setup
 
-       # disable global media controls, crashes with libstdc++
-       sed -i -e \
-               
"/\"GlobalMediaControlsCastStartStop\"/,+4{s/ENABLED/DISABLED/;}" \
-               "chrome/browser/media/router/media_router_feature.cc"
-
        local PATCHES=(
                "${FILESDIR}/chromium-cross-compile.patch"
                "${FILESDIR}/chromium-109-system-zlib.patch"
@@ -380,23 +375,42 @@ src_prepare() {
                "${FILESDIR}/chromium-131-oauth2-client-switches.patch"
                "${FILESDIR}/chromium-132-bindgen-custom-toolchain.patch"
        )
+       shopt -s globstar nullglob
+       # 130: moved the PPC64 patches into the chromium-patches repo
+       local patch
+       for patch in "${WORKDIR}/chromium-patches-${PATCH_V}"/**/*.patch; do
+                       if [[ ${patch} == *"ppc64le"* ]]; then
+                                       use ppc64 && PATCHES+=( "${patch}" )
+                       else
+                                       PATCHES+=( "${patch}" )
+                       fi
+       done
+       shopt -u globstar nullglob
 
-       PATCHES+=( "${WORKDIR}/chromium-patches-${PATCH_V}" )
        # We can't use the bundled compiler builtins with the system toolchain
        # `grep` is a development convenience to ensure we fail early when 
google changes something.
        local builtins_match="if (is_clang && !is_nacl && !is_cronet_build) {"
        grep -q "${builtins_match}" build/config/compiler/BUILD.gn || die 
"Failed to disable bundled compiler builtins"
        sed -i -e "/${builtins_match}/,+2d" build/config/compiler/BUILD.gn
 
-       if use ppc64 ; then
-               local p
-               for p in $(grep -v "^#" "${WORKDIR}"/debian/patches/series | 
grep "^ppc64le" || die); do
-                       if [[ ! $p =~ "fix-breakpad-compile.patch" ]]; then
-                               eapply "${WORKDIR}/debian/patches/${p}"
-                       fi
+       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 isa3.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
-               PATCHES+=( "${WORKDIR}/ppc64le" )
-               PATCHES+=( 
"${WORKDIR}/debian/patches/fixes/rust-clanglib.patch" )
+               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
 
        # This is a nightly option that does not exist any current release

Reply via email to