From 6beabe5ce944ec9b275d81f789155e5837a5a199 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Fri, 27 Feb 2026 09:42:21 -0800 Subject: [PATCH] update srf dependency and clean up build.zig --- build.zig | 30 +++++++++++++++--------------- build.zig.zon | 7 ++++--- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/build.zig b/build.zig index b7d9979..f4fb4e7 100644 --- a/build.zig +++ b/build.zig @@ -20,25 +20,30 @@ pub fn build(b: *std.Build) void { .optimize = optimize, }); + const srf_mod = srf_dep.module("srf"); + // Library module -- the public API for consumers of zfin const mod = b.addModule("zfin", .{ .root_source_file = b.path("src/root.zig"), .target = target, .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) const tui_mod = b.addModule("tui", .{ .root_source_file = b.path("src/tui/main.zig"), .target = target, - .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") }, - }, + .imports = tui_imports, }); // Unified executable (CLI + TUI in one binary) @@ -50,7 +55,7 @@ pub fn build(b: *std.Build) void { .optimize = optimize, .imports = &.{ .{ .name = "zfin", .module = mod }, - .{ .name = "srf", .module = srf_dep.module("srf") }, + .{ .name = "srf", .module = srf_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"), .target = target, .optimize = optimize, - .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") }, - }, + .imports = tui_imports, }) }); test_step.dependOn(&b.addRunArtifact(tui_tests).step); @@ -96,7 +96,7 @@ pub fn build(b: *std.Build) void { .target = target, .optimize = optimize, .imports = &.{ - .{ .name = "srf", .module = srf_dep.module("srf") }, + .{ .name = "srf", .module = srf_mod }, }, }), }); diff --git a/build.zig.zon b/build.zig.zon index 1c06d0f..d4099e7 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -4,9 +4,6 @@ .fingerprint = 0x77a9b4c7d676e027, .minimum_zig_version = "0.15.2", .dependencies = .{ - .srf = .{ - .path = "../../srf", - }, .vaxis = .{ .url = "git+https://github.com/rockorager/libvaxis.git#67bbc1ee072aa390838c66caf4ed47edee282dc4", .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", .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 = .{ "build.zig",