raylib: Fix audio

When upgrading from `4.2.0` to `4.5.0` in #243155 the audio fix was
removed. This fix didn't apply properly any more, because the `cmake`
build in `4.5.0` is producing shared objects with the wrong version in
the name.

The commit 0d4db7ad7f
which fixes the versioning issue does not appear to have made it into
the `4.5.0` tag.

Removing the audio fix did actually makes the project compile, however
when running games built against `raylib`, no audio device was found.
This commit is contained in:
Basile Henry 2023-07-16 21:43:43 +02:00
parent 2014e8cad0
commit 6fc1dc08de

View file

@ -37,6 +37,21 @@ stdenv.mkDerivation (finalAttrs: {
passthru.tests = [ raylib-games ];
patches = [
# Patch version in CMakeList to 4.5.0
# Remove this when updating to a new revision
(fetchpatch {
url = "https://github.com/raysan5/raylib/commit/0d4db7ad7f6fd442ed165ebf8ab8b3f4033b04e7.patch";
hash = "sha256-RGokbQAwJAZm2FU2VNwraE3xko8E+RLLFjUfDRXeKhA=";
})
];
# fix libasound.so/libpulse.so not being found
preFixup = ''
${lib.optionalString alsaSupport "patchelf --add-needed ${alsa-lib}/lib/libasound.so $out/lib/libraylib.so.${finalAttrs.version}"}
${lib.optionalString pulseSupport "patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libraylib.so.${finalAttrs.version}"}
'';
meta = with lib; {
description = "A simple and easy-to-use library to enjoy videogames programming";
homepage = "https://www.raylib.com/";