diff --git a/build.zig b/build.zig index 6b92a095..ca2bd330 100644 --- a/build.zig +++ b/build.zig @@ -528,27 +528,21 @@ pub fn build(b: *std.Build) !void { run_step.step.dependOn(&src_install.step); { - // Use cp -R instead of Step.InstallDir because we need to preserve - // symlinks in the terminfo database. Zig's InstallDir step doesn't - // handle symlinks correctly yet. - const copy_step = RunStep.create(b, "copy terminfo db"); - copy_step.addArgs(&.{ "cp", "-R" }); - copy_step.addFileArg(path); - copy_step.addArg(b.fmt("{s}/share", .{b.install_path})); - b.getInstallStep().dependOn(©_step.step); + const install_dir_step = b.addInstallDirectory(.{ + .source_dir = path, + .install_dir = .prefix, + .install_subdir = "share/terminfo", + }); + b.getInstallStep().dependOn(&install_dir_step.step); } if (target.result.os.tag == .macos and exe_ != null) { - // Use cp -R instead of Step.InstallDir because we need to preserve - // symlinks in the terminfo database. Zig's InstallDir step doesn't - // handle symlinks correctly yet. - const copy_step = RunStep.create(b, "copy terminfo db"); - copy_step.addArgs(&.{ "cp", "-R" }); - copy_step.addFileArg(path); - copy_step.addArg( - b.fmt("{s}/Ghostty.app/Contents/Resources", .{b.install_path}), - ); - b.getInstallStep().dependOn(©_step.step); + const install_dir_step = b.addInstallDirectory(.{ + .source_dir = path, + .install_dir = .prefix, + .install_subdir = "Ghostty.app/Contents/Resources/terminfo", + }); + b.getInstallStep().dependOn(&install_dir_step.step); } } }