Skip to main content

MacSVNCompile — wiki

These instructions will guide you through the installation of pygame svn using macports where possible.

This article is WIP!

I'll assume you have macports installed successfully, otherwise follow the link above.

Grab SVN

The first time you grab pygame from svn it will download all the files:

svn co svn://seul.org/svn/pygame/trunk pygame

Ongoing, you simply need to update your local copy occasionally:

svn update

Download and Install

Grab macports packages:

sudo port install sdl-framework
sudo port install sdl_ttf-framework
sudo port install sdl_image-framework
sudo port install sdl_mixer-framework

if the last command is unsuccessful, download and install this:

http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.7.dmg

Download

First, get the following packages:

Tested with the latest python2.5 framework (included with OSX 10.5 Leopard):

Build and install

You will need to modify config_darwin.py to add the default include and library paths for macports.

Before

incdirs = ['/usr/local/include']
libdirs = ['/usr/local/lib']

After

incdirs = ['/usr/local/include','/opt/local/include']
libdirs = ['/usr/local/lib','/opt/local/lib']
python setup.py bdist_mpkg --open

Install Numeric

Unpack the tgz

tar xvzf Numeric-24.2.tar.gz
cd Numeric-24.2

In OSX Leopard, you will need to comment out three lines (152-154) in /Packages/RNG/Src/ranf.c

//#if !defined(__sgi)
//      int gettimeofday(struct timeval *, struct timezone *);
//#endif

Build and install

sudo python setup.py install

Install libjpeg

A note on i386-macs, download the pre-built universal binaries for libpng & jpeg from ethan.tira-thompson.com. Otherwise pygame won't build. It would probably also work if someone finds out what flags to use to build universal binaries from source.

Unpack the tgz

tar xvzf jpegsrc.v6b.tar.gz
cd jpeg-6b

Build and install

./configure
make
sudo make install-lib

Install libpng

Skip this step if you downloaded the pre-built universal binaries for libpng & jpeg

Unpack the tbz

tar xvjf libpng-1.2.16.tar.bz2
cd libpng-1.2.16

Build and install

./configure
make
sudo make install

Install pygame

Unpack the tgz

tar xvzf pygame-1.8.0rc3.tar.gz
cd pygame-1.8.0rc3

Configure

python config.py
The output should be:
Using Darwin configuration...

Hunting dependencies...
Framework SDL found
Framework SDL_ttf found
Framework SDL_image found
Framework SDL_mixer found
Framework smpeg not found
NUMERIC : found 24.2
PNG     : found
JPEG    : found

Edit Setup and put a '#' at the start of the line:

#scrap src/scrap.c $(SDL) $(X11)

Build pygame

python setup.py build

Install pygame

sudo python setup.py install

Enjoy!