Adding framework builds to SDL formulas?

I’d like to write a formula for the DXX-Rebirth project to get it added to Homebrew, but there’s a bit of a challenge involved: it depends on the framework versions of SDL, SDL_image, and SDL_mixer. These currently aren’t built by the formulas for those libraries, so just installing them from Homebrew doesn’t allow the code to compile. Grabbing the frameworks from the SDL site and installing them as well, however, does.

There are a couple of options I can think of regarding adding the framework version: grab them from the DMGs provided by the SDL project, or figure out what the SDL Xcode projects to build the frameworks are doing, and replicate the commands in the applicable formulas.

I’m guessing that option #1 would be a non-starter, given that the DMGs are unlikely to be updated for ARM-based Macs, so that leaves updating the formula. I wanted to check before attempting to tackle this, though . . . would a modification to these formulas to manually construct the frameworks be likely to be accepted into Homebrew?

At least for 1.2, it’s unlikely that the codebase will change significantly enough to break a formula doing that, given that they haven’t had a real release in more than eight years, so it seems like it’d be pretty safe, but I was hoping to get some thoughts first before putting a bunch of time into it.

Option 1 wouldn’t work, but not for the reason you’re expecting. Anything homebrew ships is open source software, so therefore downloading a dmg would be disallowed. It would need to be build from source.

If you can make a modification that makes this scenario work, is tested and doesn’t break anything else I’d be happy to review it.

Sounds good. I’ll start investigating this, then, and see what I can come up with.

Thanks!

The two options I can see here are:

  1. Get sdl, sdl_image, and sdl_mixer to also build frameworks.
  2. Get dxx-rebirth to permit linking against non-framework installs of sdl, sdl_image, and sdl_mixer.

My guess is that #2 will be much easier to do. It’ll probably involve sending a patch upstream to dxx-rebirth to tweak their build system.

I’m still working on #1 since I think it’d be worthwhile, but I did end up doing #2 as a stopgap. So, there’s a build flag in their codebase now to use *NIX-style headers and libraries for builds rather than frameworks on macOS.