From b39eaf2aa700ae5adae3cc5a66d03d1bca4a4f65 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Wed, 10 Jul 2024 10:39:35 +0300 Subject: Update zig --- build.zig | 14 ++++---------- build.zig.zon | 10 ++++++---- src/Installation.zig | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/build.zig b/build.zig index f1159b0..20ac769 100644 --- a/build.zig +++ b/build.zig @@ -20,10 +20,7 @@ pub fn build(b: *Build) void { const exe = b.addExecutable(.{ .name = "zup", .version = version, - .root_source_file = .{ .src_path = .{ - .owner = b, - .sub_path = "src/main.zig", - } }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); @@ -43,10 +40,7 @@ pub fn build(b: *Build) void { run_step.dependOn(&run_cmd.step); const exe_tests = b.addTest(.{ - .root_source_file = .{ .src_path = .{ - .owner = b, - .sub_path = "src/main.zig", - } }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); @@ -55,7 +49,7 @@ pub fn build(b: *Build) void { test_step.dependOn(&exe_tests.step); } -const default_version = SemanticVersion.parse("0.2.1") catch unreachable; +const default_version = SemanticVersion.parse("0.5.0") catch unreachable; fn getVersion(b: *Build) SemanticVersion { var out_code: u8 = undefined; @@ -70,7 +64,7 @@ fn getVersion(b: *Build) SemanticVersion { const ver_str = switch (std.mem.count(u8, git_desc, "-")) { 0 => git_desc, 2 => blk: { - var it = std.mem.split(u8, git_desc, "-"); + var it = std.mem.splitScalar(u8, git_desc, '-'); const tag = it.next() orelse unreachable; const height = it.next() orelse unreachable; const hash = it.next() orelse unreachable; diff --git a/build.zig.zon b/build.zig.zon index 2d7a69c..30c1f64 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -9,12 +9,14 @@ .hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b", }, .libarchive = .{ - .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-0.4.0.tar.xz", - .hash = "1220b21cc99fca50b7fa495191a17abe440dc8229aa3bc5a638c4a0f2ffdceccbdda", + // .path = "../zig-libarchive", + .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-3d457c968af4ddcb3bc89965272b46fc2aa91452.tar.xz", + .hash = "1220c60a6aa308f9541fa460cb42a43c5e011ce141b52bd1e01fd8fac7e347edee60", }, .xdg = .{ - .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-0.4.0.tar.xz", - .hash = "12206c1b6e163e79b83eb1e6cb1d575b256e603a0bbf9c2726e6f3235028eabbff41", + // .path = "../zig-xdg", + .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-7a1fe22046e374461c37fb232dca0a1a1733a532.tar.xz", + .hash = "12200288bfff905e157599e189cd44f14d34cbb544e2c126696dbbc71c5ddaf9058e", }, }, } diff --git a/src/Installation.zig b/src/Installation.zig index 6e2e120..6c44089 100644 --- a/src/Installation.zig +++ b/src/Installation.zig @@ -45,7 +45,7 @@ pub fn getActiveName(allocator: Allocator) !?[]u8 { var bin_home = try xdg.openBinHome(allocator); defer bin_home.close(); - var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + var buf: [std.fs.max_path_bytes]u8 = undefined; const linkname = bin_home.readLink("zig", &buf) catch |err| { if (err == error.NotLink or err == error.FileNotFound) { return null; -- cgit v1.2.3