Support Zig 0.14.0 only (with 1 downstream dependency fork)

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-03-05 19:42:00 +01:00
parent 346a614ba0
commit bebccf4d5a
7 changed files with 46 additions and 26 deletions

View File

@@ -3,7 +3,7 @@ const builtin = @import("builtin");
const PatchMap = std.StringHashMap([]const u8);
const min_zig_string = "0.12.0";
const min_zig_string = "0.14.0";
const current_zig = builtin.zig_version;
// Implementing zig version detection through compile time
@@ -22,8 +22,6 @@ var prefix_directory: []const u8 = undefined;
var executable_name: []const u8 = undefined;
var default_tty_str: []const u8 = undefined;
const ProgressNode = if (current_zig.minor == 12) *std.Progress.Node else std.Progress.Node;
pub fn build(b: *std.Build) !void {
dest_directory = b.option([]const u8, "dest_directory", "Specify a destination directory for installation") orelse "";
config_directory = b.option([]const u8, "config_directory", "Specify a default config directory (default is /etc). This path gets embedded into the binary") orelse "/etc";
@@ -123,7 +121,7 @@ pub fn build(b: *std.Build) !void {
pub fn ExeInstaller(install_conf: bool) type {
return struct {
pub fn make(step: *std.Build.Step, _: ProgressNode) !void {
pub fn make(step: *std.Build.Step, _: std.Build.Step.MakeOptions) !void {
try install_ly(step.owner.allocator, install_conf);
}
};
@@ -139,7 +137,7 @@ const InitSystem = enum {
pub fn ServiceInstaller(comptime init_system: InitSystem) type {
return struct {
pub fn make(step: *std.Build.Step, _: ProgressNode) !void {
pub fn make(step: *std.Build.Step, _: std.Build.Step.MakeOptions) !void {
const allocator = step.owner.allocator;
var patch_map = PatchMap.init(allocator);
@@ -311,7 +309,7 @@ fn install_ly(allocator: std.mem.Allocator, install_config: bool) !void {
}
}
pub fn uninstallall(step: *std.Build.Step, _: ProgressNode) !void {
pub fn uninstallall(step: *std.Build.Step, _: std.Build.Step.MakeOptions) !void {
const allocator = step.owner.allocator;
try deleteTree(allocator, config_directory, "/ly", "ly config directory not found");