OSX SDL2_mixer code sign issue (bundle format is ambiguous)

I’m trying to build an OSX app which uses SDL2_mixer. If I try to include the SDL2_mixer.framework in my bundle, with hardened runtime enabled as required by Apple, I can’t compile cause Xcode says SDL2_mixer is not “signed at all”.

If I try to manually sign SDL2_mixer, I have to sign every framework it includes in turn (the several Ogg frameworks). But trying to sign any of these frameworks gives me the following error

Ogg.framework: bundle format is ambiguous (could be app or framework)

I tried with the pre-built framework from https://www.libsdl.org/projects/SDL_mixer/ as well as building from source in XCode. I also tried lipo -remove i386 an all the frameworks included by SDL2_mixer but nothing works so far.

Has anyone run into this or have any pointers?

I ran into this a while back. Was never able to solve it, and gave up on SDL_mixer.

I haven’t looked at it, but that error message sounds like the
Ogg.framework is malformed in some way. The usual culprits are:

  • It is missing certain directories or symlinks
  • Things that should be symlinks got turned into full directories
    (e.g. perhaps the file got copied to a FAT filesystem like on a USB
    key)
  • Info.plist is missing or is missing certain entries

I would recommend looking a valid framework (e.g. SDL2.framework) and
comparing the structure/layout for differences.

The way I got it working (for now) is by manually adding:

<key>CFBundleSupportedPlatforms</key>
<array>
	<string>MacOSX</string>
</array>

to every framework which doesn’t have it, inside the SDL2_mixer.framework. Then I have to still sign these frameworks (which I do thru a custom command in CMake).

As of now though it’s not clear to me where does the SDL2_mixer.framework Xcode project (from source) gets the other frameworks from (so as to update those instead of manually adding to their plists). There are makefiles for the libs it uses (Vorbis, Ogg, FLAC, etc) but no Xcode or CMake stuff…