diff --git a/pkgs/by-name/ra/raylib/package.nix b/pkgs/by-name/ra/raylib/package.nix index 5fee6c4498df..7bb97094f440 100644 --- a/pkgs/by-name/ra/raylib/package.nix +++ b/pkgs/by-name/ra/raylib/package.nix @@ -11,11 +11,13 @@ raylib-games, libGLU, libx11, + libxrandr, platform ? "Desktop", # Note that "Web", "Android" and "Raspberry Pi" do not currently work pulseSupport ? stdenv.hostPlatform.isLinux, alsaSupport ? false, sharedLib ? true, includeEverything ? true, + customFrameControlSupport ? false, }: let inherit (lib) optional; @@ -36,13 +38,13 @@ lib.checkListOfEnum "raylib: platform" __structuredAttrs = true; pname = "raylib"; - version = "5.5-unstable-2026-01-20"; + version = "6.0"; src = fetchFromGitHub { owner = "raysan5"; repo = "raylib"; - rev = "c610d228a244f930ad53492604640f39584c66da"; - hash = "sha256-7Lhgqb7QJwz94M1ZxWgueTwIgSVclGCvHklZXGzoJgQ="; + rev = finalAttrs.version; + hash = "sha256-8+6MDTMc7Spix4ndAUzp51Q5iWcl7pQmyXuV2RutnOk="; }; # autoPatchelfHook is needed for appendRunpaths @@ -56,11 +58,17 @@ lib.checkListOfEnum "raylib: platform" propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libGLU libx11 + libxrandr ]; # https://github.com/raysan5/raylib/wiki/CMake-Build-Options cmakeFlags = [ "-DCUSTOMIZE_BUILD=ON" + # The above also enables `SUPPORT_CUSTOM_FRAME_CONTROL` (otherwise off) + # That skips `SwapScreenBuffer` and `PollInputEvents` from `EndDrawing` + # In turn, normal `raylib-games` demos start but never present a window + # Keep the default game loop behavior unless explicitly requested + (lib.cmakeBool "SUPPORT_CUSTOM_FRAME_CONTROL" customFrameControlSupport) "-DPLATFORM=${platform}" ] ++ optional (platform == "Desktop") "-DUSE_EXTERNAL_GLFW=ON"