The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
How to get an SDL game on the Mac AppStore
SeanOConnor


Joined: 15 Jun 2016
Posts: 9
It took me just a couple of hours to get my Windows C++ SDL game (https://youtu.be/ysRtdalURDw) up and running on MacOS. But, I'm stumped as to how to package it up and get it on the Mac AppStore. I've Googled everywhere and can't find anything helpful.

All of my PNGs, WAVs and MP3s are stored as separate files so that SDL can load them. But I can't see how you combine all of them and the executable file to make a package for the AppStore? Or is there a way of building those resource files into the executable file itself?

I guess you don't need to include any SDL Mac equivalent 'DLL' files? Do those all get built into the executable file via the Frameworks?

Does anyone know of a good tutorial or got any advice? Help!
How to get an SDL game on the Mac AppStore
Jonny D


Joined: 12 Sep 2009
Posts: 932
I guess it starts with your build tools.  Are you using Xcode?  If so, packaging, signing, and submitting is all done there.

Assets should be copied into the app bundle (e.g. in a Copy Bundle Resources build phase).  Frameworks and loose libraries (OS X uses .dylib instead of .dll) that do not come with OS X can be copied in a separate build phase, though you may need to attend to the rpath/Runpath Search Paths.


Jonny D




On Tue, Sep 13, 2016 at 9:22 AM, SeanOConnor wrote:
Quote:
It took me just a couple of hours to get my Windows C++ SDL game (https://youtu.be/ysRtdalURDw) up and running on MacOS. But, I'm stumped as to how to package it up and get it on the Mac AppStore. I've Googled everywhere and can't find anything helpful.

All of my PNGs, WAVs and MP3s are stored as separate files so that SDL can load them. But I can't see how you combine all of them and the executable file to make a package for the AppStore? Or is there a way of building those resource files into the executable file itself?

I guess you don't need to include any SDL Mac equivalent 'DLL' files? Do those all get built into the executable file via the Frameworks?

Does anyone know of a good tutorial or got any advice? Help!


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

campbelljc


Joined: 13 Sep 2015
Posts: 2
To elaborate, if you're not using Xcode, you can write the whole process up into your Makefile. Basically, create the app bundle yourself. I've copied a few excerpts from my makefile below:

OUTPUTPATH=/Build/Release/
BUNDLE=$(OUTPUTPATH)/$(PROGRAM).app
mkdir -p $(BUNDLE)/Contents
mkdir -p $(BUNDLE)/Contents/MacOS
mkdir -p $(BUNDLE)/Contents/Resources
mkdir -p $(BUNDLE)/Contents/Frameworks

Copy frameworks like SDL:

cp -RH /Library/Frameworks/SDL2.framework $(BUNDLE)/Contents/Frameworks/
rm -fr $(BUNDLE)/Contents/Frameworks/SDL2.framework/Versions/A/Headers/
rm -fr $(BUNDLE)/Contents/Frameworks/SDL2.framework/Headers

Copy assets, icon file, Info.plist, etc., into resources folder:

cp license*.txt $(BUNDLE)/Contents/Resources
cp -f $(ICONFILE) $(BUNDLE)/Contents/Resources/$(ICONFILE)
cp Info.plist $(BUNDLE)/Contents/Resources

Create the executable from your object files and place in MacOS directory:

clang++ -o $(BUNDLE)/Contents/MacOS/$(PROGRAM) $(OBJECTS) $(LDFLAGS)

Change resource path of SDL (not sure why but this is necessary):

install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2 $(BUNDLE)/Contents/MacOS/$(PROGRAM)

Codesign (entitlements if necessary):

codesign -f -v -s "3rd Party Mac Developer Application: xxx" "$(BUNDLE)/Contents/Frameworks/SDL2.framework/Versions/A/SDL2"
codesign -f -v -s "3rd Party Mac Developer Application: xxx" --entitlements entitlements.plist "$(BUNDLE)"

Create pkg file:

MASPKGFILENAME=$(PROGRAM)-$(PROGVER).pkg
cd $(OUTPUTPATH) && productbuild --component "gamename" /Applications --sign "3rd Party Mac Developer Installer: xxx" "$(MASPKGFILENAME)"

Hope that helps in case there's something you didn't know. It's all pretty arcane...
SeanOConnor


Joined: 15 Jun 2016
Posts: 9
I'm using Xcode but every time I hit Archive, it archives it all and brings up the Organizer window but the "Upload to App Store..." button is greyed out.
How to get an SDL game on the Mac AppStore
Jonny D


Joined: 12 Sep 2009
Posts: 932
Do you have a Mac Developer account that is able to publish on the App Store?

Jonny D


On Fri, Oct 7, 2016 at 9:35 AM, SeanOConnor wrote:
Quote:
I'm using Xcode but every time I hit Archive, it archives it all and brings up the Organizer window but the "Upload to App Store..." button is greyed out.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org