~andreafeletto/public-inbox

zig-udev: update to zig 0.12.0 v1 PROPOSED

Sven Püschel: 2
 update to zig 0.12.0
 Added support for the Zig package manager

 4 files changed, 23 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~andreafeletto/public-inbox/patches/51795/mbox | git am -3
Learn more about email & git

[PATCH zig-udev 1/2] update to zig 0.12.0 Export this patch

---
 README.md | 2 +-
 udev.zig  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index f672e00..684f239 100644
--- a/README.md
+++ b/README.md
@@ -4,4 +4,4 @@ Idiomatic [Zig](https://ziglang.org/) bindings for `libudev`.

## Dependencies

* [zig](https://ziglang.org/) 0.9.0
* [zig](https://ziglang.org/) 0.12.0
diff --git a/udev.zig b/udev.zig
index 671a0fe..54949e0 100644
--- a/udev.zig
+++ b/udev.zig
@@ -296,7 +296,7 @@ pub const Monitor = opaque {
    }

    extern fn udev_monitor_get_fd(*Monitor) c_int;
    pub fn getFd(self: *Monitor) Error!std.os.fd_t {
    pub fn getFd(self: *Monitor) Error!std.posix.fd_t {
        const ret = udev_monitor_get_fd(self);
        if (ret < 0) return error.Generic;
        return @intCast(ret);
@@ -505,7 +505,7 @@ pub const Queue = opaque {
    pub const getQueueIsEmpty = udev_queue_get_queue_is_empty;

    extern fn udev_queue_get_fd(*Queue) c_int;
    pub fn getFd(self: *Queue) Error!std.os.fd_t {
    pub fn getFd(self: *Queue) Error!std.posix.fd_t {
        const ret = udev_queue_get_fd(self);
        if (ret < 0) return error.Generic;
        return @intCast(ret);
-- 
2.45.0

[PATCH zig-udev 2/2] Added support for the Zig package manager Export this patch

---
 build.zig     |  7 +++++++
 build.zig.zon | 13 +++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 build.zig
 create mode 100644 build.zig.zon

diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..61a8587
--- /dev/null
@@ -0,0 +1,7 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
    _ = b.addModule("udev", .{
        .root_source_file = .{ .path = "udev.zig" },
    });
}
diff --git a/build.zig.zon b/build.zig.zon
new file mode 100644
index 0000000..3964914
--- /dev/null
@@ -0,0 +1,13 @@
.{
    .name = "zig-udev",
    .version = "0.1.0",
    .minimum_zig_version = "0.12.0",
    .dependencies = .{},
    .paths = .{
        "build.zig",
        "build.zig.zon",
        "README.md",
        "LICENSE",
        "udev.zig",
    },
}
-- 
2.45.0