update scripts and mzte-nv to latest zig

This commit is contained in:
LordMZTE 2023-11-26 16:40:29 +01:00
parent d04f3bb2df
commit 04c2dfc98d
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
17 changed files with 32 additions and 32 deletions

View file

@ -16,8 +16,8 @@ opts.good_internet = true
-- Enable if stuck on garbage hardware. Enables wayland-related workarounds.
opts.nvidia = false
opts.font = "Iosevka Nerd Font"
opts.term_font = "IosevkaTerm Nerd Font Mono"
opts.font = "Iosevka NF"
opts.term_font = "IosevkaTerm NFM"
opts.term = {
name = "Wezterm",

View file

@ -4,8 +4,8 @@
.dependencies = .{
.znvim = .{
.url = "https://mzte.de/git/LordMZTE/znvim/archive/bce6595cc4a0867eea5403e2db927d8352a98d85.tar.gz",
.hash = "12203374d5927caa891985e5bfc02f60a2f066967606359a0b2e3863231af27b3023",
.url = "https://mzte.de/git/LordMZTE/znvim/archive/948e496ffd1222dd468db05d17176c757bbe9b92.tar.gz",
.hash = "122048ba32858a12ca090a5fb6f41e35878d2cb9c22b267c2256f6d9cc9724003f9a",
},
},
.paths = .{""},

View file

@ -76,7 +76,7 @@ pub fn doCompile(path: []const u8, alloc: std.mem.Allocator) !void {
defer files.deinit();
if ((try std.fs.cwd().statFile(path)).kind == .directory) {
var dir = try std.fs.cwd().openIterableDir(path, .{});
var dir = try std.fs.cwd().openDir(path, .{ .iterate = true });
defer dir.close();
var walker = try dir.walk(alloc);

View file

@ -24,7 +24,7 @@ fn lCopyBuf(l: *c.lua_State) !c_int {
// copy lines
var lnum: i32 = 1;
while (lnum < nvim.curbuf.*.b_ml.ml_line_count) : (lnum += 1) {
const line = nvim.ml_get_buf(nvim.curbuf, lnum, false) orelse return error.Buffer;
const line = nvim.ml_get_buf(nvim.curbuf, lnum) orelse return error.Buffer;
if (nvim.ml_append_buf(newbuf, lnum - 1, line, 0, false) == nvim.FAIL)
return error.Buffer;
}

View file

@ -35,7 +35,7 @@ const runtime_map = [_]Runtime{
};
fn lFindRuntimes(l: *c.lua_State) !c_int {
var jvmdir = try std.fs.openIterableDirAbsolute("/usr/lib/jvm/", .{});
var jvmdir = try std.fs.openDirAbsolute("/usr/lib/jvm/", .{ .iterate = true });
defer jvmdir.close();
c.lua_newtable(l);
@ -83,7 +83,7 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
);
defer std.heap.c_allocator.free(bundle_path);
var dir = std.fs.cwd().openIterableDir(bundle_path, .{}) catch |e| {
var dir = std.fs.cwd().openDir(bundle_path, .{ .iterate = true }) catch |e| {
if (e == error.FileNotFound) {
// Just return an empty table if the bundles dir doesn't exist
ser.luaPushAny(l, .{

View file

@ -51,7 +51,7 @@ pub fn luaPushAny(l: *c.lua_State, x: anytype) void {
},
.Array => luaPushAny(l, &x),
.Struct => |S| {
if (comptime std.meta.trait.hasFn("luaPush")(T)) {
if (comptime std.meta.hasFn(T, "luaPush")) {
return x.luaPush(l);
}

View file

@ -180,11 +180,11 @@ fn correctArgForReq(arena: *std.heap.ArenaAllocator, req: ArgRequirement, arg: *
const dirs = path_splits.items[0..cur_idx];
const dir_subpath = try std.fs.path.join(arena.allocator(), if (dirs.len == 0) &.{"."} else dirs);
var iterable_dir = try std.fs.cwd().openIterableDir(dir_subpath, .{});
var iterable_dir = try std.fs.cwd().openDir(dir_subpath, .{ .iterate = true });
defer iterable_dir.close();
// if the given file already exists, there's no point in iterating the dir
if (iterable_dir.dir.statFile(split.*)) |_| continue else |e| switch (e) {
if (iterable_dir.statFile(split.*)) |_| continue else |e| switch (e) {
error.FileNotFound => {},
else => return e,
}

View file

@ -95,7 +95,7 @@ pub fn populateEnvironment(env: *std.process.EnvMap) !bool {
icons: {
try msg("building $ICONPATH...", .{});
const path = "/usr/share/icons/candy-icons";
var dir = std.fs.openIterableDirAbsolute(path, .{}) catch {
var dir = std.fs.openDirAbsolute(path, .{ .iterate = true }) catch {
log.warn(
"Couldn't open candy-icons directory @ `{s}`, not setting ICONPATH",
.{path},

View file

@ -13,7 +13,7 @@ pub const ProcessQuery = struct {
};
pub fn query(alloc: std.mem.Allocator, queries: []ProcessQuery) !void {
var proc_dir = try std.fs.openIterableDirAbsolute("/proc", .{});
var proc_dir = try std.fs.openDirAbsolute("/proc", .{ .iterate = true });
defer proc_dir.close();
var proc_iter = proc_dir.iterate();

View file

@ -41,7 +41,7 @@ pub fn configLoaderThread(state: *State) !void {
const comment_trimmed = blk: {
const comment = line_iter.next() orelse break :blk null;
var comment_trimmed = std.mem.trim(u8, comment, " \n\r");
const comment_trimmed = std.mem.trim(u8, comment, " \n\r");
if (comment_trimmed.len == 0)
break :blk null;

View file

@ -19,7 +19,7 @@ pub fn launchChildren(state: *State, channel: []const u8) !void {
[]const u8,
&.{ "chatty", "-connect", "-channel", channel_d },
);
var chatty_child = std.ChildProcess.init(chatty_argv, std.heap.c_allocator);
const chatty_child = std.ChildProcess.init(chatty_argv, std.heap.c_allocator);
const chatty_thread = try std.Thread.spawn(
.{},

View file

@ -39,7 +39,7 @@ fn fetchChannelsLive(s: *State) !void {
@atomicStore(bool, &s.live_status_loading, true, .Unordered);
defer @atomicStore(bool, &s.live_status_loading, false, .Unordered);
log.info("initiaizing cURL", .{});
var curl = c.curl_easy_init();
const curl = c.curl_easy_init();
if (curl == null)
return error.CurlInitError;
defer c.curl_easy_cleanup(curl);

View file

@ -8,8 +8,8 @@
.hash = "1220647eea49d2c48d5e59354291e975f813be3cc5a9d9920a50bbfaa40a891a06ee",
},
.known_folders = .{
.url = "https://github.com/ziglibs/known-folders/archive/fa75e1bc672952efa0cf06160bbd942b47f6d59b.tar.gz",
.hash = "122048992ca58a78318b6eba4f65c692564be5af3b30fbef50cd4abeda981b2e7fa5",
.url = "https://github.com/ziglibs/known-folders/archive/8bb4bf761bab20ffed74ffac83c3a9eb4456f28d.tar.gz",
.hash = "122002462f37b67a54fa1ab712d870d4637dae0d94437c0077b148e1fb75616c573d",
},
},
.paths = .{""},

View file

@ -17,23 +17,23 @@ pub fn deinit(self: *Self) void {
self.files.deinit();
}
pub fn walk(self: *Self, dir: std.fs.IterableDir) anyerror!void {
pub fn walk(self: *Self, dir: std.fs.Dir) anyerror!void {
var iter = dir.iterate();
while (try iter.next()) |e| {
switch (e.kind) {
.file => {
const path = try dir.dir.realpathAlloc(self.filename_arena.allocator(), e.name);
const path = try dir.realpathAlloc(self.filename_arena.allocator(), e.name);
try self.files.append(path);
},
.directory => {
var subdir = try dir.dir.openIterableDir(e.name, .{});
var subdir = try dir.openDir(e.name, .{ .iterate = true });
defer subdir.close();
try self.walk(subdir);
},
.sym_link => {
var p_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const p = try dir.dir.readLink(e.name, &p_buf);
var subdir = dir.dir.openIterableDir(p, .{}) catch |err| {
const p = try dir.readLink(e.name, &p_buf);
var subdir = dir.openDir(p, .{ .iterate = true }) catch |err| {
switch (err) {
error.NotDir => {
const fpath = try self.filename_arena.allocator().dupe(u8, p);

View file

@ -15,9 +15,9 @@ pub fn main() !u8 {
defer walker.deinit();
try walker.walk(
try std.fs.openIterableDirAbsolute(
try std.fs.openDirAbsolute(
"/usr/share/backgrounds/",
.{},
.{ .iterate = true },
),
);
@ -44,7 +44,7 @@ fn walkLocalWps(walker: *Walker, home_s: []const u8) !void {
const wp_path = try std.fs.path.join(walker.files.allocator, &.{ home_s, ".local/share/backgrounds" });
defer walker.files.allocator.free(wp_path);
var local_wp = std.fs.cwd().openIterableDir(wp_path, .{}) catch |e| switch (e) {
var local_wp = std.fs.cwd().openDir(wp_path, .{ .iterate = true }) catch |e| switch (e) {
error.FileNotFound => {
std.log.warn(
"No local wallpaper directory @ {s}, skipping local wallpapers",

View file

@ -5,8 +5,8 @@
.dependencies = .{
.wayland = .{
.url = "https://git.mzte.de/LordMZTE/zig-wayland/archive/85722422985f928087e56d90c3617ecb04232486.tar.gz",
.hash = "1220d992b223e473988d203d66d262e54141b59559c09587eb00231c800d46f9b408",
.url = "https://git.mzte.de/LordMZTE/zig-wayland/archive/cbd535c4666a04f20bb303dc6485ec51d7db8bf5.tar.gz",
.hash = "1220d3aa22102fa17a6870d241a9541e6810d79d2a69c1ccca71ac90c825b26dd9e1",
}
}
}

View file

@ -4,12 +4,12 @@
.paths = .{""},
.dependencies = .{
.wayland = .{
.url = "https://git.mzte.de/LordMZTE/zig-wayland/archive/85722422985f928087e56d90c3617ecb04232486.tar.gz",
.hash = "1220d992b223e473988d203d66d262e54141b59559c09587eb00231c800d46f9b408",
.url = "https://git.mzte.de/LordMZTE/zig-wayland/archive/cbd535c4666a04f20bb303dc6485ec51d7db8bf5.tar.gz",
.hash = "1220d3aa22102fa17a6870d241a9541e6810d79d2a69c1ccca71ac90c825b26dd9e1",
},
.xev = .{
.url = "https://github.com/mitchellh/libxev/archive/5ecbc871f3bfa80fb7bf0fa853866cb93b99bc18.tar.gz",
.hash = "1220416854e424601ecc9814afb461a5dc9cf95db5917d82f794594a58ffc723b82c",
.url = "https://github.com/mitchellh/libxev/archive/7eada4333c36b3e16f4dc2abad707149ef7b6de5.tar.gz",
.hash = "1220be2c7b3f3a07b9150720140c7038f454a9ce0cbc5d303767c1e4a50856ec1b01",
},
},
}