build: allow disabling i18n

GNU gettext simply is a PITA on certain platforms (i.e. Windows, musl
Linux, etc.) and currently it's not possible to cleanly remove i18n
from the build process, making building Ghostty on the aforementioned
platforms difficult. By providing users with a way to opt-out of the
i18n mechanisms (or opt-in, on platforms where i18n is disabled by
default) we can make sure that people at least have *some* way of
building Ghostty before i18n mechanisms can be integrated neatly.
This commit is contained in:
Leah Amelia Chen
2025-08-06 14:44:40 +08:00
parent c2165fc097
commit 5fbdb8c459
5 changed files with 33 additions and 9 deletions

View File

@@ -17,7 +17,7 @@ xctest: *std.Build.Step.Run,
pub const Deps = struct {
xcframework: *const XCFramework,
docs: *const Docs,
i18n: *const I18n,
i18n: ?*const I18n,
resources: *const Resources,
};
@@ -81,7 +81,7 @@ pub fn init(
// We also need all these resources because the xcode project
// references them via symlinks.
deps.resources.addStepDependencies(&step.step);
deps.i18n.addStepDependencies(&step.step);
if (deps.i18n) |v| v.addStepDependencies(&step.step);
deps.docs.installDummy(&step.step);
// Expect success
@@ -113,7 +113,7 @@ pub fn init(
// We also need all these resources because the xcode project
// references them via symlinks.
deps.resources.addStepDependencies(&step.step);
deps.i18n.addStepDependencies(&step.step);
if (deps.i18n) |v| v.addStepDependencies(&step.step);
deps.docs.installDummy(&step.step);
// Expect success