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:// 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:


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 to add the default include and library paths for macports.


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


incdirs = ['/usr/local/include','/opt/local/include']
libdirs = ['/usr/local/lib','/opt/local/lib']
python 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 *);

Build and install

sudo python install

Install libjpeg

A note on i386-macs, download the pre-built universal binaries for libpng & jpeg from 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

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

sudo make install

Install pygame

Unpack the tgz

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


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 build

Install pygame

sudo python install