testing uucode.x

pull/8757/head
Jacob Sandlund 2025-08-04 10:02:41 -04:00
parent e5bbc9e83d
commit 8dec520b41
4 changed files with 40 additions and 8 deletions

View File

@ -42,8 +42,12 @@
.lazy = true,
},
.uucode = .{
.url = "https://github.com/jacobsandlund/uucode/archive/35c0a6b7d653fa91a46c5d0ca07f9742a466f0ad.tar.gz",
.hash = "uucode-0.0.0-ZZjBPn4dOwCKhxEJJqsTGrnmITqhnQvvISkhOXvSHcRE",
.url = "https://github.com/jacobsandlund/uucode/archive/7d851864a21d1d700d41230762de66f7b7fa5941.tar.gz",
.hash = "uucode-0.0.0-ZZjBPqk4OwDcGSplCRYO-zLKcs3FZ-jQGj9rfSEf6VZr",
},
.uucode_x = .{
.url = "https://github.com/jacobsandlund/uucode.x/archive/779492c4565ed282a7c989ffc7f52cbe060f17a3.tar.gz",
.hash = "uucode_x-0.0.0-5_D0j-gIAAC4SzTTunb6O4sqwj0kojbjV0rm2bj9QgyA",
},
.zig_wayland = .{
// codeberg ifreund/zig-wayland

View File

@ -21,17 +21,22 @@ uucode_tables_zig: std.Build.LazyPath,
pub const LazyPathList = std.ArrayList(std.Build.LazyPath);
pub fn init(b: *std.Build, cfg: *const Config) !SharedDeps {
const uucode_x = b.dependency("uucode_x", .{});
const uucode_x_config = uucode_x.module("uucode.x.config");
const uucode = b.dependency("uucode", .{
.build_config_path = b.path("src/build/uucode_build_config.zig"),
});
uucode.module("build_config").addImport("uucode.x.config", uucode_x_config);
uucode_x_config.addImport("config.zig", uucode.module("config.zig"));
uucode_x_config.addImport("types.zig", uucode.module("types.zig"));
var result: SharedDeps = .{
.config = cfg,
.help_strings = try .init(b, cfg),
.unicode_tables = try .init(b),
.framedata = try .init(b),
.uucode_tables_zig = b.dependency("uucode", .{
.table_0_fields = @as([]const []const u8, &[_][]const u8{
"general_category",
"has_emoji_presentation",
}),
}).namedLazyPath("tables.zig"),
.uucode_tables_zig = uucode.namedLazyPath("tables.zig"),
// Setup by retarget
.options = undefined,
@ -426,6 +431,7 @@ pub fn add(
.target = target,
.optimize = optimize,
.@"tables.zig" = self.uucode_tables_zig,
.x_root_path = b.path("src/build/uucode_x.zig"),
})) |dep| {
step.root_module.addImport("uucode", dep.module("uucode"));
}

View File

@ -0,0 +1,14 @@
const config = @import("config.zig");
const x = @import("uucode.x.config");
const d = config.default;
pub const tables = [_]config.Table{
.{
.extensions = &.{x.width},
.fields = &.{
x.width.field("width"),
d.field("general_category"),
d.field("has_emoji_presentation"),
},
},
};

8
src/build/uucode_x.zig Normal file
View File

@ -0,0 +1,8 @@
const get = @import("get.zig");
const tableFor = get.tableFor;
const data = get.data;
pub fn width(cp: u21) u2 {
const table = comptime tableFor("width");
return data(table, cp).width;
}