build(macos): build the original Swift app against the Rust core

Ghostty's macOS app stays the original, unchanged Swift app (agreed
scope); it is wired to the Rust core instead of the Zig core.
scripts/macos-swift-app.sh (`just macos-swift-app <ghostty-src>`)
mirrors the Zig build's GhosttyXcodebuild.zig:
1. scripts/xcframework.sh builds the Rust libghostty (identical
   include/ghostty.h ABI) as <src>/macos/GhosttyKit.xcframework,
2. `just install <src>/zig-out` provides the resources the Xcode project
   bundles from ../zig-out/share (ghostty, terminfo, completions, man,
   locale, vim, nvim, bat),
3. xcodebuild -target Ghostty in a clean environment.
macOS + Xcode only; DRY_RUN=1 previews the steps (verified on Linux).

Test Plan:
- DRY_RUN=1 scripts/macos-swift-app.sh ../ghostty
- on macOS: just macos-swift-app ../ghostty && open the built app
This commit is contained in:
ddidderr committed 2026-10-12 19:29:26 +02:00
1 parent 6d058b965e
commit 003d318fbf
4 files changed
+83 -5

No files matched your search

+16
View File
@@ -19,6 +19,22 @@ Windows test suites also run under Wine (`just test-windows-wine`), macOS has
not been run natively. The Swift macOS app is not part of the port; it is a
client of the libghostty C API.
### The macOS app (original Swift app on the Rust core)
Ghostty's macOS app stays the original Swift app, unchanged. It is wired to
the Rust core instead of the Zig core: the Rust `libghostty` exports the
identical `include/ghostty.h` ABI. On a Mac with Xcode:
```sh
just macos-swift-app ../ghostty # Release; or: just macos-swift-app ../ghostty Debug
```
This builds the Rust core as `GhosttyKit.xcframework` into
`<ghostty>/macos/`, installs the resources into `<ghostty>/zig-out/share`
(what the Xcode project bundles) and runs `xcodebuild`, mirroring
`zig build -Demit-macos-app`. Not runnable on this Linux machine
(`DRY_RUN=1` previews the steps).
## Building and running
Requirements: Rust (edition 2024), GTK ≥ 4.14, libadwaita ≥ 1.5,