From cb25c0a8aeb40e940ca4ef87b24ee49db3a963a9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 20 Jan 2026 10:17:24 -0800 Subject: [PATCH] build: libghostty-vt now depends on uucode directly This doesn't add any real weight to it, we only need it for a type definition. This fixes our example builds. --- src/build/GhosttyZig.zig | 3 +++ src/build/SharedDeps.zig | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/build/GhosttyZig.zig b/src/build/GhosttyZig.zig index a8d2726bc..e63120e74 100644 --- a/src/build/GhosttyZig.zig +++ b/src/build/GhosttyZig.zig @@ -73,6 +73,9 @@ fn initVt( // We always need unicode tables deps.unicode_tables.addModuleImport(vt); + // We need uucode for grapheme break support + deps.addUucode(b, vt, cfg.target, cfg.optimize); + // If SIMD is enabled, add all our SIMD dependencies. if (cfg.simd) { try SharedDeps.addSimd(b, vt, null); diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig index b1c084002..0ca43e78d 100644 --- a/src/build/SharedDeps.zig +++ b/src/build/SharedDeps.zig @@ -412,14 +412,7 @@ pub fn add( })) |dep| { step.root_module.addImport("z2d", dep.module("z2d")); } - if (b.lazyDependency("uucode", .{ - .target = target, - .optimize = optimize, - .tables_path = self.uucode_tables, - .build_config_path = b.path("src/build/uucode_config.zig"), - })) |dep| { - step.root_module.addImport("uucode", dep.module("uucode")); - } + self.addUucode(b, step.root_module, target, optimize); if (b.lazyDependency("zf", .{ .target = target, .optimize = optimize, @@ -878,6 +871,23 @@ pub fn gtkNgDistResources( }; } +pub fn addUucode( + self: *const SharedDeps, + b: *std.Build, + module: *std.Build.Module, + target: std.Build.ResolvedTarget, + optimize: std.builtin.OptimizeMode, +) void { + if (b.lazyDependency("uucode", .{ + .target = target, + .optimize = optimize, + .tables_path = self.uucode_tables, + .build_config_path = b.path("src/build/uucode_config.zig"), + })) |dep| { + module.addImport("uucode", dep.module("uucode")); + } +} + // For dynamic linking, we prefer dynamic linking and to search by // mode first. Mode first will search all paths for a dynamic library // before falling back to static.