Skip to content

Fix bundle SDL2 for macOS releases - #1344

Open
Circa-III wants to merge 10 commits into
JACoders:masterfrom
Circa-III:master
Open

Circa-III wants to merge 10 commits into
JACoders:masterfrom
Circa-III:master

Conversation

@Circa-III

@Circa-III Circa-III commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Build SDL2 2.32.10 from source for macOS release builds and bundle it inside each generated application bundle.

  • Build a pinned SDL2 release during CI
  • Link OpenJK against the source-built SDL2
  • Bundle libSDL2-2.0.0.dylib into each .app
  • Preserve internal libraries for portable builds while excluding the Windows-only bundled SDL2 libraries
  • Verify the bundled SDL runtime during CI

Bundle libSDL3.dylib into each generated macOS application bundle to support Homebrew's sdl2-compat packaging.

- Install sdl2-compat and SDL3
- Bundle libSDL3.dylib into each .app
- Re-sign modified app bundles
- Verify bundled SDL runtime during CI
@Circa-III
Circa-III requested a review from a team as a code owner July 12, 2026 18:03
@Circa-III Circa-III changed the title Bundle SDL3 in macOS app bundles Build and bundle SDL2 for macOS releases Jul 29, 2026
@Circa-III

Copy link
Copy Markdown
Contributor Author

Ditched homebrew altogether for macos SDL2, uses a pinned SDL2 build and bundles that. Tested on macOS 27 Dev Beta 4 on a MacBook Pro (M3 Pro). I do not have an older intel Mac to test with.
Screenshot 2026-07-29 at 2 16 12 PM
Also tested other artifacts on ubuntu 64bit and windows 11 just in case I broke something on those OSes but they launch fine.

Download the official SDL2 2.32.10 macOS release, extract the architecture-specific dylib from SDL2.framework, and use it for OpenJK and OpenJO builds.

Verify that each generated app bundles the correct SDL2 dylib and does not retain Homebrew or CI build-path dependencies.
Download the official SDL2 macOS release, extract the correct architecture-specific dylib, and provide the CMake package metadata OpenJK expects.

Keep the existing external handling for zlib, libpng, and libjpeg, verify bundled macOS dependencies, and re-sign the generated application bundles.
@Circa-III

Copy link
Copy Markdown
Contributor Author

The whole build system is a pain in the ass but I got it. After discussing on discord, some of the devs prefer we pull SDL2 from the release DMG itself rather than build our own every time, so this final version does just that. Tested OpenJK and OpenJO, all should be good now.

@Circa-III Circa-III changed the title Build and bundle SDL2 for macOS releases Fix bundle SDL2 for macOS releases Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant