diff --git a/.gitignore b/.gitignore index d8ac5aa..54f3479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ hashtree/ zig-out/ -.zig-cache/ \ No newline at end of file +.zig-cache/zig-pkg/ +.zig-cache/ +zig-pkg/ diff --git a/build.zig b/build.zig index d1bfbec..2464306 100644 --- a/build.zig +++ b/build.zig @@ -16,19 +16,19 @@ pub fn build(b: *std.Build) void { }), }); - const assembly_flags_default = &.{ "-g", "-fpic" }; - var assembly_flags = std.ArrayList([]const u8).init(b.allocator); - assembly_flags.appendSlice(assembly_flags_default) catch unreachable; + const assembly_flags_default: []const []const u8 = &.{ "-g", "-fpic" }; + var assembly_flags = std.ArrayListUnmanaged([]const u8).empty; + assembly_flags.appendSlice(b.allocator, assembly_flags_default) catch unreachable; if (!target.result.cpu.arch.isAARCH64()) { - assembly_flags.append("-fno-integrated-as") catch unreachable; + assembly_flags.append(b.allocator, "-fno-integrated-as") catch unreachable; } // Add the assembly and C source files // Only arm64 and x86 architectures have optimized assembly implementations. // All other architectures will use the generic fallback C implementation. - lib.addCSourceFiles(.{ + lib.root_module.addCSourceFiles(.{ .root = upstream.path("src"), .files = if (target.result.cpu.arch.isArm() or target.result.cpu.arch.isAARCH64()) &[_][]const u8{ @@ -50,7 +50,7 @@ pub fn build(b: *std.Build) void { .flags = assembly_flags.items, }); - lib.addCSourceFiles(.{ + lib.root_module.addCSourceFiles(.{ .root = upstream.path("src"), .files = &[_][]const u8{ "hashtree.c", @@ -62,7 +62,7 @@ pub fn build(b: *std.Build) void { "-Werror", }, }); - lib.addIncludePath(upstream.path("src")); + lib.root_module.addIncludePath(upstream.path("src")); lib.installHeader(upstream.path("src/hashtree.h"), "hashtree.h"); b.installArtifact(lib); diff --git a/build.zig.zon b/build.zig.zon index cd86e49..2a9074e 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.1.0", .dependencies = .{ .hashtree = .{ - .url = "git+https://github.com/offchainlabs/hashtree#f733b7698511b5498b722421a30ddf7e5066497c", - .hash = "N-V-__8AANPhDADGDLYAKqml8U-1jREHVH_-5vi9Mcwsf6oi", + .url = "git+https://github.com/lodekeeper-z/hashtree#c7588605b811de790a45d5dfafafc0e712854528", + .hash = "N-V-__8AAD7KDwAJhkERKP7udCdwtbZyt7nOUr8-MibaEgCN", }, }, .fingerprint = 0xf963e115bea813b0,