build: add ghostty-internal pkg-config modules (shared + static) (#12214)

## Summary
Mirror the `libghostty-vt-static` pkg-config pattern from #12210 for the
internal library.

- Add `ghostty-internal.pc` (shared, `-lghostty`) and
`ghostty-internal-static.pc` (static, direct archive reference) so
consumers can discover either variant via pkg-config
- Named `ghostty-internal` to distinguish from the public
`libghostty-vt` API
- Static module points at the platform-correct archive name
(`ghostty-static.lib` on Windows, `libghostty.a` elsewhere)
- pkg-config files are generated during shared builds and installed via
`GhosttyLib.install()`

## Test plan

- [x] `zig build` succeeds (default target)
- [x] `ghostty-internal.pc` and `ghostty-internal-static.pc` appear in
`zig-out/share/pkgconfig/`
- [x] Static `.pc` points at `ghostty-static.lib` (Windows) /
`libghostty.a` (Unix)
- [x] Shared `.pc` uses standard `-L -l` flags
- [x] Existing `libghostty-vt` pkg-config files are unaffected
This commit is contained in:
Mitchell Hashimoto
2026-04-12 13:18:03 -07:00
committed by GitHub
4 changed files with 110 additions and 17 deletions

View File

@@ -190,11 +190,11 @@ pub fn build(b: *std.Build) !void {
if (!config.target.result.os.tag.isDarwin()) {
lib_shared.installHeader(); // Only need one header
if (config.target.result.os.tag == .windows) {
lib_shared.install("ghostty.dll");
lib_static.install("ghostty-static.lib");
lib_shared.install("ghostty-internal.dll");
lib_static.install("ghostty-internal-static.lib");
} else {
lib_shared.install("libghostty.so");
lib_static.install("libghostty.a");
lib_shared.install("ghostty-internal.so");
lib_static.install("ghostty-internal.a");
}
}
}