Skip to content

Commit 66ba5ce

Browse files
authored
fix branding on linux (#20)
* patches/branding: change default user dir location * package: clear tarball_dir before (re)packaging * package: name icon "helium" instead of "chromium" * package: ship 256x256 icon instead of 48x48 * patches/helium: additional chromium -> helium renames
2 parents f7e6eda + 473ec47 commit 66ba5ce

File tree

4 files changed

+143
-5
lines changed

4 files changed

+143
-5
lines changed

package/helium.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Comment=Access the Internet
66
Exec=chromium %U
77
StartupNotify=true
88
Terminal=false
9-
Icon=chromium
9+
Icon=helium
1010
Type=Application
1111
Categories=Network;WebBrowser;
1212
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
--- a/chrome/BUILD.gn
2+
+++ b/chrome/BUILD.gn
3+
@@ -1792,7 +1792,7 @@ if (is_linux || is_chromeos) {
4+
]
5+
if (is_linux) {
6+
sources += [
7+
- "//chrome/app/theme/$branding_path_component/linux/product_logo_48.png",
8+
+ "//chrome/app/theme/$branding_path_component/linux/product_logo_256.png",
9+
]
10+
} else {
11+
sources +=
12+
--- a/chrome/common/channel_info_posix.cc
13+
+++ b/chrome/common/channel_info_posix.cc
14+
@@ -81,18 +81,13 @@ std::string GetChannelName(WithExtendedS
15+
}
16+
17+
std::string GetChannelSuffixForDataDir() {
18+
- switch (GetChannel()) {
19+
- case version_info::Channel::BETA:
20+
- return "-beta";
21+
- case version_info::Channel::DEV:
22+
- return "-unstable";
23+
- case version_info::Channel::CANARY:
24+
- return "-canary";
25+
- default:
26+
+#if !defined(OFFICIAL_BUILD)
27+
+ return ".dev";
28+
+#else
29+
// Stable, extended stable, and unknown (e.g. in unbranded builds) don't
30+
// get a suffix.
31+
return std::string();
32+
- }
33+
+#endif
34+
}
35+
36+
#if BUILDFLAG(IS_LINUX)
37+
@@ -148,11 +143,11 @@ std::string GetDesktopName(base::Environ
38+
// Allow $CHROME_DESKTOP to override the built-in value, so that development
39+
// versions can set themselves as the default without interfering with
40+
// non-official, packaged versions using the built-in value.
41+
- std::optional<std::string> name = env->GetVar("CHROME_DESKTOP");
42+
+ std::optional<std::string> name = env->GetVar("HELIUM_DESKTOP");
43+
if (name.has_value() && !name.value().empty()) {
44+
return name.value();
45+
}
46+
- return "chromium-browser.desktop";
47+
+ return "helium.desktop";
48+
#endif
49+
}
50+
#endif // BUILDFLAG(IS_LINUX)
51+
--- a/chrome/common/chrome_paths_linux.cc
52+
+++ b/chrome/common/chrome_paths_linux.cc
53+
@@ -81,7 +81,7 @@ bool GetDefaultUserDataDirectory(base::F
54+
std::unique_ptr<base::Environment> env(base::Environment::Create());
55+
base::FilePath config_dir;
56+
std::optional<std::string> chrome_config_home_str =
57+
- env->GetVar("CHROME_CONFIG_HOME");
58+
+ env->GetVar("HELIUM_CONFIG_HOME");
59+
if (chrome_config_home_str.has_value() &&
60+
base::IsStringUTF8(chrome_config_home_str.value())) {
61+
config_dir = base::FilePath::FromUTF8Unsafe(chrome_config_home_str.value());
62+
@@ -90,13 +90,7 @@ bool GetDefaultUserDataDirectory(base::F
63+
GetXDGDirectory(env.get(), kXdgConfigHomeEnvVar, kDotConfigDir);
64+
}
65+
66+
-#if BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
67+
- std::string data_dir_basename = "google-chrome-for-testing";
68+
-#elif BUILDFLAG(GOOGLE_CHROME_BRANDING)
69+
- std::string data_dir_basename = "google-chrome";
70+
-#else
71+
- std::string data_dir_basename = "chromium";
72+
-#endif
73+
+ std::string data_dir_basename = "net.imput.helium";
74+
*result = config_dir.Append(data_dir_basename + GetChannelSuffixForDataDir());
75+
return true;
76+
}
77+
--- a/chrome/installer/linux/common/chromium-browser.info
78+
+++ b/chrome/installer/linux/common/chromium-browser.info
79+
@@ -6,7 +6,7 @@
80+
# chromium-browser packages for various platforms.
81+
82+
# Base name of the package.
83+
-PACKAGE="chromium-browser"
84+
+PACKAGE="helium"
85+
86+
# Filename of the main executable (for generating launcher scripts, etc.)
87+
PROGNAME=chrome
88+
@@ -18,7 +18,7 @@ INSTALLDIR=/opt/chromium.org/chromium
89+
ENROLLMENTDIR=/etc/chromium/policies/enrollment
90+
91+
# Display string for desktop menu/icon.
92+
-MENUNAME="Chromium Web Browser"
93+
+MENUNAME="Helium"
94+
95+
# Brief package description.
96+
SHORTDESC="The web browser from the Chromium projects"
97+
@@ -27,16 +27,16 @@ SHORTDESC="The web browser from the Chro
98+
FULLDESC="Chromium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier."
99+
100+
# Package maintainer information.
101+
-MAINTNAME="Chromium Linux Team"
102+
-MAINTMAIL="chromium-packagers@chromium.org"
103+
-PRODUCTURL="https://www.chromium.org/Home"
104+
+MAINTNAME="imput"
105+
+MAINTMAIL="helium@imput.net"
106+
+PRODUCTURL="https://helium.computer"
107+
108+
-PROJECT_LICENSE="BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)"
109+
+PROJECT_LICENSE="GPL-3.0 and BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)"
110+
111+
-DEVELOPER_NAME="The Chromium Authors"
112+
+DEVELOPER_NAME="The Helium Authors"
113+
114+
-BUGTRACKERURL="https://www.chromium.org/for-testers/bug-reporting-guidelines"
115+
+BUGTRACKERURL="https://github.com/imputnet/helium-linux/issues"
116+
117+
-HELPURL="https://chromium.googlesource.com/chromium/src/+/main/docs/linux/debugging.md"
118+
+HELPURL="https://helium.computer/"
119+
120+
-RDN="org.chromium.Chromium"
121+
+RDN="net.imput.helium"
122+
--- a/media/audio/pulse/pulse_util.cc
123+
+++ b/media/audio/pulse/pulse_util.cc
124+
@@ -44,8 +44,8 @@ namespace {
125+
constexpr char kBrowserDisplayName[] = "google-chrome";
126+
#define PRODUCT_STRING "Google Chrome"
127+
#else
128+
-constexpr char kBrowserDisplayName[] = "chromium-browser";
129+
-#define PRODUCT_STRING "Chromium"
130+
+constexpr char kBrowserDisplayName[] = "helium";
131+
+#define PRODUCT_STRING "Helium"
132+
#endif
133+
134+
#if defined(DLOPEN_PULSEAUDIO)

patches/series

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ungoogled-chromium/portablelinux/drop-nodejs-version-check.patch
22
ungoogled-chromium/portablelinux/use-oauth2-client-switches-as-default.patch
33
ungoogled-chromium/portablelinux/fix-compiling-on-arm64.patch
4+
5+
helium/linux/change-chromium-branding.patch

scripts/package.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ libqt6_shim.so
4242
libvk_swiftshader.so
4343
libvulkan.so.1
4444
locales/
45-
product_logo_48.png
45+
product_logo_256.png
4646
resources.pak
4747
v8_context_snapshot.bin
4848
vk_swiftshader_icd.json
@@ -51,6 +51,7 @@ xdg-settings"
5151

5252
echo "copying release files and creating $_tarball_name.tar.xz"
5353

54+
rm -rf "$_tarball_dir"
5455
mkdir -p "$_tarball_dir"
5556

5657
for file in $_files; do
@@ -68,7 +69,7 @@ tar vcf - "$_tarball_name" \
6869

6970
# create AppImage
7071
rm -rf "$_app_dir"
71-
mkdir -p "$_app_dir/opt/helium/" "$_app_dir/usr/share/icons/hicolor/48x48/apps/"
72+
mkdir -p "$_app_dir/opt/helium/" "$_app_dir/usr/share/icons/hicolor/256x256/apps/"
7273
cp -r "$_tarball_dir"/* "$_app_dir/opt/helium/"
7374
cp "$_root_dir/package/helium.desktop" "$_app_dir"
7475
sed -i -e 's|Exec=chromium|Exec=AppRun|g' "$_app_dir/helium.desktop"
@@ -83,8 +84,9 @@ export CHROME_WRAPPER="${THIS}"
8384
EOF
8485
chmod a+x "$_app_dir/AppRun"
8586

86-
cp "${_app_dir}/opt/helium/product_logo_48.png" "$_app_dir/usr/share/icons/hicolor/48x48/apps/chromium.png"
87-
cp "${_app_dir}/usr/share/icons/hicolor/48x48/apps/chromium.png" "$_app_dir"
87+
for out in "$_app_dir/helium.png" "${_app_dir}/usr/share/icons/hicolor/256x256/apps/helium.png"; do
88+
cp "${_app_dir}/opt/helium/product_logo_256.png" "$out"
89+
done
8890

8991
export APPIMAGETOOL_APP_NAME="Helium"
9092
export VERSION="$_version"

0 commit comments

Comments
 (0)