mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-28 17:14:39 +00:00
build: add pkg-config for libghostty-vt
This commit is contained in:
@@ -104,6 +104,8 @@ pub fn build(b: *std.Build) !void {
|
||||
);
|
||||
libghostty_vt_shared.install(libvt_step);
|
||||
libghostty_vt_shared.install(b.getInstallStep());
|
||||
libghostty_vt_shared.installPkgConfig(libvt_step);
|
||||
libghostty_vt_shared.installPkgConfig(b.getInstallStep());
|
||||
|
||||
// Helpgen
|
||||
if (config.emit_helpgen) deps.help_strings.install();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user