Use zig packed versions of zlib-ng, lz4, and zstd.

Changed use_c_libs to use_zig_decomp so c libraries are now default
This commit is contained in:
Caleb J. Gardner
2026-03-18 05:24:58 -05:00
parent 8b8c9a772f
commit 50cae8b63d
4 changed files with 42 additions and 23 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ const OffsetFile = @import("util/offset_file.zig");
const XattrTable = @import("xattr.zig");
const config = if (builtin.is_test) .{
.use_c_libs = true,
.use_zig_decomp = !builtin.link_libc,
.allow_lzo = false,
} else @import("config");
@@ -45,8 +45,8 @@ pub fn init(alloc: std.mem.Allocator, fil: File, offset: u64) !Archive {
.lzma => Decomp.lzmaDecompress,
.xz => Decomp.xzDecompress,
.zstd => Decomp.zstdDecompress,
.lz4 => if (config.use_c_libs) Decomp.cLz4 else return error.Lz4Unsupported,
.lzo => if (config.use_c_libs and config.allow_lzo) Decomp.lzoDecompress else return error.LzoUnsupported,
.lz4 => if (!config.use_zig_decomp) Decomp.cLz4 else return error.Lz4Unsupported,
.lzo => if (!config.use_zig_decomp and config.allow_lzo) Decomp.lzoDecompress else return error.LzoUnsupported,
};
return .{
.alloc = alloc,