Skip to content

Commit bf45ca1

Browse files
authored
fix(cli,bundler): prefer AppImage libraries with ABI version (#4505)
1 parent 0e6edeb commit bf45ca1

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.changes/bundler-libnames.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
"tauri-bundler": patch
5+
---
6+
7+
AppImage bundling will now prefer bundling correctly named appincidator library (including `.1` version suffix). With a symlink for compatibility with the old naming.

tooling/bundler/src/bundle/linux/templates/appimage

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ fi
3737
if [[ "$TRAY_LIBRARY_PATH" != "0" ]]; then
3838
echo "Copying appindicator library ${TRAY_LIBRARY_PATH}"
3939
cp ${TRAY_LIBRARY_PATH} usr/lib
40+
# It looks like we're practicing good hygiene by adding the ABI version.
41+
# But for compatibility we'll symlink this file to what we did before.
42+
# Specifically this prevents breaking libappindicator-sys v0.7.1 and v0.7.2.
43+
if [[ "$TRAY_LIBRARY_PATH" == *.so.1 ]]; then
44+
readonly soname=$(basename "$TRAY_LIBRARY_PATH")
45+
readonly old_name=$(basename "$TRAY_LIBRARY_PATH" .1)
46+
echo "Adding compatibility symlink ${old_name} -> ${soname}"
47+
ln -s ${soname} usr/lib/${old_name}
48+
fi
4049
fi
4150

4251
# Copy WebKit files.

tooling/cli/src/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ pub fn command(mut options: Options) -> Result<()> {
229229
"TRAY_LIBRARY_PATH",
230230
if tray == "ayatana" {
231231
format!(
232-
"{}/libayatana-appindicator3.so",
232+
"{}/libayatana-appindicator3.so.1",
233233
pkgconfig_utils::get_library_path("ayatana-appindicator3-0.1")
234234
.expect("failed to get ayatana-appindicator library path using pkg-config.")
235235
)
236236
} else {
237237
format!(
238-
"{}/libappindicator3.so",
238+
"{}/libappindicator3.so.1",
239239
pkgconfig_utils::get_library_path("appindicator3-0.1")
240240
.expect("failed to get libappindicator-gtk library path using pkg-config.")
241241
)
@@ -301,9 +301,9 @@ mod pkgconfig_utils {
301301

302302
pub fn get_appindicator_library_path() -> PathBuf {
303303
match get_library_path("ayatana-appindicator3-0.1") {
304-
Some(p) => format!("{}/libayatana-appindicator3.so", p).into(),
304+
Some(p) => format!("{}/libayatana-appindicator3.so.1", p).into(),
305305
None => match get_library_path("appindicator3-0.1") {
306-
Some(p) => format!("{}/libappindicator3.so", p).into(),
306+
Some(p) => format!("{}/libappindicator3.so.1", p).into(),
307307
None => panic!("Can't detect any appindicator library"),
308308
},
309309
}

0 commit comments

Comments
 (0)