mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Fix DESTDIR
handling for terminfo installation
Use `install_path` instead of `install_prefix` when installing terminfo database files to properly respect the `DESTDIR` environment variable. This ensures files are correctly installed under `$DESTDIR/$prefix` when packaging. Fixes #3152
This commit is contained in:
10
build.zig
10
build.zig
@ -481,19 +481,25 @@ pub fn build(b: *std.Build) !void {
|
|||||||
run_step.step.dependOn(&src_install.step);
|
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");
|
const copy_step = RunStep.create(b, "copy terminfo db");
|
||||||
copy_step.addArgs(&.{ "cp", "-R" });
|
copy_step.addArgs(&.{ "cp", "-R" });
|
||||||
copy_step.addFileArg(path);
|
copy_step.addFileArg(path);
|
||||||
copy_step.addArg(b.fmt("{s}/share", .{b.install_prefix}));
|
copy_step.addArg(b.fmt("{s}/share", .{b.install_path}));
|
||||||
b.getInstallStep().dependOn(©_step.step);
|
b.getInstallStep().dependOn(©_step.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.result.os.tag == .macos and exe_ != null) {
|
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");
|
const copy_step = RunStep.create(b, "copy terminfo db");
|
||||||
copy_step.addArgs(&.{ "cp", "-R" });
|
copy_step.addArgs(&.{ "cp", "-R" });
|
||||||
copy_step.addFileArg(path);
|
copy_step.addFileArg(path);
|
||||||
copy_step.addArg(
|
copy_step.addArg(
|
||||||
b.fmt("{s}/Ghostty.app/Contents/Resources", .{b.install_prefix}),
|
b.fmt("{s}/Ghostty.app/Contents/Resources", .{b.install_path}),
|
||||||
);
|
);
|
||||||
b.getInstallStep().dependOn(©_step.step);
|
b.getInstallStep().dependOn(©_step.step);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user