Skip to content

Commit 8b465a1

Browse files
authored
fix(bundler/linux): pull latest appimage plugin (#13913)
1 parent ee68c91 commit 8b465a1

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.changes/appimage-plugin.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
tauri-bundler: "patch:enhance"
3+
tauri-cli: "patch:enhance"
4+
"@tauri-apps/cli": "patch:enhance"
5+
---
6+
7+
The bundler now pulls the latest AppImage linuxdeploy plugin instead of using the built-in one. This should remove the libfuse requirement.

crates/tauri-bundler/src/bundle/linux/appimage.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
5252

5353
fs::create_dir_all(&tools_path)?;
5454

55-
let linuxdeploy_path = prepare_tools(&tools_path, tools_arch)?;
55+
let linuxdeploy_path = prepare_tools(
56+
&tools_path,
57+
tools_arch,
58+
settings.log_level() != log::Level::Error,
59+
)?;
5660

5761
let package_dir = settings.project_out_directory().join("bundle/appimage_deb");
5862

@@ -217,7 +221,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
217221
}
218222

219223
// returns the linuxdeploy path to keep linuxdeploy_arch contained
220-
fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
224+
fn prepare_tools(tools_path: &Path, arch: &str, verbose: bool) -> crate::Result<PathBuf> {
221225
let apprun = tools_path.join(format!("AppRun-{arch}"));
222226
if !apprun.exists() {
223227
let data = download(&format!(
@@ -245,6 +249,21 @@ fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
245249
write_and_make_executable(&gstreamer, data)?;
246250
}
247251

252+
let appimage = tools_path.join("linuxdeploy-plugin-appimage.AppImage");
253+
if !appimage.exists() {
254+
// This is optional, linuxdeploy will fall back to its built-in version if the download failed.
255+
let data = download(&format!("https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-{arch}.AppImage"));
256+
match data {
257+
Ok(data) => write_and_make_executable(&appimage, data)?,
258+
Err(err) => {
259+
log::error!("Download of AppImage plugin failed. Using older built-in version instead.");
260+
if verbose {
261+
log::debug!("{err:?}");
262+
}
263+
}
264+
}
265+
}
266+
248267
// This should prevent linuxdeploy to be detected by appimage integration tools
249268
let _ = Command::new("dd")
250269
.args([

0 commit comments

Comments
 (0)