Skip to content

Commit

Permalink
fix(cli,bundler): prefer AppImage libraries with ABI version (#4505)
Browse files Browse the repository at this point in the history
  • Loading branch information
Beanow committed Jun 29, 2022
1 parent 0e6edeb commit bf45ca1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changes/bundler-libnames.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"cli.rs": patch
"cli.js": patch
"tauri-bundler": patch
---

AppImage bundling will now prefer bundling correctly named appincidator library (including `.1` version suffix). With a symlink for compatibility with the old naming.
9 changes: 9 additions & 0 deletions tooling/bundler/src/bundle/linux/templates/appimage
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ fi
if [[ "$TRAY_LIBRARY_PATH" != "0" ]]; then
echo "Copying appindicator library ${TRAY_LIBRARY_PATH}"
cp ${TRAY_LIBRARY_PATH} usr/lib
# It looks like we're practicing good hygiene by adding the ABI version.
# But for compatibility we'll symlink this file to what we did before.
# Specifically this prevents breaking libappindicator-sys v0.7.1 and v0.7.2.
if [[ "$TRAY_LIBRARY_PATH" == *.so.1 ]]; then
readonly soname=$(basename "$TRAY_LIBRARY_PATH")
readonly old_name=$(basename "$TRAY_LIBRARY_PATH" .1)
echo "Adding compatibility symlink ${old_name} -> ${soname}"
ln -s ${soname} usr/lib/${old_name}
fi
fi

# Copy WebKit files.
Expand Down
8 changes: 4 additions & 4 deletions tooling/cli/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ pub fn command(mut options: Options) -> Result<()> {
"TRAY_LIBRARY_PATH",
if tray == "ayatana" {
format!(
"{}/libayatana-appindicator3.so",
"{}/libayatana-appindicator3.so.1",
pkgconfig_utils::get_library_path("ayatana-appindicator3-0.1")
.expect("failed to get ayatana-appindicator library path using pkg-config.")
)
} else {
format!(
"{}/libappindicator3.so",
"{}/libappindicator3.so.1",
pkgconfig_utils::get_library_path("appindicator3-0.1")
.expect("failed to get libappindicator-gtk library path using pkg-config.")
)
Expand Down Expand Up @@ -301,9 +301,9 @@ mod pkgconfig_utils {

pub fn get_appindicator_library_path() -> PathBuf {
match get_library_path("ayatana-appindicator3-0.1") {
Some(p) => format!("{}/libayatana-appindicator3.so", p).into(),
Some(p) => format!("{}/libayatana-appindicator3.so.1", p).into(),
None => match get_library_path("appindicator3-0.1") {
Some(p) => format!("{}/libappindicator3.so", p).into(),
Some(p) => format!("{}/libappindicator3.so.1", p).into(),
None => panic!("Can't detect any appindicator library"),
},
}
Expand Down

0 comments on commit bf45ca1

Please sign in to comment.