Commit 1478dc2a authored by flurie's avatar flurie
Browse files

SDL_audiolib: unbundle fmt to fix build on darwin

parent c6fee018
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  pkg-config,
  stdenv,
  flac,
  fmt,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -29,10 +30,20 @@ stdenv.mkDerivation (finalAttrs: {
  buildInputs = [
    SDL2
    flac
    fmt
  ];

  strictDeps = true;

  postPatch = ''
    # Remove the bundled fmt directory
    rm -rf 3rdparty/fmt

    # Patch CMakeLists.txt to replace bundled fmt with provided library
    substituteInPlace CMakeLists.txt \
      --replace-fail 'add_bundled_fmtlib()' 'find_package(fmt REQUIRED)'
  '';

  cmakeFlags = [
    (lib.cmakeBool "USE_DEC_ADLMIDI" false)
    (lib.cmakeBool "USE_DEC_BASSMIDI" false)