mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
build: copy the terminfo db using cp so we get symlinks
This commit is contained in:
30
build.zig
30
build.zig
@ -319,29 +319,33 @@ pub fn build(b: *std.Build) !void {
|
|||||||
// Compile the terminfo source into a terminfo database
|
// Compile the terminfo source into a terminfo database
|
||||||
{
|
{
|
||||||
// Hardcoded until: https://github.com/ziglang/zig/issues/16187
|
// Hardcoded until: https://github.com/ziglang/zig/issues/16187
|
||||||
const path = "zig-cache/tmp/tic";
|
const path = "zig-cache/tmp/terminfo";
|
||||||
|
|
||||||
const run_step = RunStep.create(b, "tic");
|
const run_step = RunStep.create(b, "tic");
|
||||||
run_step.addArgs(&.{ "tic", "-x", "-o", path });
|
run_step.addArgs(&.{ "tic", "-x", "-o", path });
|
||||||
run_step.addFileSourceArg(src_source);
|
run_step.addFileSourceArg(src_source);
|
||||||
_ = run_step.captureStdErr(); // so we don't see stderr
|
_ = run_step.captureStdErr(); // so we don't see stderr
|
||||||
|
|
||||||
const install = b.addInstallDirectory(.{
|
const copy_step = RunStep.create(b, "copy terminfo db");
|
||||||
.source_dir = path,
|
copy_step.step.dependOn(&run_step.step);
|
||||||
.install_dir = .prefix,
|
copy_step.addArgs(&.{
|
||||||
.install_subdir = "share/terminfo",
|
"cp",
|
||||||
|
"-R",
|
||||||
|
path,
|
||||||
|
b.fmt("{s}/share", .{b.install_prefix}),
|
||||||
});
|
});
|
||||||
install.step.dependOn(&run_step.step);
|
b.getInstallStep().dependOn(©_step.step);
|
||||||
b.getInstallStep().dependOn(&install.step);
|
|
||||||
|
|
||||||
if (target.isDarwin()) {
|
if (target.isDarwin()) {
|
||||||
const mac_install = b.addInstallDirectory(.{
|
const mac_copy_step = RunStep.create(b, "copy terminfo db");
|
||||||
.source_dir = path,
|
mac_copy_step.step.dependOn(&run_step.step);
|
||||||
.install_dir = .prefix,
|
mac_copy_step.addArgs(&.{
|
||||||
.install_subdir = "Ghostty.app/Contents/Resources/terminfo",
|
"cp",
|
||||||
|
"-R",
|
||||||
|
path,
|
||||||
|
b.fmt("{s}/Ghostty.app/Contents/Resources", .{b.install_prefix}),
|
||||||
});
|
});
|
||||||
mac_install.step.dependOn(&run_step.step);
|
b.getInstallStep().dependOn(&mac_copy_step.step);
|
||||||
b.getInstallStep().dependOn(&mac_install.step);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user