build: options to enable/disable terminfo & termcap install (take 2)

Fixes #5253

Add -Demit-terminfo and -Demit-termcap build options to enable/disable
installation of source terminfo and termcap files.
This commit is contained in:
Jeffrey C. Ollie
2025-01-23 22:29:47 -06:00
parent fd8cacaa67
commit 2f8b0dc899
3 changed files with 56 additions and 20 deletions

View File

@@ -55,6 +55,8 @@ emit_helpgen: bool = false,
emit_docs: bool = false,
emit_webdata: bool = false,
emit_xcframework: bool = false,
emit_terminfo: bool = false,
emit_termcap: bool = false,
/// Environmental properties
env: std.process.EnvMap,
@@ -306,6 +308,27 @@ pub fn init(b: *std.Build) !Config {
break :emit_docs path != null;
};
config.emit_terminfo = b.option(
bool,
"emit-terminfo",
"Install Ghostty terminfo source file",
) orelse switch (target.result.os.tag) {
.windows => true,
else => switch (optimize) {
.Debug => true,
.ReleaseSafe, .ReleaseFast, .ReleaseSmall => false,
},
};
config.emit_termcap = b.option(
bool,
"emit-termcap",
"Install Ghostty termcap file",
) orelse switch (optimize) {
.Debug => true,
.ReleaseSafe, .ReleaseFast, .ReleaseSmall => false,
};
config.emit_webdata = b.option(
bool,
"emit-webdata",