diff --git a/Cargo.lock b/Cargo.lock index 19b709aa63..20f37b3b8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -348,7 +348,7 @@ dependencies = [ name = "am2" version = "0.1.0" dependencies = [ - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] @@ -4205,6 +4205,7 @@ dependencies = [ "specta", "specta-typescript", "strum 0.26.3", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", "tauri", "tauri-build", "tauri-plugin-analytics", @@ -8250,7 +8251,7 @@ dependencies = [ name = "intercept" version = "0.1.0" dependencies = [ - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] @@ -10045,7 +10046,7 @@ dependencies = [ "objc2 0.6.3", "objc2-app-kit 0.3.2", "objc2-foundation 0.3.2", - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] @@ -10091,7 +10092,7 @@ dependencies = [ "objc2 0.6.3", "objc2-app-kit 0.3.2", "objc2-foundation 0.3.2", - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] @@ -15077,7 +15078,7 @@ dependencies = [ [[package]] name = "swift-rs" version = "1.0.7" -source = "git+https://github.com/yujonglee/swift-rs?rev=41a1605#41a160524c737c061f5633e4371952544425aa01" +source = "git+https://github.com/yujonglee/swift-rs?rev=0b36e41#0b36e4146974b26c68677e12cf5b1700eb94edcf" dependencies = [ "base64 0.21.7", "serde", @@ -16065,6 +16066,7 @@ dependencies = [ "specta", "specta-typescript", "strum 0.26.3", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", "tauri", "tauri-plugin", "tauri-plugin-shell", @@ -16079,6 +16081,7 @@ dependencies = [ "tracing", "transcribe-moonshine", "transcribe-whisper-local", + "vad-ext", "whisper-local", "whisper-local-model", ] @@ -16614,7 +16617,7 @@ dependencies = [ name = "tcc" version = "0.1.0" dependencies = [ - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] @@ -18327,7 +18330,7 @@ dependencies = [ "rodio", "serde", "silero", - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", "thiserror 2.0.17", "tokio", "tracing", @@ -18460,7 +18463,7 @@ version = "0.1.0" dependencies = [ "am2", "earshot", - "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=41a1605)", + "swift-rs 1.0.7 (git+https://github.com/yujonglee/swift-rs?rev=0b36e41)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 05b74d49f9..4bedebe14a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -257,7 +257,7 @@ objc2-user-notifications = "0.3" tokenizers = "0.21.4" -swift-rs = { git = "https://github.com/yujonglee/swift-rs", rev = "41a1605" } +swift-rs = { git = "https://github.com/yujonglee/swift-rs", rev = "0b36e41" } sysinfo = "0.37.0" [patch.crates-io] diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index fe7d88521c..7854a7117d 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -19,6 +19,9 @@ crate-type = ["staticlib", "rlib"] [build-dependencies] tauri-build = { workspace = true, features = [] } +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.build-dependencies] +swift-rs = { workspace = true, features = ["build"] } + [dependencies] tauri = { workspace = true, features = ["specta", "macos-private-api", "protocol-asset"] } diff --git a/apps/desktop/src-tauri/build.rs b/apps/desktop/src-tauri/build.rs index fa1dc1a851..67286527b9 100644 --- a/apps/desktop/src-tauri/build.rs +++ b/apps/desktop/src-tauri/build.rs @@ -2,6 +2,9 @@ fn main() { #[cfg(target_os = "macos")] println!("cargo:rustc-link-arg=-fapple-link-rtlib"); + #[cfg(all(target_os = "macos", target_arch = "aarch64"))] + swift_rs::link_swift_framework("tauri-plugin-local-stt"); + #[cfg(debug_assertions)] { use std::path::PathBuf; diff --git a/crates/vad-ext/Cargo.toml b/crates/vad-ext/Cargo.toml index 15ebd50262..4e6bf2bb84 100644 --- a/crates/vad-ext/Cargo.toml +++ b/crates/vad-ext/Cargo.toml @@ -2,6 +2,7 @@ name = "vad-ext" version = "0.1.0" edition = "2021" +links = "vad-ext" [target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.build-dependencies] swift-rs = { workspace = true, features = ["build"] } diff --git a/crates/vad-ext/build.rs b/crates/vad-ext/build.rs index 89b02c5bf7..7c8779a464 100644 --- a/crates/vad-ext/build.rs +++ b/crates/vad-ext/build.rs @@ -1,4 +1,4 @@ fn main() { #[cfg(all(target_os = "macos", target_arch = "aarch64"))] - swift_rs::propagate_framework_rpath("vvad", false); + swift_rs::link_swift_framework("vvad"); } diff --git a/crates/vvad/build.rs b/crates/vvad/build.rs index 4176638b44..a163b6709a 100644 --- a/crates/vvad/build.rs +++ b/crates/vvad/build.rs @@ -1,4 +1,4 @@ fn main() { #[cfg(all(target_os = "macos", target_arch = "aarch64"))] - swift_rs::propagate_framework_rpath("am2", true); + swift_rs::link_swift_framework("am2"); } diff --git a/plugins/local-stt/Cargo.toml b/plugins/local-stt/Cargo.toml index 2105fd416b..4a13ea9020 100644 --- a/plugins/local-stt/Cargo.toml +++ b/plugins/local-stt/Cargo.toml @@ -22,6 +22,9 @@ load-dynamic = ["hypr-transcribe-whisper-local/load-dynamic"] [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.build-dependencies] +swift-rs = { workspace = true, features = ["build"] } + [dev-dependencies] hypr-audio-utils = { workspace = true } hypr-data = { workspace = true } @@ -44,6 +47,7 @@ hypr-host = { workspace = true } hypr-language = { workspace = true, features = ["whisper"] } hypr-transcribe-moonshine = { workspace = true } hypr-transcribe-whisper-local = { workspace = true } +hypr-vad-ext = { workspace = true } hypr-whisper-local = { workspace = true } hypr-whisper-local-model = { workspace = true } diff --git a/plugins/local-stt/build.rs b/plugins/local-stt/build.rs index c706f7ce88..063d03fcb1 100644 --- a/plugins/local-stt/build.rs +++ b/plugins/local-stt/build.rs @@ -12,5 +12,8 @@ const COMMANDS: &[&str] = &[ ]; fn main() { + #[cfg(all(target_os = "macos", target_arch = "aarch64"))] + swift_rs::link_swift_framework("vad-ext"); + tauri_plugin::Builder::new(COMMANDS).build(); }