Nix support
src/call-idle-handler.c change due to build failures because of -wall -werror
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,3 +2,5 @@ protocol/*.c
|
||||
protocol/*.h
|
||||
*.o
|
||||
riverguile
|
||||
/result
|
||||
/.direnv
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
SCANNER := wayland-scanner
|
||||
|
||||
PREFIX=/usr/local
|
||||
PREFIX=${out}
|
||||
BINDIR=$(PREFIX)/bin
|
||||
DATADIR=$(PREFIX)/share
|
||||
MODULEDIR=$(DATADIR)/guile/3.0
|
||||
|
||||
40
default.nix
Normal file
40
default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{pkgs ? import <nixpkgs> {}}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "riverguile";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://git.sr.ht/~leon_plickat/riverguile/";
|
||||
rev = "744ce4b1eb5950d0dc795d64bfac6b7738eec6f1";
|
||||
hash = "sha256-80XVaq+17Vu+DAs7pjt3cu5wiK37680A7S6qIulPRLc=";
|
||||
};
|
||||
patches = [
|
||||
(pkgs.writeText "nix-build.patch" ''
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 915f7ac..ff2b3c2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
SCANNER := wayland-scanner
|
||||
|
||||
-PREFIX=/usr/local
|
||||
+PREFIX=''${out}
|
||||
BINDIR=$(PREFIX)/bin
|
||||
DATADIR=$(PREFIX)/share
|
||||
MODULEDIR=$(DATADIR)/guile/3.0
|
||||
diff --git a/src/call-idle-handler.c b/src/call-idle-handler.c
|
||||
index 727656e..b4d4474 100644
|
||||
--- a/src/call-idle-handler.c
|
||||
+++ b/src/call-idle-handler.c
|
||||
@@ -8,7 +8,7 @@ static void *call_idle_handler_inner (void *data)
|
||||
struct Call_idle_handler_parameters *params =
|
||||
(struct Call_idle_handler_parameters *)data;
|
||||
|
||||
- SCM event;
|
||||
+ SCM event = { 0 };
|
||||
switch (params->event)
|
||||
{
|
||||
case IDLE: event = scm_from_utf8_symbol("idle"); break;
|
||||
'')
|
||||
];
|
||||
buildInputs = with pkgs; [wayland-scanner wayland guile];
|
||||
nativeBuildInputs = [pkgs.pkg-config];
|
||||
}
|
||||
39
flake.lock
generated
Normal file
39
flake.lock
generated
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1741513245,
|
||||
"narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=",
|
||||
"path": "/nix/store/g4ppspdl4fy7hnp4jgjl4ll03v7i08w3-source",
|
||||
"rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "systems",
|
||||
"type": "indirect"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
13
flake.nix
Normal file
13
flake.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
outputs = { nixpkgs, systems, ... }: let
|
||||
lib = nixpkgs.lib;
|
||||
eachSystem = f: lib.genAttrs (import systems) (system: f { pkgs = nixpkgs.legacyPackages.${system}; });
|
||||
in {
|
||||
packages = eachSystem (p: {
|
||||
default = import ./. p;
|
||||
});
|
||||
devShells = eachSystem (p: {
|
||||
default = import ./. p;
|
||||
});
|
||||
};
|
||||
}
|
||||
4
shell.nix
Normal file
4
shell.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell {
|
||||
inputsFrom = [(import ./. {inherit pkgs;})];
|
||||
packages = [pkgs.clang-tools];
|
||||
}
|
||||
@@ -8,7 +8,7 @@ static void *call_idle_handler_inner (void *data)
|
||||
struct Call_idle_handler_parameters *params =
|
||||
(struct Call_idle_handler_parameters *)data;
|
||||
|
||||
SCM event;
|
||||
SCM event = { 0 };
|
||||
switch (params->event)
|
||||
{
|
||||
case IDLE: event = scm_from_utf8_symbol("idle"); break;
|
||||
|
||||
Reference in New Issue
Block a user