pkg config support#29
Merged
Merged
Conversation
Add a `pkg-config` cargo feature (off by default) that tries pkg-config first to locate libghostty-vt. If found (e.g. on NixOS where the pkg-config wrapper adds rpath automatically), skip the zig build entirely. Otherwise fall back to building from source. Bump pinned ghostty commit to include ghostty-org/ghostty#12210 which generates libghostty-vt.pc and libghostty-vt-static.pc during the zig build. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update the checked-in export manifest to match the regenerated bindings from the new Ghostty pin.
Turn off doctests for the generated sys crate so rustdoc stops treating imported C prose from bindgen as runnable Rust examples. The handwritten crate-level docs stay covered elsewhere, while the generated bindings no longer fail cargo test for reasons unrelated to the FFI code itself.
Use Debug formatting for ImageFormat in the Kitty graphics example. The type does not implement Display
Keep an explicit GHOSTTY_SOURCE_DIR override authoritative even when the pkg-config feature is enabled. The build script now checks for GHOSTTY_SOURCE_DIR before probing pkg-config, and the README files now describe the resulting behavior. The pkg-config path remains opt-in, but it is only used when no source override is set.
pluiedev
approved these changes
Apr 28, 2026
pluiedev
left a comment
Collaborator
There was a problem hiding this comment.
I think this approach makes more sense to me at the moment. We can always add the rpath stuff if it turns out to be necessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds upon #27
@pluiedev The last commit in this PR contains the compat changes we talked about yesterday.
Please review por favore. 🙏🏾
cc @domenkozar
(Yes, I created a branch by accident instead of pushing to your PR @domenkozar. I blame the gh cli)