libghostty als zweite Terminal-Engine integriert (Default ghostty, SwiftTerm Fallback)
- vendor/libghostty: vorgebaute macOS-libghostty.a (arm64) + Header + Build-Patches + README - Sources/CGhostty: C-Modul der libghostty-C-API - Sources/MiniTerm/Ghostty.swift: GhosttyApp + GhosttySurfaceView (Surface, Input, Größe, Fokus) - main.swift: Engine-Wahl per Info.plist MTEngine - Package.swift: CGhostty-Target + Link gegen libghostty + Frameworks - STATUS.md: Stand, Build-Weg (macOS-15-VM), offene Punkte
This commit is contained in:
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
# libghostty (volle macOS-Variante, mit Metal-Renderer)
|
||||
|
||||
Einbettbare Ghostty-Kernbibliothek inkl. Surface-/App-API und Metal-Renderer —
|
||||
dieselbe, die Ghostty.app auf macOS nutzt. Zum Linken in die Swift-Hülle
|
||||
(`Sources/MiniTerm`) als Ersatz/Ergänzung zu SwiftTerm.
|
||||
|
||||
## Inhalt
|
||||
- `lib/libghostty.a` — statische Lib, **arm64**, ReleaseFast (~135 MB)
|
||||
- `include/` — C-Header (`ghostty.h` = volle API; `ghostty/vt*` = VT-only-API)
|
||||
- `patches/ghostty-v1.3.1-libghostty-clt-build.patch` — Build-Patches (s. u.)
|
||||
|
||||
## Zentrale API (in `include/ghostty.h`)
|
||||
`ghostty_init`, `ghostty_app_new`, `ghostty_surface_new`, `ghostty_surface_draw`,
|
||||
`ghostty_surface_key`, `ghostty_surface_free`, …
|
||||
|
||||
## Quelle / Build
|
||||
- Ghostty **v1.3.1**, Zig **0.15.2**.
|
||||
- Gebaut in einer **macOS-15-VM** (tart, cirruslabs `macos-sequoia-xcode`), weil
|
||||
Zig 0.15.2 auf dem Host (macOS 26.5) kein natives Binary linkt (libSystem-
|
||||
Inkompatibilität mit dem 26er-SDK; reine Auto-Erkennung von `26.x` scheitert).
|
||||
- In der VM aktiv: **Command Line Tools** (macOS-15.5-SDK) → Zig linkt sauber.
|
||||
Der Metal-Shader-Compiler (`metal`) wird nur für den Shader-Schritt per
|
||||
`DEVELOPER_DIR` aus dem installierten Xcode geholt (s. Patch `MetallibStep.zig`).
|
||||
|
||||
Build-Aufruf in der VM:
|
||||
|
||||
sudo xcode-select -s /Library/Developer/CommandLineTools
|
||||
cd ghostty && git apply ghostty-v1.3.1-libghostty-clt-build.patch
|
||||
zig build -Doptimize=ReleaseFast -Demit-xcframework=false
|
||||
# Ergebnis: zig-out/lib/libghostty.a, zig-out/include/
|
||||
|
||||
## Patches (warum)
|
||||
- `build.zig`: Auf Darwin den macOS-`libghostty.a`-Install freischalten
|
||||
(Original klammert ihn per `if (!isDarwin())` aus, baut sonst nur ein
|
||||
xcframework). Shared-`.so`-Install entfernt (Dynamic-Link schlug fehl,
|
||||
wird nicht gebraucht).
|
||||
- `GhosttyXCFramework.zig`: Nur die native macOS-Slice konstruieren —
|
||||
iOS/iOS-Simulator/Universal raus (CLT hat kein iOS-SDK, brauchen wir nicht).
|
||||
- `MetallibStep.zig`: `metal`/`metallib` über `DEVELOPER_DIR=<Xcode>` aufrufen,
|
||||
damit der Shader-Compiler trotz aktivem CLT gefunden wird.
|
||||
Reference in New Issue
Block a user