diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-24 12:22:04 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-24 12:22:09 -0700 |
| commit | 513cdf667bb2fdd94eb00a7b3dc57df80f1531e9 (patch) | |
| tree | ec65d2daa73c9496a726d1dd57e7088b231127d9 /src/build | |
| parent | 0944f051aaf96e0a640ae798f4194b3777d4f5ce (diff) | |
build: add pkg-config for libghostty-vt
Diffstat (limited to 'src/build')
| -rw-r--r-- | src/build/GhosttyLibVt.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/build/GhosttyLibVt.zig b/src/build/GhosttyLibVt.zig index eda49a38d..9c995952a 100644 --- a/src/build/GhosttyLibVt.zig +++ b/src/build/GhosttyLibVt.zig @@ -17,6 +17,7 @@ artifact: *std.Build.Step.InstallArtifact, /// The final library file output: std.Build.LazyPath, dsym: ?std.Build.LazyPath, +pkg_config: std.Build.LazyPath, pub fn initShared( b: *std.Build, @@ -46,11 +47,29 @@ pub fn initShared( break :dsymutil output; }; + // pkg-config + const pc: std.Build.LazyPath = pc: { + const wf = b.addWriteFiles(); + break :pc wf.add("libghostty-vt.pc", b.fmt( + \\prefix={s} + \\includedir=${{prefix}}/include + \\libdir=${{prefix}}/lib + \\ + \\Name: libghostty-vt + \\URL: https://github.com/ghostty-org/ghostty + \\Description: Ghostty VT library + \\Version: 0.1.0 + \\Cflags: -I${{includedir}} + \\Libs: -L${{libdir}} -lghostty-vt + , .{b.install_prefix})); + }; + return .{ .step = &lib.step, .artifact = b.addInstallArtifact(lib, .{}), .output = lib.getEmittedBin(), .dsym = dsymutil, + .pkg_config = pc, }; } @@ -60,3 +79,15 @@ pub fn install( ) void { step.dependOn(&self.artifact.step); } + +pub fn installPkgConfig( + self: *const GhosttyLibVt, + step: *std.Build.Step, +) void { + const b = step.owner; + step.dependOn(&b.addInstallFileWithDir( + self.pkg_config, + .prefix, + "share/pkgconfig/libghostty-vt.pc", + ).step); +} |
