Pygame Development with Eclipse and Mac OS X Lion

This tutorial will explain how to get pygame installed correctly on Mac OS X Lion and additionally how to configure the install with pyDev in eclipse. If you are only interested in one of these two things, have no fear this tutorial won't waste your time. The eclipse specific information is at the bottom of the page all by itself. I decided to write this after struggling through installing pygame on my own machine. I owe many thanks to, and borrowed heavily from, the MacCompile page.

Downloads

Before the installation process gets started, you'll need to download pygame and its dependencies. The version numbers of the various packages are the ones I had success with on Lion. All of these projects are going to be built from source, and the links below all assume you're downloading the .zip or .tar.gz source code archives. Download links are all listed below:

Building and Installing

Now that all the necessary code has been downloaded, we can start to build it. For those unfamiliar and daunted by the idea of compiling source code on the terminal, don't worry. The process is usually no more complicated then typing one or two commands.

Python 2.7

Python site still down, will finish this part when I can provide proper links and correct filenames

SDL Frameworks

These are the easiest to install properly. Each of the four frameworks is a disk image. Double click the .dmg files to mount them. For each of the frameworks, navigate to the opened volumes with a terminal. They will all be in locations along the lines of /Volumes/SDL_whatever. Once there, you will run one of the four commands listed below (one for each framework) to copy the files into your Library/Frameworks directory.

JPEG Library

Installing this component will require actually compiling code. The first step is to remove any existing versions of the library. This can be done with the following command

sudo rm /usr/local/lib/libjpeg.dylib

Now we will unpack, compile, and install the library. Simply navigate to the directory where you download the .tar.gz file and type the following

tar xvzf jpegsrc.v6b.tar.gz

cd jpeg-6b

./configure make

sudo make install-lib

Unfortunately, I'm not able to be at my computer long enough today to finish this. Will add the rest of this in the next couple days.