- crates/kv-ipc: native-messaging framing and the local IPC socket/pipe (moved from kestrove-desktop), plus Listener::bind_in/connect_in and, on macOS, the App Group socket for the kestrove-nmh bundled in Kestrove.app (Contents/Resources/kestrove-app-group). - crates/kv-nmh: the native-messaging host, with an embedded Info.plist on macOS so it can run sandboxed (KV_NMH_BUNDLE_ID). - kv-ffi feature browser-bridge: broker, pairing channel and word list (moved from kestrove-desktop) and BrowserBridge for Swift. build-apple.sh enables it and builds a universal kestrove-nmh. - RUSTSEC-2026-0381/0382: rustls-webpki 0.103.16, webpki-roots 1.0.10 (distrusted emSign roots). Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.5 KiB
Rust
41 lines
1.5 KiB
Rust
//! macOS: embed an Info.plist (`__TEXT,__info_plist`). The copy inside Kestrove.app is signed sandboxed, and the
|
|
//! sandbox refuses to start an executable without a bundle identifier. `KV_NMH_BUNDLE_ID` is set by
|
|
//! scripts/build-apple.sh to the app's bundle id + ".nmh"; codesign takes the signing identifier from it.
|
|
|
|
use std::env;
|
|
use std::fs;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-env-changed=KV_NMH_BUNDLE_ID");
|
|
if env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("macos") {
|
|
return;
|
|
}
|
|
let id = env::var("KV_NMH_BUNDLE_ID").unwrap_or_else(|_| "app.kestrove.nmh".into());
|
|
assert!(
|
|
!id.is_empty() && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '.' || c == '-'),
|
|
"KV_NMH_BUNDLE_ID must be a reverse-DNS identifier"
|
|
);
|
|
let plist = format!(
|
|
r#"<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>CFBundleIdentifier</key>
|
|
<string>{id}</string>
|
|
<key>CFBundleName</key>
|
|
<string>kestrove-nmh</string>
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
<string>6.0</string>
|
|
<key>CFBundleShortVersionString</key>
|
|
<string>{version}</string>
|
|
</dict>
|
|
</plist>
|
|
"#,
|
|
version = env::var("CARGO_PKG_VERSION").unwrap()
|
|
);
|
|
let out = PathBuf::from(env::var("OUT_DIR").unwrap()).join("Info.plist");
|
|
fs::write(&out, plist).unwrap();
|
|
println!("cargo:rustc-link-arg-bins=-Wl,-sectcreate,__TEXT,__info_plist,{}", out.display());
|
|
}
|