From ce47a85bf7fc5550cc6083583bf6e2549f1824d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=92riks=20Remess?= Date: Fri, 10 Oct 2025 14:40:42 +0300 Subject: [PATCH] gtk4-layer-shell: version from build.zig.zon --- pkg/gtk4-layer-shell/build.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/gtk4-layer-shell/build.zig b/pkg/gtk4-layer-shell/build.zig index b9cf78a23..451ffe9a7 100644 --- a/pkg/gtk4-layer-shell/build.zig +++ b/pkg/gtk4-layer-shell/build.zig @@ -1,7 +1,6 @@ const std = @import("std"); -// TODO: Import this from build.zig.zon when possible -const version: std.SemanticVersion = .{ .major = 1, .minor = 1, .patch = 0 }; +const version = @import("build.zig.zon").version; const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{ .preferred_link_mode = .dynamic, @@ -32,6 +31,7 @@ pub fn build(b: *std.Build) !void { } fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Build.Step.Compile { + const lib_version = try std.SemanticVersion.parse(version); const target = options.target; const optimize = options.optimize; @@ -117,9 +117,9 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu .root = upstream.path("src"), .files = srcs, .flags = &.{ - b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{version.major}), - b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{version.minor}), - b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{version.patch}), + b.fmt("-DGTK_LAYER_SHELL_MAJOR={}", .{lib_version.major}), + b.fmt("-DGTK_LAYER_SHELL_MINOR={}", .{lib_version.minor}), + b.fmt("-DGTK_LAYER_SHELL_MICRO={}", .{lib_version.patch}), // Zig 0.14 regression: this is required because building with // ubsan results in unknown symbols. Bundling the ubsan/compiler