raylib with DRM backend
All checks were successful
Build project / Build (push) Successful in 1m46s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2026-03-28 16:24:57 +02:00
parent d6e461b816
commit 34ee58d580
4 changed files with 41 additions and 18 deletions

1
Cargo.lock generated
View File

@@ -427,6 +427,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"midly", "midly",
"pkg-config",
"raylib", "raylib",
"serialport", "serialport",
] ]

View File

@@ -7,4 +7,7 @@ edition = "2024"
anyhow = "1.0.102" anyhow = "1.0.102"
midly = "0.5.3" midly = "0.5.3"
serialport = "4.9.0" serialport = "4.9.0"
raylib = { version = "5.5.1", default-features = false, features = ["wayland"] } raylib = { version = "5.5.1", features = ["nobuild"] }
[build-dependencies]
pkg-config = "0.3"

6
build.rs Normal file
View File

@@ -0,0 +1,6 @@
fn main() {
pkg_config::Config::new()
.atleast_version("5.0")
.probe("raylib")
.expect("failed to find system raylib via pkg-config");
}

View File

@@ -51,29 +51,42 @@
isDarwin = pkgs.stdenv.isDarwin; isDarwin = pkgs.stdenv.isDarwin;
x11Libs = with pkgs; [ raylibDrm = pkgs.raylib.overrideAttrs (_old: {
wayland cmakeFlags = [
#libX11 "-DCUSTOMIZE_BUILD=ON"
#libXcursor "-DBUILD_EXAMPLES=OFF"
#libXi "-DPLATFORM=DRM"
#libXrandr "-DINCLUDE_EVERYTHING=ON"
libxkbcommon "-DBUILD_SHARED_LIBS=ON"
]; ];
buildInputs = [
pkgs.libdrm
pkgs.libgbm
pkgs.libxkbcommon
pkgs.libinput
pkgs.udev
pkgs.libGL
];
propagatedBuildInputs = [
pkgs.libdrm
pkgs.libgbm
pkgs.libxkbcommon
pkgs.libinput
pkgs.udev
pkgs.libGL
];
NIX_CFLAGS_COMPILE = "-I${pkgs.libdrm.dev}/include/libdrm";
});
commonBuildInputs = with pkgs; commonBuildInputs = with pkgs;
[ [
openssl openssl
shaderc shaderc
raylibDrm
] ]
++ pkgs.lib.optionals (!isDarwin) ( ++ pkgs.lib.optionals (!isDarwin) [
[ llvmPackages.libclang
udev ];
libGL
glfw
llvmPackages.libclang
]
++ x11Libs
);
commonNativeBuildInputs = with pkgs; [ commonNativeBuildInputs = with pkgs; [
pkg-config pkg-config