mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
refactor: Use zig fetch for termbox2 dependency
Replaced the local `termbox2.h` header file with a proper dependency managed by the Zig package manager. This improves maintainability and makes it easier to track and update the library in the future. The previous `termbox2.h` contained a custom `tb_get_cell` function that is not present in the upstream repository. This function has been re-implemented in Zig (`src/tui/termbox_extras.zig`) to maintain compatibility, especially for the failed-login "cascade" animation. This change also involved updating `build.zig` and `build.zig.zon` to use the new dependency.
This commit is contained in:
@@ -68,13 +68,17 @@ pub fn build(b: *std.Build) !void {
|
||||
const clap = b.dependency("clap", .{ .target = target, .optimize = optimize });
|
||||
exe.root_module.addImport("clap", clap.module("clap"));
|
||||
|
||||
exe.addIncludePath(b.path("include"));
|
||||
const termbox_dep = b.dependency("termbox2", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
exe.linkSystemLibrary("pam");
|
||||
if (enable_x11_support) exe.linkSystemLibrary("xcb");
|
||||
exe.linkLibC();
|
||||
|
||||
const translate_c = b.addTranslateC(.{
|
||||
.root_source_file = b.path("include/termbox2.h"),
|
||||
.root_source_file = termbox_dep.path("termbox2.h"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user