From d923b295c8d164ee6600b2e4bcbec96be632039c Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 23 Sep 2025 23:23:25 +0200 Subject: [PATCH 1/2] update to zig 0.15 --- build.zig | 110 ++++++++++++++++---------------------------------- build.zig.zon | 2 +- 2 files changed, 36 insertions(+), 76 deletions(-) diff --git a/build.zig b/build.zig index d84be0f..e5cdca8 100644 --- a/build.zig +++ b/build.zig @@ -25,26 +25,44 @@ pub fn build(b: *Build) !void { const lua_src = b.dependency("lua", .{}); - const lib = - b.addStaticLibrary(artifactOptions( - .{ .shared = false }, - .{ .target = target, .optimize = optimize }, - )); + const lib = b.addLibrary(.{ + .name = lib_name, + .linkage = .static, + .root_module = b.createModule(.{ + .link_libc = true, + .optimize = optimize, + .target = target, + }), + }); const shared = if (build_shared) - b.addSharedLibrary(artifactOptions( - .{ .shared = true }, - .{ .target = target, .optimize = optimize }, - )) + b.addLibrary(.{ + .name = lib_name ++ "54", + .linkage = .dynamic, + .root_module = b.createModule(.{ + .link_libc = true, + .optimize = optimize, + .target = target, + .strip = if (target.result.os.tag == .windows) true else null, + }), + }) else null; - const exe = b.addExecutable(artifactOptions(.exe, .{ - .target = target, - .optimize = optimize, - })); - const exec = b.addExecutable(artifactOptions(.exec, .{ - .target = target, - .optimize = optimize, - })); + const exe = b.addExecutable(.{ + .name = exe_name, + .root_module = b.createModule(.{ + .link_libc = true, + .optimize = optimize, + .target = target, + }), + }); + const exec = b.addExecutable(.{ + .name = compiler_name, + .root_module = b.createModule(.{ + .link_libc = true, + .optimize = optimize, + .target = target, + }), + }); if (!target.result.isMinGW()) { lib.linkSystemLibrary("m"); exe.linkSystemLibrary("m"); @@ -170,64 +188,6 @@ pub fn build(b: *Build) !void { }); unpack_step.dependOn(&unpack_cmd.step); } -const ArtifactTarget = union(enum) { - // True if shared options - shared: bool, - exe, - exec, -}; -const ArtifactTargetOptions = struct { - target: ResolvedTarget, - optimize: OptimizeMode, -}; -fn artifactOptions(comptime options: ArtifactTarget, opts: ArtifactTargetOptions) switch (options) { - .exe, .exec => Build.ExecutableOptions, - .shared => |shared| if (shared) - Build.SharedLibraryOptions - else - Build.StaticLibraryOptions, -} { - const t = opts.target.result.os.tag; - return switch (options) { - .shared => |shared| if (shared) blk: { - switch (t) { - .windows => break :blk .{ - .name = lib_name ++ "54", - .target = opts.target, - .optimize = opts.optimize, - .strip = true, - }, - else => break :blk .{ - .name = lib_name, - .target = opts.target, - .optimize = opts.optimize, - }, - } - } else blk: { - switch (t) { - else => break :blk .{ - .name = lib_name, - .target = opts.target, - .optimize = opts.optimize, - }, - } - }, - .exe => switch (t) { - else => .{ - .name = exe_name, - .target = opts.target, - .optimize = opts.optimize, - }, - }, - .exec => switch (t) { - else => .{ - .name = compiler_name, - .target = opts.target, - .optimize = opts.optimize, - }, - }, - }; -} const cflags = [_][]const u8{ "-std=gnu99", diff --git a/build.zig.zon b/build.zig.zon index 2b6560b..f6c4e43 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,7 +3,7 @@ .version = "5.4.7", .fingerprint = 0xd671372bcadcaace, - .minimum_zig_version = "0.14.0", + .minimum_zig_version = "0.15.0", .dependencies = .{ .lua = .{ From d6254e14347da500947862c0d42993b49bf03c4e Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 23 Sep 2025 23:24:38 +0200 Subject: [PATCH 2/2] update to lua 5.4.8 --- build.zig | 2 +- build.zig.zon | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.zig b/build.zig index e5cdca8..3e635c9 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const OptimizeMode = std.builtin.OptimizeMode; const version = std.SemanticVersion{ .major = 5, .minor = 4, - .patch = 7, + .patch = 8, }; const lib_name = "lua"; const exe_name = lib_name ++ "_exe"; diff --git a/build.zig.zon b/build.zig.zon index f6c4e43..2b787c0 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,14 +1,14 @@ .{ .name = .lua, - .version = "5.4.7", + .version = "5.4.8", .fingerprint = 0xd671372bcadcaace, .minimum_zig_version = "0.15.0", .dependencies = .{ .lua = .{ - .url = "https://www.lua.org/ftp/lua-5.4.7.tar.gz", - .hash = "N-V-__8AAIMvFABt-Qcpk24RD10ldEN743D8Q2e19Er8x3dJ", + .url = "https://www.lua.org/ftp/lua-5.4.8.tar.gz", + .hash = "N-V-__8AAKEzFAAA695b9LXBhUSVK5MAV_VKSm1mEj3Acbze", }, },