From 823488533166d8e03d7bd7eecd835507ae32d4cc Mon Sep 17 00:00:00 2001 From: faukah Date: Wed, 17 Sep 2025 12:41:01 +0200 Subject: [PATCH 1/5] nix: update {flake, inputs} --- flake.lock | 6 ++--- flake.nix | 69 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 7c684b0..07af524 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1747327360, - "narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=", + "lastModified": 1757745802, + "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46", + "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c9ba8a5..86029f0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,34 +1,43 @@ { - description = "A very basic flake"; + inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - }; + outputs = + { + self, + nixpkgs, + }@inputs: + let + inherit (inputs.nixpkgs) lib; + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + eachSystem = lib.genAttrs systems; + pkgsFor = inputs.nixpkgs.legacyPackages; + in + { + devShells = eachSystem ( + system: + let + pkgs = pkgsFor.${system}; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + pkg-config + wayland-scanner + zig + wayland + wayland-protocols + ]; - outputs = { - self, - nixpkgs, - } @ inputs: let - inherit (inputs.nixpkgs) lib; - eachSystem = lib.genAttrs (import inputs.systems); - pkgsFor = inputs.nixpkgs.legacyPackages; - in { - devShells = - lib.mapAttrs (system: pkgs: { - default = pkgs.mkShell { - packages = with pkgs; [ - pkg-config - wayland-scanner - zig - wayland - wayland-protocols - ]; - - shellHook = '' - export LD_LIBRARY_PATH=${pkgs.wayland}/lib:$LD_LIBRARY_PATH - ''; - }; - }) - pkgsFor; - }; + shellHook = '' + export LD_LIBRARY_PATH=${pkgs.wayland}/lib:$LD_LIBRARY_PATH + ''; + }; + } + ); + }; } From 93eb2f54294efa6fc2e6579eb6fad4440c1fd238 Mon Sep 17 00:00:00 2001 From: faukah Date: Wed, 17 Sep 2025 13:12:34 +0200 Subject: [PATCH 2/5] root.zig: delete --- src/root.zig | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 src/root.zig diff --git a/src/root.zig b/src/root.zig deleted file mode 100644 index 27d2be8..0000000 --- a/src/root.zig +++ /dev/null @@ -1,13 +0,0 @@ -//! By convention, root.zig is the root source file when making a library. If -//! you are making an executable, the convention is to delete this file and -//! start with main.zig instead. -const std = @import("std"); -const testing = std.testing; - -pub export fn add(a: i32, b: i32) i32 { - return a + b; -} - -test "basic add functionality" { - try testing.expect(add(3, 7) == 10); -} From 5dbf48f48857896c3fdb1cec7285b57832ca1098 Mon Sep 17 00:00:00 2001 From: faukah Date: Wed, 17 Sep 2025 13:12:41 +0200 Subject: [PATCH 3/5] build.zig.zon: update deps --- build.zig.zon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 8143475..91e85c3 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -37,12 +37,12 @@ // internet connectivity. .dependencies = .{ .wayland = .{ - .url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.3.0.tar.gz", - .hash = "wayland-0.3.0-lQa1kjPIAQDmhGYpY-zxiRzQJFHQ2VqhJkQLbKKdt5wl", + .url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.4.0.tar.gz", + .hash = "wayland-0.4.0-lQa1khbMAQAsLS2eBR7M5lofyEGPIbu2iFDmoz8lPC27", }, .@"wlr-protocols" = .{ - .url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#2ec67ebd26b73bada12f3fa6afdd51563b656722", - .hash = "N-V-__8AAMm4AQBQdtoOaA3SHeMraj1_jhjp6KQJy4_dbQnz", + .url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#a741f0ac5d655338a5100fc34bc8cec87d237346", + .hash = "N-V-__8AAMm4AQANnGv8ZhQ9FX_ipu-oul8H7XP9WPD6r5KD", }, }, .paths = .{ From cde62a55b4fccf6ce84bd8c9510b93c8912bc872 Mon Sep 17 00:00:00 2001 From: faukah Date: Wed, 17 Sep 2025 13:12:52 +0200 Subject: [PATCH 4/5] build.zig: reformat --- build.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index e49ac35..8d04b8e 100644 --- a/build.zig +++ b/build.zig @@ -19,7 +19,11 @@ pub fn build(b: *std.Build) void { const scanner = Scanner.create(b, .{}); - const wayland = b.createModule(.{ .root_source_file = scanner.result, .target = target, .optimize = optimize }); + const wayland = b.createModule(.{ + .root_source_file = scanner.result, + .target = target, + .optimize = optimize, + }); const wlr_protocols = b.dependency("wlr-protocols", .{}); From 56c09d0040b6cf24b905379861674dd247c6e19c Mon Sep 17 00:00:00 2001 From: faukah Date: Wed, 17 Sep 2025 13:13:02 +0200 Subject: [PATCH 5/5] main.zig: fix compilation --- src/main.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index 1b8728f..3fc1950 100644 --- a/src/main.zig +++ b/src/main.zig @@ -78,15 +78,14 @@ pub fn main() !void { moveBuffer(casted, &context); _ = display.flush(); if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed; - std.time.sleep(5000000); + // std.os.sleep(5000000); } for (0..segment) |i| { - // const casted: i32 = @intCast(i); std.debug.print("smaller {}\n", .{(segment - i)}); moveBuffer(@intCast(segment - i), &context); _ = display.flush(); if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed; - std.time.sleep(5000000); + // std.os.sleep(5000000); } }