/nix/store/dlwqlnbaj5vfm9aw20r1yxk8y56lmgif-repo/header.tmpl

Compare commits

..

No commits in common. "56c09d0040b6cf24b905379861674dd247c6e19c" and "f77d372b778613a91a8d2ef16bf10a19220ad177" have entirely different histories.

6 changed files with 54 additions and 53 deletions

View file

@ -19,11 +19,7 @@ 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", .{});

View file

@ -37,12 +37,12 @@
// internet connectivity.
.dependencies = .{
.wayland = .{
.url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.4.0.tar.gz",
.hash = "wayland-0.4.0-lQa1khbMAQAsLS2eBR7M5lofyEGPIbu2iFDmoz8lPC27",
.url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.3.0.tar.gz",
.hash = "wayland-0.3.0-lQa1kjPIAQDmhGYpY-zxiRzQJFHQ2VqhJkQLbKKdt5wl",
},
.@"wlr-protocols" = .{
.url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#a741f0ac5d655338a5100fc34bc8cec87d237346",
.hash = "N-V-__8AAMm4AQANnGv8ZhQ9FX_ipu-oul8H7XP9WPD6r5KD",
.url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#2ec67ebd26b73bada12f3fa6afdd51563b656722",
.hash = "N-V-__8AAMm4AQBQdtoOaA3SHeMraj1_jhjp6KQJy4_dbQnz",
},
},
.paths = .{

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"lastModified": 1747327360,
"narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46",
"type": "github"
},
"original": {

View file

@ -1,43 +1,34 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
description = "A very basic flake";
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
];
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.wayland}/lib:$LD_LIBRARY_PATH
'';
};
}
);
};
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;
};
}

View file

@ -78,14 +78,15 @@ pub fn main() !void {
moveBuffer(casted, &context);
_ = display.flush();
if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed;
// std.os.sleep(5000000);
std.time.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.os.sleep(5000000);
std.time.sleep(5000000);
}
}

13
src/root.zig Normal file
View file

@ -0,0 +1,13 @@
//! 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);
}