Compare commits
5 commits
f77d372b77
...
56c09d0040
Author | SHA1 | Date | |
---|---|---|---|
![]() |
56c09d0040 | ||
![]() |
cde62a55b4 | ||
![]() |
5dbf48f488 | ||
![]() |
93eb2f5429 | ||
![]() |
8234885331 |
6 changed files with 53 additions and 54 deletions
|
@ -19,7 +19,11 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
const scanner = Scanner.create(b, .{});
|
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", .{});
|
const wlr_protocols = b.dependency("wlr-protocols", .{});
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,12 @@
|
||||||
// internet connectivity.
|
// internet connectivity.
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.wayland = .{
|
.wayland = .{
|
||||||
.url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.3.0.tar.gz",
|
.url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.4.0.tar.gz",
|
||||||
.hash = "wayland-0.3.0-lQa1kjPIAQDmhGYpY-zxiRzQJFHQ2VqhJkQLbKKdt5wl",
|
.hash = "wayland-0.4.0-lQa1khbMAQAsLS2eBR7M5lofyEGPIbu2iFDmoz8lPC27",
|
||||||
},
|
},
|
||||||
.@"wlr-protocols" = .{
|
.@"wlr-protocols" = .{
|
||||||
.url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#2ec67ebd26b73bada12f3fa6afdd51563b656722",
|
.url = "git+https://gitlab.freedesktop.org/wlroots/wlr-protocols.git#a741f0ac5d655338a5100fc34bc8cec87d237346",
|
||||||
.hash = "N-V-__8AAMm4AQBQdtoOaA3SHeMraj1_jhjp6KQJy4_dbQnz",
|
.hash = "N-V-__8AAMm4AQANnGv8ZhQ9FX_ipu-oul8H7XP9WPD6r5KD",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747327360,
|
"lastModified": 1757745802,
|
||||||
"narHash": "sha256-LSmTbiq/nqZR9B2t4MRnWG7cb0KVNU70dB7RT4+wYK4=",
|
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e06158e58f3adee28b139e9c2bcfcc41f8625b46",
|
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
35
flake.nix
35
flake.nix
|
@ -1,20 +1,29 @@
|
||||||
{
|
{
|
||||||
description = "A very basic flake";
|
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
|
||||||
inputs = {
|
outputs =
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
{
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {
|
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
} @ inputs: let
|
}@inputs:
|
||||||
|
let
|
||||||
inherit (inputs.nixpkgs) lib;
|
inherit (inputs.nixpkgs) lib;
|
||||||
eachSystem = lib.genAttrs (import inputs.systems);
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
eachSystem = lib.genAttrs systems;
|
||||||
pkgsFor = inputs.nixpkgs.legacyPackages;
|
pkgsFor = inputs.nixpkgs.legacyPackages;
|
||||||
in {
|
in
|
||||||
devShells =
|
{
|
||||||
lib.mapAttrs (system: pkgs: {
|
devShells = eachSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = pkgsFor.${system};
|
||||||
|
in
|
||||||
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
@ -28,7 +37,7 @@
|
||||||
export LD_LIBRARY_PATH=${pkgs.wayland}/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=${pkgs.wayland}/lib:$LD_LIBRARY_PATH
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
pkgsFor;
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,15 +78,14 @@ pub fn main() !void {
|
||||||
moveBuffer(casted, &context);
|
moveBuffer(casted, &context);
|
||||||
_ = display.flush();
|
_ = display.flush();
|
||||||
if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed;
|
if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed;
|
||||||
std.time.sleep(5000000);
|
// std.os.sleep(5000000);
|
||||||
}
|
}
|
||||||
for (0..segment) |i| {
|
for (0..segment) |i| {
|
||||||
// const casted: i32 = @intCast(i);
|
|
||||||
std.debug.print("smaller {}\n", .{(segment - i)});
|
std.debug.print("smaller {}\n", .{(segment - i)});
|
||||||
moveBuffer(@intCast(segment - i), &context);
|
moveBuffer(@intCast(segment - i), &context);
|
||||||
_ = display.flush();
|
_ = display.flush();
|
||||||
if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed;
|
if (display.dispatchPending() != .SUCCESS) return error.DispatchFailed;
|
||||||
std.time.sleep(5000000);
|
// std.os.sleep(5000000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
src/root.zig
13
src/root.zig
|
@ -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);
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue