Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

feat: Linux app (deb + rpm) with Kokon's own CUDA and Vulkan engine builds

Gabriele Lozupone9d8ed7f252c9
diff --git a/crates/qls-core/src/catalog.rs b/crates/qls-core/src/catalog.rs
index 792b504..28e656d 100644
--- a/crates/qls-core/src/catalog.rs
+++ b/crates/qls-core/src/catalog.rs
@@ -120,6 +120,7 @@ const SDCPP_RELEASE: &str = "https://github.com/leejet/stable-diffusion.cpp/rele
/// MoSR upscaler merged (PR #2128, commit 792bcd3), plus automatic flash-attention and
/// direct/implicit-GEMM convolution selection. CUDA 12 build; it runs on RTX 20xx to RTX 50xx.
/// Sizes and SHA-256 from GitHub's asset digests.
+#[cfg(not(target_os = "linux"))]
pub const ENGINE_CUDA: Download = Download {
id: "engine_cuda",
label: "stable-diffusion.cpp (CUDA 12)",
@@ -135,6 +136,7 @@ pub const ENGINE_CUDA: Download = Download {
};
/// CUDA 12.8.1, unchanged since the upstream release: no marker, never downloaded again.
+#[cfg(not(target_os = "linux"))]
pub const CUDA_RUNTIME: Download = Download {
id: "cuda_runtime",
label: "CUDA 12 runtime (cuBLAS)",
@@ -152,6 +154,7 @@ pub const CUDA_RUNTIME: Download = Download {
/// Same commit, Vulkan build: AMD, Intel and NVIDIA cards through the GPU driver's Vulkan
/// runtime (nothing else to install). Kept in its own folder so it can sit next to the
/// CUDA build.
+#[cfg(not(target_os = "linux"))]
pub const ENGINE_VULKAN: Download = Download {
id: "engine_vulkan",
label: "stable-diffusion.cpp (Vulkan)",
@@ -166,6 +169,74 @@ pub const ENGINE_VULKAN: Download = Download {
engine_tag: Some(ENGINE_TAG),
};
+/// Linux builds of the same commit, made by Kokon: upstream's Linux zips need glibc 2.38 (no
+/// Ubuntu 22.04 / Debian 12) and have no CUDA variant. Built on Ubuntu 22.04 with upstream's flags
+/// and CUDA architectures by `.github/workflows/kokon-linux.yml` on the kokon-linux branch of
+/// Kokon's stable-diffusion.cpp fork, smoke-tested on Ubuntu 22.04/24.04, Debian 12, Fedora 40/42.
+/// The libraries find each other and the CUDA runtime next to them (RPATH `$ORIGIN`).
+#[cfg(target_os = "linux")]
+const KOKON_LINUX_RELEASE: &str = "https://github.com/GabrieleLozupone/stable-diffusion.cpp/releases/tag/kokon-linux-1d0a58a";
+
+#[cfg(target_os = "linux")]
+pub const ENGINE_CUDA: Download = Download {
+ id: "engine_cuda",
+ label: "stable-diffusion.cpp (CUDA 12)",
+ kind: FileKind::Engine,
+ url: "https://github.com/GabrieleLozupone/stable-diffusion.cpp/releases/download/kokon-linux-1d0a58a/sd-master-1d0a58a-bin-Linux-Ubuntu-22.04-x86_64-cuda12.zip",
+ fallback_urls: &[],
+ page: KOKON_LINUX_RELEASE,
+ size: LINUX_CUDA_SIZE,
+ sha256: LINUX_CUDA_SHA256,
+ dest: "sd-master-1d0a58a-bin-Linux-Ubuntu-22.04-x86_64-cuda12.zip",
+ provides: &["sd-server", "libstable-diffusion.so", "libggml-cuda.so"],
+ engine_tag: Some(ENGINE_TAG),
+};
+
+/// CUDA 12.8 runtime libraries (NVIDIA redistributables), next to the CUDA engine.
+#[cfg(target_os = "linux")]
+pub const CUDA_RUNTIME: Download = Download {
+ id: "cuda_runtime",
+ label: "CUDA 12 runtime (cuBLAS)",
+ kind: FileKind::Engine,
+ url: "https://github.com/GabrieleLozupone/stable-diffusion.cpp/releases/download/kokon-linux-1d0a58a/cudart-sd-bin-linux-cu12-x64.zip",
+ fallback_urls: &[],
+ page: KOKON_LINUX_RELEASE,
+ size: LINUX_CUDART_SIZE,
+ sha256: LINUX_CUDART_SHA256,
+ dest: "cudart-sd-bin-linux-cu12-x64.zip",
+ provides: &["libcudart.so.12", "libcublas.so.12", "libcublasLt.so.12"],
+ engine_tag: None,
+};
+
+#[cfg(target_os = "linux")]
+pub const ENGINE_VULKAN: Download = Download {
+ id: "engine_vulkan",
+ label: "stable-diffusion.cpp (Vulkan)",
+ kind: FileKind::Engine,
+ url: "https://github.com/GabrieleLozupone/stable-diffusion.cpp/releases/download/kokon-linux-1d0a58a/sd-master-1d0a58a-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
+ fallback_urls: &[],
+ page: KOKON_LINUX_RELEASE,
+ size: LINUX_VULKAN_SIZE,
+ sha256: LINUX_VULKAN_SHA256,
+ dest: "engine-vulkan/sd-master-1d0a58a-bin-Linux-Ubuntu-22.04-x86_64-vulkan.zip",
+ provides: &["engine-vulkan/sd-server", "engine-vulkan/libstable-diffusion.so", "engine-vulkan/libggml-vulkan.so"],
+ engine_tag: Some(ENGINE_TAG),
+};
+
+// FILL FROM THE kokon-linux-1d0a58a RELEASE (SHA256SUMS.txt).
+#[cfg(target_os = "linux")]
+const LINUX_CUDA_SIZE: u64 = 0;
+#[cfg(target_os = "linux")]
+const LINUX_CUDA_SHA256: &str = "";
+#[cfg(target_os = "linux")]
+const LINUX_CUDART_SIZE: u64 = 0;
+#[cfg(target_os = "linux")]
+const LINUX_CUDART_SHA256: &str = "";
+#[cfg(target_os = "linux")]
+const LINUX_VULKAN_SIZE: u64 = 0;
+#[cfg(target_os = "linux")]
+const LINUX_VULKAN_SHA256: &str = "";
+
/// Same commit, macOS build: universal binary with the Metal shaders embedded, needs
/// macOS 26. Ad-hoc signed; downloaded by the app (not a browser) it gets no quarantine flag.
pub const ENGINE_METAL: Download = Download {
@@ -248,6 +319,10 @@ fn version_tuple(v: &str) -> Option<(u32, u32, u32)> {
/// the built-in pins (an app update that pins a newer engine is never downgraded by an old
/// manifest). Returns whether it is now in use.
pub fn apply_engine_release(m: &EngineManifest, app_version: &str) -> Result<bool, String> {
+ // The manifest lists upstream's Windows and Mac builds; Linux keeps Kokon's own pinned build.
+ if cfg!(target_os = "linux") {
+ return Ok(false);
+ }
let (Some(n), Some(builtin)) = (release_number(&m.tag), release_number(ENGINE_TAG)) else {
return Err(format!("not an upstream release tag: {}", m.tag));
};
@@ -668,7 +743,8 @@ mod tests {
// Every engine build is marked with this release; the unchanged CUDA runtime is not.
for d in [ENGINE_CUDA, ENGINE_VULKAN, ENGINE_METAL] {
assert_eq!(d.engine_tag, Some(ENGINE_TAG), "{}", d.id);
- assert!(d.url.contains(&format!("/{ENGINE_TAG}/")), "{}", d.id);
+ let commit = ENGINE_TAG.rsplit('-').next().unwrap();
+ assert!(d.url.contains(&format!("-{commit}")), "{}", d.id);
}
assert_eq!(CUDA_RUNTIME.engine_tag, None);
// sd-server finds the upscaler by file stem in the upscalers folder.
@@ -702,6 +778,7 @@ mod tests {
}
#[test]
+ #[cfg(not(target_os = "linux"))]
fn engine_manifest_overrides_only_newer_releases() {
let _guard = ENGINE_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
assert_eq!(release_number(ENGINE_TAG), Some(964));
@@ -837,8 +914,8 @@ mod tests {
let mut cfg = crate::config::AppConfig::default();
cfg.sdcpp_dir = dir.path().to_path_buf();
cfg.gpu_backend = GpuBackend::Vulkan;
- if cfg!(windows) {
- // The Vulkan build is a Windows download (sd-server.exe).
+ if !cfg!(target_os = "macos") {
+ // The Vulkan build is a Windows or Linux download (no Mac one).
assert_eq!(cfg.server_exe(), join_rel(dir.path(), ENGINE_VULKAN.provides[0]), "installer and launcher agree on the path");
}
cfg.gpu_backend = GpuBackend::Metal;
diff --git a/crates/qls-core/src/diagnostics.rs b/crates/qls-core/src/diagnostics.rs
index cd0bff2..bad53e9 100644
--- a/crates/qls-core/src/diagnostics.rs
+++ b/crates/qls-core/src/diagnostics.rs
@@ -38,9 +38,10 @@ impl GpuInfo {
}
/// The GPUs to plan for: NVIDIA through nvidia-smi (live memory use), otherwise any
-/// graphics card Windows knows (AMD, Intel), or the Apple Silicon GPU. None if there is none.
+/// graphics card Windows knows (AMD, Intel), an AMD card on Linux, or the Apple Silicon GPU.
+/// None if there is none.
pub fn query_gpus() -> Option<Vec<GpuInfo>> {
- query_nvidia().or_else(query_dxgi).or_else(query_apple)
+ query_nvidia().or_else(query_dxgi).or_else(query_drm).or_else(query_apple)
}
/// Card and engine device names refer to the same GPU ("NVIDIA GeForce RTX 3090" from
@@ -179,6 +180,69 @@ fn query_dxgi() -> Option<Vec<GpuInfo>> {
None
}
+/// Linux graphics cards other than NVIDIA's (which nvidia-smi covers): the cards in
+/// /sys/class/drm whose driver reports its VRAM (amdgpu does), largest first.
+#[cfg(target_os = "linux")]
+fn query_drm() -> Option<Vec<GpuInfo>> {
+ let read = |p: &Path| std::fs::read_to_string(p).ok().map(|s| s.trim().to_string());
+ let hex = |s: Option<String>| s.and_then(|s| u32::from_str_radix(s.trim_start_matches("0x"), 16).ok());
+ let mut gpus = Vec::new();
+ for entry in std::fs::read_dir("/sys/class/drm").ok()?.flatten() {
+ let name = entry.file_name().to_string_lossy().into_owned();
+ // card0, card1…; not the connectors (card0-DP-1).
+ if !name.strip_prefix("card").is_some_and(|n| !n.is_empty() && n.bytes().all(|b| b.is_ascii_digit())) {
+ continue;
+ }
+ let dev = entry.path().join("device");
+ let (Some(vendor), Some(device)) = (hex(read(&dev.join("vendor"))), hex(read(&dev.join("device")))) else { continue };
+ let Some(total) = read(&dev.join("mem_info_vram_total")).and_then(|s| s.parse::<u64>().ok()) else { continue };
+ let used = read(&dev.join("mem_info_vram_used")).and_then(|s| s.parse::<u64>().ok()).unwrap_or(0);
+ let (total, used) = (total / (1024 * 1024), used / (1024 * 1024));
+ gpus.push(GpuInfo {
+ name: pci_name(vendor, device).unwrap_or_else(|| format!("{} GPU {vendor:04x}:{device:04x}", vendor_name(vendor).to_ascii_uppercase())),
+ vendor: vendor_name(vendor).into(),
+ unified: false,
+ memory_total_mib: total,
+ memory_used_mib: used,
+ memory_free_mib: total.saturating_sub(used),
+ driver_version: String::new(),
+ });
+ }
+ gpus.sort_by(|a, b| b.memory_total_mib.cmp(&a.memory_total_mib));
+ (!gpus.is_empty()).then_some(gpus)
+}
+
+#[cfg(not(target_os = "linux"))]
+fn query_drm() -> Option<Vec<GpuInfo>> {
+ None
+}
+
+/// Marketing name of a PCI device from the system's pci.ids, as the engine's Vulkan device
+/// names it: "Navi 44 [Radeon RX 9060 XT]" → "AMD Radeon RX 9060 XT".
+#[cfg(target_os = "linux")]
+fn pci_name(vendor: u32, device: u32) -> Option<String> {
+ let ids = ["/usr/share/hwdata/pci.ids", "/usr/share/misc/pci.ids", "/usr/share/pci.ids"].iter().find_map(|p| std::fs::read_to_string(p).ok())?;
+ parse_pci_name(&ids, vendor, device)
+}
+
+pub fn parse_pci_name(ids: &str, vendor: u32, device: u32) -> Option<String> {
+ let (v, d) = (format!("{vendor:04x} "), format!("\t{device:04x} "));
+ let mut lines = ids.lines().skip_while(|l| !l.starts_with(&v)).skip(1).take_while(|l| l.starts_with('\t'));
+ let desc = lines.find_map(|l| l.strip_prefix(&d))?.trim();
+ let model = match (desc.rfind('['), desc.ends_with(']')) {
+ (Some(i), true) => &desc[i + 1..desc.len() - 1],
+ _ => desc,
+ };
+ // A bracket may list several models ("Radeon RX 7900 XT/7900 XTX"): keep the first.
+ let model = model.split('/').next().unwrap_or(model).trim();
+ let brand = match vendor_name(vendor) {
+ "amd" => "AMD",
+ "intel" => "Intel",
+ _ => "",
+ };
+ Some(if brand.is_empty() || model.starts_with(brand) { model.to_string() } else { format!("{brand} {model}") })
+}
+
#[derive(Debug, Clone, Serialize)]
pub struct Check {
pub id: &'static str,
@@ -354,6 +418,16 @@ mod tests {
}
}
+ #[test]
+ fn pci_names_match_the_engine_device_names() {
+ let ids = "1002 Advanced Micro Devices, Inc. [AMD/ATI]\n\t744c Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M]\n\t7590 Navi 44 [Radeon RX 9060 XT]\n\t1234 Some Device\n10de NVIDIA Corporation\n\t7590 Not this one\n";
+ assert_eq!(parse_pci_name(ids, 0x1002, 0x7590).as_deref(), Some("AMD Radeon RX 9060 XT"));
+ assert_eq!(parse_pci_name(ids, 0x1002, 0x744c).as_deref(), Some("AMD Radeon RX 7900 XT"));
+ assert_eq!(parse_pci_name(ids, 0x1002, 0x1234).as_deref(), Some("AMD Some Device"));
+ assert_eq!(parse_pci_name(ids, 0x1002, 0x9999), None);
+ assert!(same_gpu("AMD Radeon RX 9060 XT", "AMD Radeon RX 9060 XT (RADV GFX1200)"));
+ }
+
#[test]
fn checks_flag_missing_files() {
let mut cfg = AppConfig::default();
diff --git a/crates/qls-core/src/installer.rs b/crates/qls-core/src/installer.rs
index 70bb486..f111343 100644
--- a/crates/qls-core/src/installer.rs
+++ b/crates/qls-core/src/installer.rs
@@ -679,14 +679,16 @@ pub fn space_needed(dir: &Path, downloads: &[Download]) -> (u64, u64) {
}
/// Folder of the model files shipped inside the app (Tauri resources): next to the
-/// executables on Windows, `Contents/Resources` on a Mac. `QLS_BUNDLE_DIR` overrides it.
+/// executables on Windows, `Contents/Resources` on a Mac, `/usr/lib/Kokon` for the Linux
+/// packages (executables in `/usr/bin`). `QLS_BUNDLE_DIR` overrides it.
pub fn bundle_dir() -> Option<PathBuf> {
if let Ok(p) = std::env::var("QLS_BUNDLE_DIR") {
return Some(PathBuf::from(p));
}
let exe = std::env::current_exe().ok()?;
let dir = exe.parent()?;
- [dir.join("bundled"), dir.join("..").join("Resources").join("bundled")].into_iter().find(|p| p.is_dir())
+ let lib = dir.join("..").join("lib");
+ [dir.join("bundled"), dir.join("..").join("Resources").join("bundled"), lib.join("Kokon").join("bundled"), lib.join("kokon").join("bundled")].into_iter().find(|p| p.is_dir())
}
/// Copies `d` from the app's bundle into the stable-diffusion.cpp folder when it is missing
diff --git a/mcp/scripts/build-exe.mjs b/mcp/scripts/build-exe.mjs
index 35c2b6a..fb7408c 100644
--- a/mcp/scripts/build-exe.mjs
+++ b/mcp/scripts/build-exe.mjs
@@ -17,7 +17,8 @@ fs.writeFileSync(
);
run(process.execPath, ["--experimental-sea-config", "build/sea-config.json"]);
const mac = process.platform === "darwin";
-const exe = path.join(build, mac ? "kokon-mcp" : "kokon-mcp.exe");
+const win = process.platform === "win32";
+const exe = path.join(build, win ? "kokon-mcp.exe" : "kokon-mcp");
fs.copyFileSync(process.execPath, exe);
fs.chmodSync(exe, 0o755);
const fuse = ["--sentinel-fuse", "NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2"];
@@ -30,7 +31,7 @@ if (mac) {
run("npx", ["postject", exe, "NODE_SEA_BLOB", path.join(build, "sea-prep.blob"), ...fuse]);
}
-const triple = mac ? "aarch64-apple-darwin" : "x86_64-pc-windows-msvc";
-const sidecar = path.resolve(root, "..", "src-tauri", "binaries", `kokon-mcp-${triple}${mac ? "" : ".exe"}`);
+const triple = mac ? "aarch64-apple-darwin" : win ? "x86_64-pc-windows-msvc" : "x86_64-unknown-linux-gnu";
+const sidecar = path.resolve(root, "..", "src-tauri", "binaries", `kokon-mcp-${triple}${win ? ".exe" : ""}`);
fs.copyFileSync(exe, sidecar);
console.log(`built ${exe} (${(fs.statSync(exe).size / 1e6).toFixed(1)} MB) -> ${sidecar}`);
diff --git a/scripts/build-release-linux.sh b/scripts/build-release-linux.sh
new file mode 100644
index 0000000..6858a1d
--- /dev/null
+++ b/scripts/build-release-linux.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+# Builds the Linux release on Ubuntu 22.04 (a WSL distro works): kokon-service, kokon-mcp and the
+# Kokon packages ("Kokon_<version>_amd64.deb", "Kokon-<version>-1.x86_64.rpm"), copied to
+# dist-release/ with their updater entries.
+#
+# bash scripts/build-release-linux.sh --setup # once: system packages, Rust, Node 22
+# bash scripts/build-release-linux.sh
+#
+# Ubuntu 22.04 on purpose: binaries built there (glibc 2.35) also run on Debian 12, Ubuntu 24.04
+# and Fedora; the engine is built the same way (stable-diffusion.cpp fork, kokon-linux branch).
+# Run it from a clone on the Linux file system, never from /mnt/c: npm would replace the
+# Windows node_modules with Linux binaries, and builds there are very slow.
+set -euo pipefail
+cd "$(dirname "$0")/.."
+TRIPLE=x86_64-unknown-linux-gnu
+
+case "$(pwd)" in /mnt/*) echo "✗ Run this from a clone on the Linux file system (e.g. git clone /mnt/c/AI/qwen-local-studio ~/kokon), not $(pwd)."; exit 1 ;; esac
+
+if [ "${1:-}" = "--setup" ]; then
+ sudo apt-get update
+ sudo apt-get install -y build-essential curl wget file pkg-config libssl-dev libgtk-3-dev \
+ libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev patchelf
+ command -v cargo >/dev/null || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ if ! node --version 2>/dev/null | grep -q '^v2[2-9]'; then
+ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
+ sudo apt-get install -y nodejs
+ fi
+ echo "✓ Ready. Open a new shell (for cargo) and run: bash scripts/build-release-linux.sh"
+ exit 0
+fi
+
+. "$HOME/.cargo/env" 2>/dev/null || true
+for c in cargo node npm pkg-config; do command -v "$c" >/dev/null || { echo "✗ $c not found: run with --setup first."; exit 1; }; done
+pkg-config --exists webkit2gtk-4.1 || { echo "✗ webkit2gtk-4.1 not found: run with --setup first."; exit 1; }
+
+echo "1/5 Packages"
+npm ci --no-audit --no-fund
+(cd mcp && npm ci --no-audit --no-fund)
+
+echo "2/5 Tests (Rust core + frontend)"
+cargo test -p qls-core --release --quiet
+# The MCP protocol test runs the newest target/*/kokon-service: build this version's first.
+cargo build -p qls-service --release
+npx vitest run
+
+echo "3/5 kokon-service (release)"
+mkdir -p src-tauri/binaries
+cp target/release/kokon-service "src-tauri/binaries/kokon-service-$TRIPLE"
+
+echo "4/5 kokon-mcp + MCP tests (they drive the bundle and the service built above)"
+(cd mcp && npm run build:exe && npx vitest run)
+
+echo "5/5 Kokon packages (signed for the in-app updater)"
+# Updates are verified against the public key in tauri.conf.json: same key as Windows and Mac.
+if [ -z "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then
+ KEY="$HOME/.tauri/kokon-updater.key"
+ [ -f "$KEY" ] || KEY="$(ls /mnt/c/Users/*/.tauri/kokon-updater.key 2>/dev/null | head -1)"
+ [ -f "$KEY" ] || { echo "✗ Updater signing key not found (~/.tauri/kokon-updater.key; see docs/releasing.md)"; exit 1; }
+ export TAURI_SIGNING_PRIVATE_KEY="$KEY"
+fi
+npx tauri build --target "$TRIPLE"
+
+BUNDLE="target/$TRIPLE/release/bundle"
+DEB="$(ls -t "$BUNDLE"/deb/*.deb | head -1)"
+RPM="$(ls -t "$BUNDLE"/rpm/*.rpm | head -1)"
+mkdir -p dist-release
+for p in "$DEB" "$RPM"; do
+ [ -f "$p.sig" ] || npx tauri signer sign -f "$TAURI_SIGNING_PRIVATE_KEY" "$p"
+done
+node scripts/release/updater.mjs fragment linux-x86_64-deb "$DEB"
+node scripts/release/updater.mjs fragment linux-x86_64-rpm "$RPM"
+# The engine-free binaries must run on Debian 12 / Ubuntu 22.04 (glibc 2.35).
+for f in "target/$TRIPLE/release/kokon" target/release/kokon-service; do
+ printf '%s needs ' "$f"; objdump -T "$f" | grep -o 'GLIBC_[0-9.]*' | sort -Vu | tail -1
+done
+ls -lh dist-release/*.deb dist-release/*.rpm
+echo "Packages: $(pwd)/dist-release"
diff --git a/scripts/release/updater.mjs b/scripts/release/updater.mjs
index 5f266fc..c7909b5 100644
--- a/scripts/release/updater.mjs
+++ b/scripts/release/updater.mjs
@@ -1,6 +1,8 @@
// Update manifest for the in-app updater (Tauri), built from releases made on two machines.
//
-// node scripts/release/updater.mjs fragment <windows-x86_64|darwin-aarch64> <signed bundle>
+// node scripts/release/updater.mjs fragment <platform> <signed bundle>
+// platform: windows-x86_64, darwin-aarch64, linux-x86_64-deb or linux-x86_64-rpm (the
+// Linux updater picks the entry of the package type it was installed from).
// Copies the bundle into dist-release/ under a stable, versioned name and writes
// dist-release/updater-<platform>.json (file name + signature from <bundle>.sig).
// node scripts/release/updater.mjs manifest [--notes "What's new"]
@@ -19,10 +21,16 @@ fs.mkdirSync(out, { recursive: true });
if (cmd === "fragment") {
const [platform, bundle] = args;
- if (!["windows-x86_64", "darwin-aarch64"].includes(platform) || !bundle) throw new Error("usage: fragment <windows-x86_64|darwin-aarch64> <bundle>");
+ const names = {
+ "windows-x86_64": `Kokon_${version}_x64-setup.exe`,
+ "darwin-aarch64": `Kokon_${version}_aarch64.app.tar.gz`,
+ "linux-x86_64-deb": `Kokon_${version}_amd64.deb`,
+ "linux-x86_64-rpm": `Kokon-${version}-1.x86_64.rpm`,
+ };
+ if (!names[platform] || !bundle) throw new Error(`usage: fragment <${Object.keys(names).join("|")}> <bundle>`);
const sig = fs.readFileSync(`${bundle}.sig`, "utf8").trim();
// GitHub turns spaces in asset names into dots: keep names space-free and versioned.
- const name = platform === "darwin-aarch64" ? `Kokon_${version}_aarch64.app.tar.gz` : `Kokon_${version}_x64-setup.exe`;
+ const name = names[platform];
fs.copyFileSync(bundle, path.join(out, name));
fs.writeFileSync(path.join(out, `updater-${platform}.json`), JSON.stringify({ version, platform, file: name, signature: sig }, null, 2));
console.log(`updater entry: ${platform} -> ${name}`);
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index c8897ac..2782f2f 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -69,7 +69,7 @@ fn service_exe() -> Option<PathBuf> {
let me = std::env::current_exe().ok()?;
let dir = me.parent()?;
// Bundled sidecar (Tauri strips the target suffix) or a dev build next to the shell.
- for name in ["kokon-service.exe", "kokon-service-x86_64-pc-windows-msvc.exe", "kokon-service", "kokon-service-aarch64-apple-darwin"] {
+ for name in ["kokon-service.exe", "kokon-service-x86_64-pc-windows-msvc.exe", "kokon-service", "kokon-service-aarch64-apple-darwin", "kokon-service-x86_64-unknown-linux-gnu"] {
let p = dir.join(name);
if p.is_file() {
return Some(p);
diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json
new file mode 100644
index 0000000..e1858e5
--- /dev/null
+++ b/src-tauri/tauri.linux.conf.json
@@ -0,0 +1,11 @@
+{
+ "mainBinaryName": "kokon",
+ "bundle": {
+ "targets": ["deb", "rpm"],
+ "icon": ["icons/32x32.png", "icons/128x128.png", "icons/[email protected]"],
+ "linux": {
+ "deb": { "depends": ["libssl3", "libgomp1", "libvulkan1"], "section": "graphics" },
+ "rpm": { "depends": ["openssl-libs", "libgomp", "vulkan-loader"] }
+ }
+ }
+}
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 43fdf36..a68c7dd 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -77,7 +77,7 @@ function Diagnostics() {
>
<RotateCcw size={14} /> {busy ? "Restarting…" : "Restart server"}
</button>
- <button className="btn" onClick={async () => native.openFolder(`${await native.dataFolder()}\\logs`).catch(toastError)}>
+ <button className="btn" onClick={async () => native.openFolder(await native.dataFolder().then((d) => `${d}${d.includes("\\") ? "\\" : "/"}logs`)).catch(toastError)}>
<FolderOpen size={14} /> Logs
</button>
</div>
diff --git a/src/lib/platform.ts b/src/lib/platform.ts
index 87e6498..868948d 100644
--- a/src/lib/platform.ts
+++ b/src/lib/platform.ts
@@ -5,4 +5,6 @@ export const isMac = typeof navigator !== "undefined" && /Mac/i.test(navigator.p
/** "Ctrl+Z" on Windows, "⌘Z" on macOS. */
export const shortcut = (key: string) => (isMac ? `⌘${key}` : `Ctrl+${key}`);
-export const fileManager = isMac ? "Finder" : "Explorer";
+export const isLinux = typeof navigator !== "undefined" && !isMac && /Linux/i.test(navigator.platform || navigator.userAgent);
+
+export const fileManager = isMac ? "Finder" : isLinux ? "the file manager" : "Explorer";