Skip to content

Commit

Permalink
raylib: Fix audio
Browse files Browse the repository at this point in the history
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 raysan5/raylib@0d4db7a
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.
  • Loading branch information
basile-henry committed Jul 20, 2023
1 parent 2014e8c commit 6fc1dc0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/development/libraries/raylib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
Expand Down

0 comments on commit 6fc1dc0

Please sign in to comment.