mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
Homebrew replaced its `sdl2` formula with `sdl2-compat`, a compatibility layer that provides the SDL2 API by `dlopen`-ing the real SDL3 library at runtime. The macOS CI build (`build-macos.yml`) pulls this via `brew install mpv`, so the app now links `libSDL2-2.0.0.dylib` which is actually `sdl2-compat`, and every nightly ships it in `Contents/Frameworks`. SDL3 is not a linker dependency, so it never shows up in `otool -L` output and the `CompleteBundleMac` fixup loop never copies it into the app bundle. At runtime `sdl2-compat` looks for `libSDL3.dylib` relative to its own loader path, cannot find it, prints "Failed loading SDL3 library." and aborts during dyld initialization, since the library is missing. This regression appeared once Homebrew's SDL2 became the `sdl2-compat` shim, so older nightly builds (built against genuine SDL2) are unaffected. This detects `sdl2-compat` inside the bundle (it is the only `libSDL2-2.0.0.dylib` containing the `libSDL3.dylib` loader string) and explicitly copies libSDL3 from the Homebrew prefix into `Contents/Frameworks/libSDL3.dylib`, using the same `install-id` convention as the other bundled dylibs so `codesign` and the existing fixup steps keep working. If SDL3 cannot be found at install time a warning is printed instead of failing silently. Fixes #1225