update srf dependency and clean up build.zig

This commit is contained in:
Emil Lerch 2026-02-27 09:42:21 -08:00
parent 2bad8a9f09
commit 6beabe5ce9
Signed by: lobo
GPG key ID: A7B62D657EF764F8
2 changed files with 19 additions and 18 deletions

View file

@ -20,25 +20,30 @@ pub fn build(b: *std.Build) void {
.optimize = optimize, .optimize = optimize,
}); });
const srf_mod = srf_dep.module("srf");
// Library module -- the public API for consumers of zfin // Library module -- the public API for consumers of zfin
const mod = b.addModule("zfin", .{ const mod = b.addModule("zfin", .{
.root_source_file = b.path("src/root.zig"), .root_source_file = b.path("src/root.zig"),
.target = target, .target = target,
.imports = &.{ .imports = &.{
.{ .name = "srf", .module = srf_dep.module("srf") }, .{ .name = "srf", .module = srf_mod },
}, },
}); });
// Shared TUI imports (used by the TUI module and its tests)
const tui_imports: []const std.Build.Module.Import = &.{
.{ .name = "zfin", .module = mod },
.{ .name = "srf", .module = srf_mod },
.{ .name = "vaxis", .module = vaxis_dep.module("vaxis") },
.{ .name = "z2d", .module = z2d_dep.module("z2d") },
};
// TUI module (imported by the unified binary) // TUI module (imported by the unified binary)
const tui_mod = b.addModule("tui", .{ const tui_mod = b.addModule("tui", .{
.root_source_file = b.path("src/tui/main.zig"), .root_source_file = b.path("src/tui/main.zig"),
.target = target, .target = target,
.imports = &.{ .imports = tui_imports,
.{ .name = "zfin", .module = mod },
.{ .name = "srf", .module = srf_dep.module("srf") },
.{ .name = "vaxis", .module = vaxis_dep.module("vaxis") },
.{ .name = "z2d", .module = z2d_dep.module("z2d") },
},
}); });
// Unified executable (CLI + TUI in one binary) // Unified executable (CLI + TUI in one binary)
@ -50,7 +55,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize, .optimize = optimize,
.imports = &.{ .imports = &.{
.{ .name = "zfin", .module = mod }, .{ .name = "zfin", .module = mod },
.{ .name = "srf", .module = srf_dep.module("srf") }, .{ .name = "srf", .module = srf_mod },
.{ .name = "tui", .module = tui_mod }, .{ .name = "tui", .module = tui_mod },
}, },
}), }),
@ -79,12 +84,7 @@ pub fn build(b: *std.Build) void {
.root_source_file = b.path("src/tui/main.zig"), .root_source_file = b.path("src/tui/main.zig"),
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.imports = &.{ .imports = tui_imports,
.{ .name = "zfin", .module = mod },
.{ .name = "srf", .module = srf_dep.module("srf") },
.{ .name = "vaxis", .module = vaxis_dep.module("vaxis") },
.{ .name = "z2d", .module = z2d_dep.module("z2d") },
},
}) }); }) });
test_step.dependOn(&b.addRunArtifact(tui_tests).step); test_step.dependOn(&b.addRunArtifact(tui_tests).step);
@ -96,7 +96,7 @@ pub fn build(b: *std.Build) void {
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.imports = &.{ .imports = &.{
.{ .name = "srf", .module = srf_dep.module("srf") }, .{ .name = "srf", .module = srf_mod },
}, },
}), }),
}); });

View file

@ -4,9 +4,6 @@
.fingerprint = 0x77a9b4c7d676e027, .fingerprint = 0x77a9b4c7d676e027,
.minimum_zig_version = "0.15.2", .minimum_zig_version = "0.15.2",
.dependencies = .{ .dependencies = .{
.srf = .{
.path = "../../srf",
},
.vaxis = .{ .vaxis = .{
.url = "git+https://github.com/rockorager/libvaxis.git#67bbc1ee072aa390838c66caf4ed47edee282dc4", .url = "git+https://github.com/rockorager/libvaxis.git#67bbc1ee072aa390838c66caf4ed47edee282dc4",
.hash = "vaxis-0.5.1-BWNV_IxJCQC5OGNaXQfNnqgn9_Vku0PMgey-dplubcQK", .hash = "vaxis-0.5.1-BWNV_IxJCQC5OGNaXQfNnqgn9_Vku0PMgey-dplubcQK",
@ -15,6 +12,10 @@
.url = "git+https://github.com/vancluever/z2d?ref=v0.10.0#6d1d7bda6b696c0941d204e6042f1e8ee900e001", .url = "git+https://github.com/vancluever/z2d?ref=v0.10.0#6d1d7bda6b696c0941d204e6042f1e8ee900e001",
.hash = "z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ", .hash = "z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ",
}, },
.srf = .{
.url = "git+https://git.lerch.org/lobo/srf.git#c4a59cfbd3bb8a0157cdd6a49e1a1ef24439460e",
.hash = "srf-0.0.0-qZj572f9AADFQvNOFZ6Ls2C_7i53CJj4kjYZ4CY9wiJ0",
},
}, },
.paths = .{ .paths = .{
"build.zig", "build.zig",