diff --git a/justfile b/justfile index 33b1ed8..c60140b 100644 --- a/justfile +++ b/justfile @@ -22,8 +22,8 @@ install-scripts target=(`echo $HOME` + "/.local"): cd scripts/vinput && zig build -Doptimize=ReleaseFast -p {{target}} cd scripts/playtwitch && zig build -Doptimize=ReleaseFast -p {{target}} cd scripts/openbrowser && zig build -Doptimize=ReleaseFast -p {{target}} - cd scripts/prompt && gyro build -Doptimize=ReleaseFast -p {{target}} - cd scripts/mzteinit && gyro build -Doptimize=ReleaseFast -p {{target}} + cd scripts/prompt && zig build -Doptimize=ReleaseFast -p {{target}} + cd scripts/mzteinit && zig build -Doptimize=ReleaseFast -p {{target}} install-lsps-paru: #!/bin/sh diff --git a/scripts/mzteinit/build.zig.zon b/scripts/mzteinit/build.zig.zon index d4fd6b3..3ad6a75 100644 --- a/scripts/mzteinit/build.zig.zon +++ b/scripts/mzteinit/build.zig.zon @@ -4,8 +4,8 @@ .dependencies = .{ .ansi_term = .{ - .url = "https://github.com/ziglibs/ansi-term/archive/3238ee3600775a0d2ed52fa5bf30669daebd47cd.tar.gz", - .hash = "122054a0aadb65c0b51e0d2b6083272c8ccd59abe83469425c3ea03030e450df4625", + .url = "https://github.com/ziglibs/ansi-term/archive/84b2a92970bc3328b1366abb3bffd677bd681669.tar.gz", + .hash = "1220d454469ddc251e46fff3b2b11f7016deb54bc5cd8618e809a09a4b1f5304f555", }, }, } diff --git a/scripts/playtwitch/build.zig b/scripts/playtwitch/build.zig index d062c68..77bef34 100644 --- a/scripts/playtwitch/build.zig +++ b/scripts/playtwitch/build.zig @@ -1,19 +1,16 @@ const std = @import("std"); pub fn build(b: *std.build.Builder) void { - // Standard target options allows the person running `zig build` to choose - // what target to build for. Here we do not override the defaults, which - // means any target is allowed, and the default is native. Other options - // for restricting supported target set are available. const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); - // Standard release options allow the person running `zig build` to select - // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. - const mode = b.standardReleaseOptions(); - - const exe = b.addExecutable("playtwitch", "src/main.zig"); - exe.setTarget(target); - exe.setBuildMode(mode); + //const exe = b.addExecutable("playtwitch", "src/main.zig"); + const exe = b.addExecutable(.{ + .name = "playtwitch", + .root_source_file = .{ .path = "src/main.zig" }, + .target = target, + .optimize = optimize, + }); exe.linkLibC(); exe.linkSystemLibrary("cimgui"); @@ -21,7 +18,7 @@ pub fn build(b: *std.build.Builder) void { exe.linkSystemLibrary("glew"); exe.linkSystemLibrary("curl"); - exe.strip = mode != .Debug; + exe.strip = optimize != .Debug and optimize != .ReleaseSafe; exe.install(); @@ -45,11 +42,4 @@ pub fn build(b: *std.build.Builder) void { const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); - - const exe_tests = b.addTest("src/main.zig"); - exe_tests.setTarget(target); - exe_tests.setBuildMode(mode); - - const test_step = b.step("test", "Run unit tests"); - test_step.dependOn(&exe_tests.step); } diff --git a/scripts/playtwitch/build.zig.zon b/scripts/playtwitch/build.zig.zon deleted file mode 100644 index 1a6a73d..0000000 --- a/scripts/playtwitch/build.zig.zon +++ /dev/null @@ -1,11 +0,0 @@ -.{ - .name = "playtwitch", - .version = "0.0.0", - - .dependencies = .{ - .glib_log = .{ - .url = "https://mzte.de/git/LordMZTE/zig-glib-log/archive/1db0367ce69812a71003d99cf29a0698d71f2ab4.tar.gz", - .hash = "00000000000000000000000000000000000000000000000000000000000000000000", - }, - }, -} diff --git a/scripts/playtwitch/src/gui.zig b/scripts/playtwitch/src/gui.zig index 6ae998e..aac1a63 100644 --- a/scripts/playtwitch/src/gui.zig +++ b/scripts/playtwitch/src/gui.zig @@ -153,7 +153,7 @@ pub fn winContent(state: *State) !void { _ = c.igTableSetColumnIndex(2); c.igTableHeader("Live?"); - for (state.channels.?) |entry, i| { + for (state.channels.?, 0..) |entry, i| { c.igPushID_Int(@intCast(c_int, i)); defer c.igPopID(); diff --git a/scripts/prompt/build.zig.zon b/scripts/prompt/build.zig.zon index dcf6ece..2ac7a72 100644 --- a/scripts/prompt/build.zig.zon +++ b/scripts/prompt/build.zig.zon @@ -4,12 +4,12 @@ .dependencies = .{ .ansi_term = .{ - .url = "https://github.com/ziglibs/ansi-term/archive/3238ee3600775a0d2ed52fa5bf30669daebd47cd.tar.gz", - .hash = "122054a0aadb65c0b51e0d2b6083272c8ccd59abe83469425c3ea03030e450df4625", + .url = "https://github.com/ziglibs/ansi-term/archive/84b2a92970bc3328b1366abb3bffd677bd681669.tar.gz", + .hash = "1220d454469ddc251e46fff3b2b11f7016deb54bc5cd8618e809a09a4b1f5304f555", }, .known_folders = .{ - .url = "https://github.com/ziglibs/known-folders/archive/53fe3b676f32e59d46f4fd201d7ab200e5f6cb98.tar.gz", - .hash = "12203e18503cd0fa097a4404b0c4f8535a68536886b536ae51c786455238ba5f183b", + .url = "https://github.com/ziglibs/known-folders/archive/d13ba6137084e55f873f6afb67447fe8906cc951.tar.gz", + .hash = "122028c00915d9b37296059be8a3883c718dbb5bd174350caedf152fed1f46f99607", }, }, } diff --git a/scripts/prompt/src/FishMode.zig b/scripts/prompt/src/FishMode.zig index 672462a..bd37bf9 100644 --- a/scripts/prompt/src/FishMode.zig +++ b/scripts/prompt/src/FishMode.zig @@ -15,7 +15,7 @@ mode: Mode, const Self = @This(); pub fn parse(s: []const u8) Self { - inline for (@typeInfo(Mode).Enum.fields) |field, i| { + inline for (@typeInfo(Mode).Enum.fields, 0..) |field, i| { if (std.mem.eql(u8, field.name, s)) return .{ .mode = @intToEnum(Mode, i) }; }