From d35d3d12961185ebbb774ac347b2a230c48f1590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:30:06 -0400 Subject: [PATCH] raylib: fix missing sound --- pkgs/development/libraries/raylib/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/raylib/default.nix b/pkgs/development/libraries/raylib/default.nix index 64e327ec34af..874a05357ca9 100644 --- a/pkgs/development/libraries/raylib/default.nix +++ b/pkgs/development/libraries/raylib/default.nix @@ -19,6 +19,7 @@ , includeEverything ? true , raylib-games , darwin +, autoPatchelfHook }: let inherit (darwin.apple_sdk.frameworks) Carbon Cocoa OpenGL; @@ -34,7 +35,10 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-gEstNs3huQ1uikVXOW4uoYnIDr5l8O9jgZRTX1mkRww="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ + autoPatchelfHook + cmake + ]; buildInputs = [ glfw ] ++ lib.optionals stdenv.isLinux [ mesa libXi libXcursor libXrandr libXinerama ] @@ -58,15 +62,19 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Patch version in CMakeLists.txt to 5.0.0 # The library author doesn't use cmake, so when updating this package please - # check that the resulting library extension matches the version - # and remove/update this patch (resulting library name should match - # libraylib.so.${finalAttrs.version} + # check that the resulting library extension matches the package version + # and remove/update this patch (fetchpatch { url = "https://github.com/raysan5/raylib/commit/032cc497ca5aaca862dc926a93c2a45ed8017737.patch"; hash = "sha256-qsX5AwyQaGoRsbdszOO7tUF9dR+AkEFi4ebNkBVHNEY="; }) ]; + # fix libasound.so/libpulse.so not being found + appendRunpaths = [ + (lib.makeLibraryPath (lib.optional alsaSupport alsa-lib ++ lib.optional pulseSupport libpulseaudio)) + ]; + meta = with lib; { description = "Simple and easy-to-use library to enjoy videogames programming"; homepage = "https://www.raylib.com/";