Forwarded message: -------------------
I finally got an iBook and I want to start porting my games
to Mac. They use SDL and C++, and some custom Python build
scripts to make Linux (natively) and Win32 (cross-compiler)
binaries. I’d like to port this environment to the iBook.
I downloaded and installed XCode, so I have gcc. I also
downloaded Fink and I’m installing the SDL libs right now.
The big question is, what next? I hope to run my Python scripts
(which basically call g++) and be able to build Mac binaries. I
want them to run in OS X and up.
I have no idea about running Python/SDL binaries on Mac, but I’d
recommend you contact the PyGame (http://pygame.org/) folks, who have
obviously done some work on this. They also provide docs.
Some additional questions… sorry if you consider them off topic
but I couldn’t find a good “tutorial” on this.
How do I distribute an app built this way? In Win32 and Linux I
distribute the executable, the SDL shared libs, and some resource
files. In Mac I find I can install an “application” which seems
to be a whole directory tree. How are these things built? It’s just
a directory whose name ends in “.app”?
Essentially, yes, but with a special structure. And it’s important that
you care about the lib dependencies, too. For this reason, I always
static link my release binaries, that way, there is no hassle with
installing SDL libs. Your users will hate you if you force stuff like
that on them :-).
Some information about this topic can be round in README.MacOSX, you
should consult that first. Then, as am example, this is what
ScummVM.app looks like:
$ tree ScummVM.app/
-- Contents |-- Info.plist |-- MacOS |– scummvm
-- Resources– scummvm.icns
We create it with a simple hand written build rule. Look at this:
So no black magic…
The “Info.plist” file is an almost static XML file. In the case of SDL,
it is indeed fully static and in our CVS:
For exult, it is instead created from an “Info.plist.in” file which we
pass through sed to replace some stings (@VERSION@ for example).
The icon file is in the .icns format, you can find plenty of
information about it on the net; also apple ships an icon editor for
that format, as well as the ‘tiff2icns’ CLI util. There are converters
from/to .ico etc. available somewhere on the net, too.
Oh yes, you might notice a special target in the ScummVM Makefile,
which is used to generate a special static linked binary. Two notes:
- If you use autoconf/automake, obviously you’ll want to do this
differently. Exult also uses automake, but so far I haven’t gotten
around of creating an “exult-static” target for it; I’ll do that
- We use “
sdl-config --static-libs”, but note that this only works
correctly starting with SDL 1.2.7 ! I strongly recommend using SDL
1.2.7 when working on Mac OS X.
Another one, how do I build an installer? Is there any Mac-specific
"official" way, or people use third-party installer builders (the
equivalent of NSIS, for example)
Good mac apps do not need an installer. They are installed by drag &
drop. So a typical distribution format is to pack your application, the
docs, etc., into a folder; then either compress that folder (as a .sit,
or if you don’t make use of resource forks, you could also use .zip);
or nowadays even more common, people create a .dmg disk image file
(with Apple’s “Disk Copy”, resp. “Disk Utility” tool, or with
equivalent CLI commands). You then put your app on that virtual disk,
and distribute the .dmg file.
MaxAm 04.03.2004 um 05:41 schrieb Sam Lantinga:
Date: Wed, 3 Mar 2004 12:36:04 -0300
From: “Gabriel Gambetta”
Subject: [SDL] Mac OSX - HELP!