Commit f3c6af0
committed
fix(macos): bundle SDL3 for sdl2-compat at install time
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 #12251 parent 9fad78e commit f3c6af0
1 file changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
233 | 272 | | |
234 | 273 | | |
235 | 274 | | |
| |||
0 commit comments