From 60fd9485eab3ecbbffe5f9ce06c5b3d9fc79b4ee Mon Sep 17 00:00:00 2001 From: neoapps-dev Date: Fri, 3 Apr 2026 15:14:58 +0300 Subject: [PATCH] fix(appimage): LD_PRELOAD for systems like Gentoo and Debian --- src-tauri/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 0c9434c..868cbaa 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -8,12 +8,11 @@ fn main() { use std::process::{Command, Stdio, exit}; use std::io::{BufReader, BufRead}; use std::thread; - let stage = env::var("EMERALD_LAUNCH_STAGE").unwrap_or_else(|_| "0".to_string()); - if stage == "0" { let mut child = Command::new(env::current_exe().unwrap()) .env("EMERALD_LAUNCH_STAGE", "1") + .env("LD_PRELOAD", "LD_PRELOAD=/usr/lib64/libwayland-client.so.0") //neo: hacky way to fix appimage on systems like gentoo .stdout(Stdio::piped()) .stderr(Stdio::piped()) .spawn() @@ -22,7 +21,6 @@ fn main() { let stdout = child.stdout.take().expect("failed to take stdout"); let stderr = child.stderr.take().expect("failed to take stderr"); let child_id = child.id(); - fn check_line(l: &str) -> bool { let low = l.to_lowercase(); (low.contains("gbm") && low.contains("buffer")) || @@ -76,6 +74,7 @@ fn main() { .env("EMERALD_LAUNCH_STAGE", "2") .env("WEBKIT_DISABLE_DMABUF_RENDERER", "1") .env("WEBKIT_DISABLE_COMPOSITING_MODE", "1") + .env("LD_PRELOAD", "LD_PRELOAD=/usr/lib64/libwayland-client.so.0") //neo: hacky way to fix appimage on systems like gentoo .spawn() .expect("failed to spawn fallback child process");