SDL2 template for Xcode 3.2

I’m trying to build an SDL2 project on OS-X 10.6 (Snow Leopard) - I know it’s ancient but it’s all I’ve got at the moment - and although I can successfully build a ‘command line’ project I haven’t managed to create any sort of distributable app. Does anybody have an Xcode 3.2 template for SDL2 that might help me?

Richard.

Not sure if you solved your problem yet, but just in case:

For my own project, I have a little script that wraps the usual
configure/make/make install steps to populate a proper application bundle.
There are some caveats, of course: it requires that all 3rd party libs
reside in /usr/local (so no using of SDL in Framework form) and when using
the dynamic loading feature of, say SDL_mixer, a wrapper script is required
to properly set the DYLD_LIBRARY_PATH before running the actual executable.
Also, no codesigning, at present.

Here’s the script (GPL v2, so feel free to modify to your needs):

http://cvs.savannah.gnu.org/viewvc/adonthell-0.3/make_bundle.sh?root=adonthell&view=markup

And here’s the resulting bundle:

http://download.savannah.gnu.org/releases/adonthell/adonthell-0.3.6-osx-beta1.dmg

(Actually, there is a second part to creating the bundle, as the required
data files are separate. So there is a second script the adds the remaining
stuff. But for a normal application, where everything is in one build tree,
the first script should suffice). Second part here:

http://cvs.savannah.gnu.org/viewvc/wastesedge/make_bundle.sh?root=adonthell&view=markup

There’s also a brief documentation for the process:

http://cvs.savannah.gnu.org/viewvc/adonthell-0.3/README.MacOSX?root=adonthell&view=markup

Hope that helps,

KaiOn Sat, Jul 2, 2016 at 2:00 PM, rtrussell wrote:

I’m trying to build an SDL2 project on OS-X 10.6 (Snow Leopard) - I know
it’s ancient but it’s all I’ve got at the moment - and although I can
successfully build a ‘command line’ project I haven’t managed to create any
sort of distributable app. Does anybody have an Xcode 3.2 template for SDL2
that might help me?

Richard.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Kai Sterker wrote:

Not sure if you solved your problem yet

Yes, I think I’ve got it sorted. Firstly I made an app bundle manually by creating the appropriate directory structure (MyApp.app/Contents/MacOS/executable); that runs my program OK but only on the development machine because it is expecting to find SDL2.framework in /Library/Frameworks/. Next I copied the SDL frameworks into MyApp.app/Contents/Frameworks/ and added the search path @loader_path/…/Frameworks to the xcode build configuration; now the app runs even without the frameworks being in /Library/Frameworks/. Finally I signed the app using codesign.

I’ve not yet tried to distribute the app as a .dmg, but I’m hopeful that the above steps have resulted in a valid self-contained bundle. Can you see anything that I’ve missed?

Richard.

[…]

I’ve not yet tried to distribute the app as a .dmg, but I’m hopeful that

the above steps have resulted in a valid self-contained bundle. Can you see
anything that I’ve missed?

Yours are basically the same steps my script is performing (without the
codesign). So yes, I think this should work fine as a self-contained
application bundle.

I would assume that all this can also be automated via your XCode project,
but since I am more at home on the command line I cannot really help you
there. I usually do my programming on Linux, and just boot up my old
Macbook to create the OSX binaries when the main work is done. Haven’t
touched XCode in years.

KaiOn Tue, Jul 5, 2016 at 3:39 PM, rtrussell wrote: