Skip to content

Commit 96a08cd

Browse files
committed
build: update for Zig 0.15.1
1 parent ae62fb5 commit 96a08cd

File tree

3 files changed

+37
-43
lines changed

3 files changed

+37
-43
lines changed

build.zig

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ pub fn build(b: *std.Build) !void {
1111
const target = b.standardTargetOptions(.{});
1212
const optimize = b.standardOptimizeOption(.{});
1313

14-
_ = b.addModule("xev", .{ .root_source_file = b.path("src/main.zig") });
14+
_ = b.addModule("xev", .{
15+
.root_source_file = b.path("src/main.zig"),
16+
});
1517

1618
const emit_man = b.option(
1719
bool,
@@ -170,8 +172,9 @@ fn buildBenchmarks(
170172
b: *std.Build,
171173
target: std.Build.ResolvedTarget,
172174
) ![]const *Step.Compile {
173-
var steps = std.ArrayList(*Step.Compile).init(b.allocator);
174-
defer steps.deinit();
175+
const alloc = b.allocator;
176+
var steps: std.ArrayList(*Step.Compile) = .empty;
177+
defer steps.deinit(alloc);
175178

176179
var dir = try std.fs.cwd().openDir(try b.build_root.join(
177180
b.allocator,
@@ -208,10 +211,10 @@ fn buildBenchmarks(
208211
exe.root_module.addImport("xev", b.modules.get("xev").?);
209212

210213
// Store the mapping
211-
try steps.append(exe);
214+
try steps.append(alloc, exe);
212215
}
213216

214-
return try steps.toOwnedSlice();
217+
return try steps.toOwnedSlice(alloc);
215218
}
216219

217220
fn buildExamples(
@@ -220,8 +223,9 @@ fn buildExamples(
220223
optimize: std.builtin.OptimizeMode,
221224
c_lib_: ?*Step.Compile,
222225
) ![]const *Step.Compile {
223-
var steps = std.ArrayList(*Step.Compile).init(b.allocator);
224-
defer steps.deinit();
226+
const alloc = b.allocator;
227+
var steps: std.ArrayList(*Step.Compile) = .empty;
228+
defer steps.deinit(alloc);
225229

226230
var dir = try std.fs.cwd().openDir(try b.build_root.join(
227231
b.allocator,
@@ -287,15 +291,16 @@ fn buildExamples(
287291
};
288292

289293
// Store the mapping
290-
try steps.append(exe);
294+
try steps.append(alloc, exe);
291295
}
292296

293-
return try steps.toOwnedSlice();
297+
return try steps.toOwnedSlice(alloc);
294298
}
295299

296300
fn manPages(b: *std.Build) ![]const *Step {
297-
var steps = std.ArrayList(*Step).init(b.allocator);
298-
defer steps.deinit();
301+
const alloc = b.allocator;
302+
var steps: std.ArrayList(*Step) = .empty;
303+
defer steps.deinit(alloc);
299304

300305
var dir = try std.fs.cwd().openDir(try b.build_root.join(
301306
b.allocator,
@@ -315,11 +320,11 @@ fn manPages(b: *std.Build) ![]const *Step {
315320
b.fmt("docs/{s}", .{entry.name}),
316321
) });
317322

318-
try steps.append(&b.addInstallFile(
323+
try steps.append(alloc, &b.addInstallFile(
319324
cmd.captureStdOut(),
320325
b.fmt("share/man/man{s}/{s}", .{ section, base }),
321326
).step);
322327
}
323328

324-
return try steps.toOwnedSlice();
329+
return try steps.toOwnedSlice(alloc);
325330
}

flake.lock

Lines changed: 17 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
description = "libxev is a high performance, cross-platform event loop.";
33

44
inputs = {
5-
nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
6-
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5+
nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz";
76
flake-utils.url = "github:numtide/flake-utils";
87
zig.url = "github:mitchellh/zig-overlay";
98

@@ -24,11 +23,7 @@
2423
# Other overlays
2524
(final: prev: rec {
2625
zigpkgs = inputs.zig.packages.${prev.system};
27-
zig = inputs.zig.packages.${prev.system}."0.14.1";
28-
29-
# Latest versions
30-
wasmtime = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.wasmtime;
31-
wasmer = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.wasmer;
26+
zig = inputs.zig.packages.${prev.system}."0.15.1";
3227

3328
# Our package
3429
libxev = prev.callPackage ./nix/package.nix {};

0 commit comments

Comments
 (0)