在最近的Google Groups 帖子中,Russell Owen 概述了他如何为 Mac OS X 10.6 (Snow Leopard) 构建 64 位版本的PyGame 1.9.1,并且还提供了预构建的 64 位 PyGame OS X 二进制文件的 URL dmg文件!
pygame-1.9.1release-py2.7-python.org-macosx10.6.dmg
罗素的指示是:
Building pygame 1.9.1 on Mac OS X 10.6 using XCode 3.2.6
2012-04-12
I was building this for a binary distribution that would run against python.org's 64-bit Python 2.7.2, for use on Mac OS X 10.6 and later.
* Install dependencies:
- libjpeg (use ./configure, make, sudo make install)
- SDL and extra packages (use precompiled framework builds):
- SDL
- SDL_mixer
- SDL_image
- SDL_ttf
- portmidi (use CMake as per the instructions)
* Delete shared libraries in /usr/local/lib (if you want to build a binary installer that can be used elsewhere).
* Check for /usr/local/lib/portmidi.a and if not found, make it a symlink from /usr/local/lib/portmidi_s.a or whatever portmidi got installed.
* Modify config_darwin.py to include '/usr/X11/include' and '/usr/X11/lib':
incdirs = ['/usr/X11/include', '/usr/local/include']
libdirs = ['/usr/X11/lib/', '/usr/local/lib']
(since libpng and libfreetype are standard in /usr/X11)
* Configure pygame and make sure it finds everything:
python config.py
As of 2012-04-12 on Mac OS X 10.6 I found that png was NOT found. I have no idea why, but I went ahead and installed it manually.
Also SCRAP is not found, but apparently that is normal for Mac OS X.
* Build pygame normally
python setup.py build
bdist_mpkg (or sudo python setup.py install if you don't want a binary installer)
希望这些说明适用于更新版本的 OS X 和 XCode(如果可以,请告诉我们)。
谢谢