commit:     5efb565dd7d17295081bf32c5936a7a7d792c8cd
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  4 12:26:24 2026 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Wed Mar  4 13:04:40 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5efb565d

www-client/chromium: set `CHROME_WRAPPER` in our stub wrapper

Some incorrect logic during the initial slotting of Chromium and
launcher script reshuffles was providing an incorrect path to the
wrapper script to Chromium, which would then feed that path into the
desktop entries for PWAs that users chose to install.

This commit sets `CHROME_WRAPPER` in each channel's stub wrapper script
and delegates setting `PROGDIR` to the www-client/chromium-common
wrapper script.

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 ...r1.ebuild => chromium-145.0.7632.116-r2.ebuild} | 26 ++++++++++++++++++++--
 ...-r1.ebuild => chromium-146.0.7680.31-r2.ebuild} | 18 +++++++++------
 ...03.0.ebuild => chromium-147.0.7703.0-r1.ebuild} | 17 +++++++++-----
 3 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/www-client/chromium/chromium-145.0.7632.116-r1.ebuild 
b/www-client/chromium/chromium-145.0.7632.116-r2.ebuild
similarity index 98%
rename from www-client/chromium/chromium-145.0.7632.116-r1.ebuild
rename to www-client/chromium/chromium-145.0.7632.116-r2.ebuild
index ff9e50c859d9..275a21342cd3 100644
--- a/www-client/chromium/chromium-145.0.7632.116-r1.ebuild
+++ b/www-client/chromium/chromium-145.0.7632.116-r2.ebuild
@@ -173,7 +173,7 @@ COMMON_DEPEND="
 "
 RDEPEND="${COMMON_DEPEND}
        !www-client/chromium:0
-       www-client/chromium-common
+       >=www-client/chromium-common-2
        !headless? (
                || (
                        x11-libs/gtk+:3[X?,wayland?]
@@ -1556,7 +1556,7 @@ src_install() {
                export 
CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
                export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
                export CHROME_VERSION_EXTRA="${SLOT}"
-               export 
PROGDIR="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
+               export CHROME_WRAPPER="\$(readlink -f "\$0")"
                export OZONE_AUTO_SESSION=$(ozone_auto_session)
 
                exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
@@ -1711,4 +1711,26 @@ pkg_postinst() {
                ewarn "Chromium is known to behave unpredictably with this 
system configuration;"
                ewarn "please complete the configuration of this system before 
logging any bugs."
        fi
+
+       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-146.0.7680.31-r1.ebuild 
b/www-client/chromium/chromium-146.0.7680.31-r2.ebuild
similarity index 98%
rename from www-client/chromium/chromium-146.0.7680.31-r1.ebuild
rename to www-client/chromium/chromium-146.0.7680.31-r2.ebuild
index 04280933f2a6..1c34e5824e2b 100644
--- a/www-client/chromium/chromium-146.0.7680.31-r1.ebuild
+++ b/www-client/chromium/chromium-146.0.7680.31-r2.ebuild
@@ -173,7 +173,7 @@ COMMON_DEPEND="
 "
 RDEPEND="${COMMON_DEPEND}
        !www-client/chromium:0
-       www-client/chromium-common
+       >=www-client/chromium-common-2
        !headless? (
                || (
                        x11-libs/gtk+:3[X?,wayland?]
@@ -1549,7 +1549,7 @@ src_install() {
                export 
CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
                export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
                export CHROME_VERSION_EXTRA="${SLOT}"
-               export 
PROGDIR="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
+               export CHROME_WRAPPER="\$(readlink -f "\$0")"
                export OZONE_AUTO_SESSION=$(ozone_auto_session)
 
                exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
@@ -1705,8 +1705,7 @@ pkg_postinst() {
                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 [[ ${SLOT} != "stable" && -n "${REPLACING_VERSIONS}" ]]; then
+       if [[ -n "${REPLACING_VERSIONS}" ]]; then
                local replacing_non_slotted=false
                # there could be more than one PVR
                for version in ${REPLACING_VERSIONS}; do
@@ -1717,9 +1716,14 @@ pkg_postinst() {
                done
                if ${replacing_non_slotted}; then
                        ewarn "This version of Chromium has replaced a 
non-slotted ebuild."
-                       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."
+                       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-147.0.7703.0.ebuild 
b/www-client/chromium/chromium-147.0.7703.0-r1.ebuild
similarity index 98%
rename from www-client/chromium/chromium-147.0.7703.0.ebuild
rename to www-client/chromium/chromium-147.0.7703.0-r1.ebuild
index 17431a534555..3153418c6c37 100644
--- a/www-client/chromium/chromium-147.0.7703.0.ebuild
+++ b/www-client/chromium/chromium-147.0.7703.0-r1.ebuild
@@ -173,7 +173,7 @@ COMMON_DEPEND="
 "
 RDEPEND="${COMMON_DEPEND}
        !www-client/chromium:0
-       www-client/chromium-common
+       >=www-client/chromium-common-2
        !headless? (
                || (
                        x11-libs/gtk+:3[X?,wayland?]
@@ -1547,7 +1547,7 @@ src_install() {
                export 
CHROME_DESKTOP="chromium-browser${browser_suffix}.desktop"
                export CHROME_EXEC_NAME="chromium-browser${browser_suffix}"
                export CHROME_VERSION_EXTRA="${SLOT}"
-               export 
PROGDIR="/usr/$(get_libdir)/chromium-browser${browser_suffix}"
+               export CHROME_WRAPPER="\$(readlink -f "\$0")"
                export OZONE_AUTO_SESSION=$(ozone_auto_session)
 
                exec /usr/libexec/chromium/chromium-launcher.sh "\$@"
@@ -1704,7 +1704,7 @@ pkg_postinst() {
        fi
 
        # Stable slot doesn't change profile directory, and it's vanishingly 
unlikely that users will downgrade from dev.
-       if [[ ${SLOT} != "stable" && -n "${REPLACING_VERSIONS}" ]]; then
+       if [[ -n "${REPLACING_VERSIONS}" ]]; then
                local replacing_non_slotted=false
                # there could be more than one PVR
                for version in ${REPLACING_VERSIONS}; do
@@ -1715,9 +1715,14 @@ pkg_postinst() {
                done
                if ${replacing_non_slotted}; then
                        ewarn "This version of Chromium has replaced a 
non-slotted ebuild."
-                       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."
+                       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
 }

Reply via email to