Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contrib/pyinstaller_spec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ if static_dir.exists():
for f in static_dir.rglob("*"):
if f.is_file():
rel_path = f.relative_to(rustfava_dir)
datas.append((str(f), str(rel_path.parent)))
datas.append((str(f), f"rustfava/{rel_path.parent}"))

# Templates
templates_dir = rustfava_dir / "templates"
if templates_dir.exists():
for f in templates_dir.rglob("*"):
if f.is_file():
rel_path = f.relative_to(rustfava_dir)
datas.append((str(f), str(rel_path.parent)))
datas.append((str(f), f"rustfava/{rel_path.parent}"))

# Translations (.mo files)
translations_dir = rustfava_dir / "translations"
if translations_dir.exists():
for f in translations_dir.rglob("*.mo"):
rel_path = f.relative_to(rustfava_dir)
datas.append((str(f), str(rel_path.parent)))
datas.append((str(f), f"rustfava/{rel_path.parent}"))

# WASM file for rustledger
wasm_file = rustfava_dir / "rustledger" / "rustledger-wasi.wasm"
Expand All @@ -59,7 +59,7 @@ if help_dir.exists():
for f in help_dir.rglob("*"):
if f.is_file():
rel_path = f.relative_to(rustfava_dir)
datas.append((str(f), str(rel_path.parent)))
datas.append((str(f), f"rustfava/{rel_path.parent}"))

# Hidden imports
hiddenimports = [
Expand Down
8 changes: 4 additions & 4 deletions desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ fn spawn_rustfava_server(app: &AppHandle, path: &str, port: u16) -> Result<Comma
}
}

// Fall back to rustfava from PATH (for NixOS/system installs)
// This allows the desktop app to work when rustfava CLI is installed separately
// Fall back to rustfava-server from PATH (for NixOS flake installs)
// The flake creates symlinks without the target triple suffix
let command = app
.shell()
.command("rustfava")
.command("rustfava-server")
.args([path, "-p", &port.to_string()]);

let (_, child) = command
.spawn()
.map_err(|e| format!("Failed to spawn rustfava: {}. Make sure rustfava is installed and in PATH.", e))?;
.map_err(|e| format!("Failed to spawn rustfava-server: {}. Make sure the desktop app is properly installed.", e))?;

Ok(child)
}
Expand Down
13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@
mkdir -p $out
cp -r bin lib $out/

# Create symlinks without target triple suffix for PATH lookup
# The desktop app falls back to these when sidecar lookup fails
for bin in $out/bin/*-${targetTriple}*; do
if [ -f "$bin" ]; then
base=$(basename "$bin" | sed "s/-${targetTriple}//")
ln -sf "$(basename "$bin")" "$out/bin/$base"
fi
done

# Create rustfava -> rustfava-server symlink for backwards compatibility
# Old releases look for 'rustfava' in PATH as fallback
ln -sf "rustfava-server-${targetTriple}" "$out/bin/rustfava"

# Wrap all binaries with wasmtime in PATH and GTK settings
for bin in $out/bin/*; do
if [ -f "$bin" ] && [ -x "$bin" ]; then
Expand Down