From d9421b87b053c02b57cb81f50d4cc17317894890 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 24 Jun 2023 12:40:12 -0700 Subject: [PATCH] build: copy the terminfo db using cp so we get symlinks --- build.zig | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/build.zig b/build.zig index 85f6fbb90..0d3487643 100644 --- a/build.zig +++ b/build.zig @@ -319,29 +319,33 @@ pub fn build(b: *std.Build) !void { // Compile the terminfo source into a terminfo database { // 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"); run_step.addArgs(&.{ "tic", "-x", "-o", path }); run_step.addFileSourceArg(src_source); _ = run_step.captureStdErr(); // so we don't see stderr - const install = b.addInstallDirectory(.{ - .source_dir = path, - .install_dir = .prefix, - .install_subdir = "share/terminfo", + const copy_step = RunStep.create(b, "copy terminfo db"); + copy_step.step.dependOn(&run_step.step); + copy_step.addArgs(&.{ + "cp", + "-R", + path, + b.fmt("{s}/share", .{b.install_prefix}), }); - install.step.dependOn(&run_step.step); - b.getInstallStep().dependOn(&install.step); + b.getInstallStep().dependOn(©_step.step); if (target.isDarwin()) { - const mac_install = b.addInstallDirectory(.{ - .source_dir = path, - .install_dir = .prefix, - .install_subdir = "Ghostty.app/Contents/Resources/terminfo", + const mac_copy_step = RunStep.create(b, "copy terminfo db"); + mac_copy_step.step.dependOn(&run_step.step); + mac_copy_step.addArgs(&.{ + "cp", + "-R", + path, + b.fmt("{s}/Ghostty.app/Contents/Resources", .{b.install_prefix}), }); - mac_install.step.dependOn(&run_step.step); - b.getInstallStep().dependOn(&mac_install.step); + b.getInstallStep().dependOn(&mac_copy_step.step); } } }