build: add -Demit-themes option to emit/omit theme resources (#9288)
We'll backport this to 1.2.x for distros that would prefer this.1.2.x
parent
bbbb52ed75
commit
d2a459b7c2
|
|
@ -60,6 +60,7 @@ emit_macos_app: bool = false,
|
||||||
emit_terminfo: bool = false,
|
emit_terminfo: bool = false,
|
||||||
emit_termcap: bool = false,
|
emit_termcap: bool = false,
|
||||||
emit_test_exe: bool = false,
|
emit_test_exe: bool = false,
|
||||||
|
emit_themes: bool = false,
|
||||||
emit_xcframework: bool = false,
|
emit_xcframework: bool = false,
|
||||||
emit_webdata: bool = false,
|
emit_webdata: bool = false,
|
||||||
emit_unicode_table_gen: bool = false,
|
emit_unicode_table_gen: bool = false,
|
||||||
|
|
@ -366,6 +367,12 @@ pub fn init(b: *std.Build) !Config {
|
||||||
.ReleaseSafe, .ReleaseFast, .ReleaseSmall => false,
|
.ReleaseSafe, .ReleaseFast, .ReleaseSmall => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.emit_themes = b.option(
|
||||||
|
bool,
|
||||||
|
"emit-themes",
|
||||||
|
"Install bundled iTerm2-Color-Schemes Ghostty themes",
|
||||||
|
) orelse true;
|
||||||
|
|
||||||
config.emit_webdata = b.option(
|
config.emit_webdata = b.option(
|
||||||
bool,
|
bool,
|
||||||
"emit-webdata",
|
"emit-webdata",
|
||||||
|
|
|
||||||
|
|
@ -118,14 +118,16 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Themes
|
// Themes
|
||||||
if (b.lazyDependency("iterm2_themes", .{})) |upstream| {
|
if (cfg.emit_themes) {
|
||||||
const install_step = b.addInstallDirectory(.{
|
if (b.lazyDependency("iterm2_themes", .{})) |upstream| {
|
||||||
.source_dir = upstream.path(""),
|
const install_step = b.addInstallDirectory(.{
|
||||||
.install_dir = .{ .custom = "share" },
|
.source_dir = upstream.path(""),
|
||||||
.install_subdir = b.pathJoin(&.{ "ghostty", "themes" }),
|
.install_dir = .{ .custom = "share" },
|
||||||
.exclude_extensions = &.{".md"},
|
.install_subdir = b.pathJoin(&.{ "ghostty", "themes" }),
|
||||||
});
|
.exclude_extensions = &.{".md"},
|
||||||
try steps.append(&install_step.step);
|
});
|
||||||
|
try steps.append(&install_step.step);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fish shell completions
|
// Fish shell completions
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue