From 670e7e24fefcdf621ce111be9a4cfd603b740993 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Sat, 11 Jul 2026 17:31:16 +0200 Subject: [PATCH] for linux build --- .claude/settings.local.json | 7 ++++++- .gitignore | 2 ++ src-tauri/Cargo.toml | 6 ++++++ src-tauri/capabilities/desktop.json | 3 +-- src-tauri/src/main.rs | 13 ++++++++++--- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 8d8c128..b868be2 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -104,7 +104,12 @@ "Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.11.5/src/**)", "Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-runtime-wry-2.11.4/src/**)", "Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.11.5/src/window/**)", - "WebSearch" + "WebSearch", + "Bash(node -p \"require\\('./package.json'\\).version\")", + "Bash(bash -n PKGBUILD)", + "Bash(makepkg --printsrcinfo)", + "Bash(npx tauri *)", + "Bash(echo \"---exit code:$?---\")" ] } } diff --git a/.gitignore b/.gitignore index 7cf1ea8..a6ad9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ ~ .codex* target + +*.pkg.tar.zst \ No newline at end of file diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 90e6969..51920cc 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -27,6 +27,12 @@ tauri-build = { version = "2", features = [] } [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-single-instance = "2" + +# Self-updating only makes sense for install methods this app ships itself +# (NSIS on Windows, the .app bundle on macOS). On Linux the app is meant to be +# installed via the system package manager (e.g. the PKGBUILD), which owns +# updates instead — so the updater plugin isn't even compiled in there. +[target.'cfg(not(any(target_os = "android", target_os = "ios", target_os = "linux")))'.dependencies] tauri-plugin-updater = "2" # ── Build profiles ─────────────────────────────────────────────────────────── diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json index ba6d080..13e22d5 100644 --- a/src-tauri/capabilities/desktop.json +++ b/src-tauri/capabilities/desktop.json @@ -2,8 +2,7 @@ "identifier": "desktop-capability", "platforms": [ "macOS", - "windows", - "linux" + "windows" ], "windows": [ "main" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9b3fbc6..aae06c9 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -42,14 +42,13 @@ fn close_splashscreen(app: tauri::AppHandle) -> Result<(), String> { #[tokio::main] async fn main() { - tauri::Builder::default() + let builder = tauri::Builder::default() .plugin(tauri_plugin_single_instance::init(|app, _, _| { #[cfg(desktop)] let _ = app.get_webview_window("main") .expect("no main window") .set_focus(); })) - .plugin(tauri_plugin_updater::Builder::new().build()) .plugin( tauri_plugin_aptabase::Builder::new("A-SH-1344793789") .with_options(tauri_plugin_aptabase::InitOptions { @@ -60,7 +59,15 @@ async fn main() { ) .manage(SearchCancellationState::default()) .manage(commit_ai::CommitAiEngine::new()) - .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_dialog::init()); + + // Linux installs are expected to come from the system package manager (see the + // PKGBUILD), which owns updates itself — the self-updater is only wired up for + // the platforms whose install method this app ships (NSIS/Windows, .app/macOS). + #[cfg(not(target_os = "linux"))] + let builder = builder.plugin(tauri_plugin_updater::Builder::new().build()); + + builder .invoke_handler(tauri::generate_handler![ open_repository, clone_repository,