Commit de982caa authored by Olivier Tilloy's avatar Olivier Tilloy Committed by Commit Bot

Minor fixes for the snap package:

 - use the correct icon for the desktop file for all channels
 - special case the desktop file name when running as a snap

Change-Id: I9e4d03a96754bd51d798a13d6476210b9f6a8ce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2137328
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758904}
parent c977b051
...@@ -70,6 +70,13 @@ std::string GetChannelSuffixForDataDir() { ...@@ -70,6 +70,13 @@ std::string GetChannelSuffixForDataDir() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
std::string GetDesktopName(base::Environment* env) { std::string GetDesktopName(base::Environment* env) {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Google Chrome packaged as a snap is a special case: the application name
// is always "google-chrome", regardless of the channel (channels are built
// in to snapd, switching between them or doing parallel installs does not
// require distinct application names).
std::string snap_name;
if (env->GetVar("SNAP_NAME", &snap_name) && snap_name == "google-chrome")
return "google-chrome.desktop";
version_info::Channel product_channel(GetChannel()); version_info::Channel product_channel(GetChannel());
switch (product_channel) { switch (product_channel) {
case version_info::Channel::DEV: case version_info::Channel::DEV:
......
...@@ -53,6 +53,14 @@ LAUNCHER_SCRIPT="${TMPFILEDIR}/chrome.launcher" ...@@ -53,6 +53,14 @@ LAUNCHER_SCRIPT="${TMPFILEDIR}/chrome.launcher"
process_template "${SCRIPTDIR}/chrome.launcher.in" "${LAUNCHER_SCRIPT}" process_template "${SCRIPTDIR}/chrome.launcher.in" "${LAUNCHER_SCRIPT}"
chmod +x "${LAUNCHER_SCRIPT}" chmod +x "${LAUNCHER_SCRIPT}"
process_template "${SCRIPTDIR}/snapcraft.yaml.in" "${TMPFILEDIR}/snapcraft.yaml" process_template "${SCRIPTDIR}/snapcraft.yaml.in" "${TMPFILEDIR}/snapcraft.yaml"
if [ "$SNAPNAME" = "google-chrome" ]; then
LOGO="product_logo_256"
if [ "$CHANNEL" = "beta" ]; then
sed -i -e "s:$LOGO.png:$LOGO_beta.png:" "${TMPFILEDIR}/snapcraft.yaml"
elif [ "$CHANNEL" = "unstable" ]; then
sed -i -e "s:$LOGO.png:$LOGO_dev.png:" "${TMPFILEDIR}/snapcraft.yaml"
fi
fi
cd "${TMPFILEDIR}" cd "${TMPFILEDIR}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment