Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

fix: packagers that guarantee PATH tools can skip the bundle guard

Jareere8f9d6444f87
diff --git a/desktop/src-tauri/build.rs b/desktop/src-tauri/build.rs
index 6e5d45f3..a3e44710 100644
--- a/desktop/src-tauri/build.rs
+++ b/desktop/src-tauri/build.rs
@@ -4,7 +4,13 @@ fn main() {
// shaped failed at runtime, launched from Finder with no PATH to fall
// back on. Fail the build instead - staging the binaries is part of
// building for release.
- if std::env::var("PROFILE").as_deref() == Ok("release") {
+ // A packager whose launcher guarantees the tools on the app's PATH - the
+ // Nix wrapper puts ffmpeg, ffprobe and whisper-cli there - opts out
+ // explicitly instead of staging copies it is not allowed to ship.
+ println!("cargo:rerun-if-env-changed=WOLFCUT_SYSTEM_TOOLS");
+ let system_tools = std::env::var_os("WOLFCUT_SYSTEM_TOOLS").is_some();
+
+ if !system_tools && std::env::var("PROFILE").as_deref() == Ok("release") {
let suffix = if cfg!(target_os = "windows") { ".exe" } else { "" };
let staged = std::path::Path::new("ffmpeg");
for binary in ["ffmpeg", "ffprobe"] {
diff --git a/flake.nix b/flake.nix
index fb09da3e..35ba654f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -35,6 +35,12 @@
npmRoot = "desktop";
npmDeps = pkgs.importNpmLock { npmRoot = ./desktop; };
+ # The release guard in build.rs insists on staged ffmpeg/whisper
+ # binaries because a Finder/desktop launch has no PATH to fall back
+ # on. The Nix wrapper guarantees them on PATH, so this build opts
+ # out of bundling explicitly.
+ env.WOLFCUT_SYSTEM_TOOLS = "1";
+
nativeBuildInputs = with pkgs; [
cargo-tauri.hook
nodejs