Follow-up to #16 (RPM + MSI packaging). macOS was explicitly out of scope there; this issue tracks adding it.
What we'd ship
.pkg installer, Homebrew formula (in a tap), or both. .pkg is the direct equivalent of the MSI/RPM story; Homebrew is what most macOS Rust users will reach for.
- A per-user launchd agent (
~/Library/LaunchAgents/com.kramerc.presence-switch.plist) — the macOS analogue of the systemd user unit. Loaded on login via launchctl bootstrap gui/\$UID. No sudo, no admin password.
Why launchd user agent, not LaunchDaemon
System-wide LaunchDaemons need admin rights to install and run as root, which is wrong for Discord IPC (per-user named sockets). User agents match the per-user model we already established for RPM (systemd --user) and MSI (HKCU Run-key).
Build approach
- Cross-compile from Linux runner:
cargo build --target aarch64-apple-darwin + cargo build --target x86_64-apple-darwin, then lipo into a universal binary. Apple's SDK headers are needed (free, but requires a license click-through on Apple's side).
- Or use a
macos-latest runner in CI. Costs more minutes than Linux runners but no SDK fuss.
Sketch of work
Follow-up to #16 (RPM + MSI packaging). macOS was explicitly out of scope there; this issue tracks adding it.
What we'd ship
.pkginstaller, Homebrew formula (in a tap), or both..pkgis the direct equivalent of the MSI/RPM story; Homebrew is what most macOS Rust users will reach for.~/Library/LaunchAgents/com.kramerc.presence-switch.plist) — the macOS analogue of the systemd user unit. Loaded on login vialaunchctl bootstrap gui/\$UID. Nosudo, no admin password.Why launchd user agent, not LaunchDaemon
System-wide LaunchDaemons need admin rights to install and run as root, which is wrong for Discord IPC (per-user named sockets). User agents match the per-user model we already established for RPM (systemd
--user) and MSI (HKCU Run-key).Build approach
cargo build --target aarch64-apple-darwin+cargo build --target x86_64-apple-darwin, then lipo into a universal binary. Apple's SDK headers are needed (free, but requires a license click-through on Apple's side).macos-latestrunner in CI. Costs more minutes than Linux runners but no SDK fuss.Sketch of work
.pkg, Homebrew tap, or both.plistlaunchd template (per-user agent,RunAtLoad,KeepAlive).pkg: usepkgbuild+productbuildon a macOS runner, orxar+ payload on Linux (more fragile)macjob to.github/workflows/package.yml.pkg(requires an Apple Developer account at $99/yr; without it, Gatekeeper requires right-click → Open dance)