SDL Perl 2.0 Beta 3 in Mac OS X

Synopsis

This section describes how to get started with SDL Perl (2.0 beta 3) under Mac OS X. A modified version of the SDL Perl distribution is available for download, as well as a 'kitchen sink' distribution which has all the files needed to get started.

Quick Start

If you're interested in assembling all the required files yourself, download the modified SDL Perl distribution and follow the instructions in README.macosx.

If you want a single download that has all you need to get started (including frameworks and support libraries), download the SDL Perl 2.0 Beta 3 Kitchen Sink distribution (v0.9.0) and follow the instructions in the top level README.

Background

SDL Perl is a library binding for SDL in Perl. It is readily available for many flavors of Unix, including Linux, and there are ports for other platforms such as Win32. Since Mac OS X is based on Unix, comes with Perl pre-installed, and has several pre-built SDL libraries available for it, I figured SDL_Perl would be a cinch to get working. Boy, was I wrong!

The first hint should have been the fact that there wasn't a pre-built port already out there. The closest I could find was part of a port of Frozen Bubble which I found at http://redivi.com/~bob/frozenbubble.html. The version in the source for the Frozen Bubble port had some issues (at least for me), but was an EXCELLENT start toward getting a working distribution.

I've brought forward the changes from SDL Perl v1.19.0 to 1.20.3 and 2.0-beta3 and wrote some documentation on how to get it all working, which can be found in the README.macosx file of the modified SDL Perl distribution (v2.0beta3).

If you're looking to save yourself some time tracking down the four frameworks and three libraries that are needed to make up a functional SDL Perl install, you can use my SDL Perl Kitchen Sink Distribution (v0.9.0). Information on the contents of the Kitchen Sink can be found in the top level README.

Changes/Updates

Below is a list of modifications and additions made to the stock 2.0-beta3 SDL Perl distribution from ftp.sdlperl.org:

  • Added README.macosx - documentation on how to install SDL Perl.
  • Added Makefile.darwin- Makefile for the Mac OS X install
  • Added SDL_macosx.m- A fix for doing the init and quit in Carbon. Taken from the Frozen Bubble port.
  • Changed Makefile.PL - update to use Makefile.darwin if Mac OS X platform detected. (see diff)
  • Changed OpenGL.xs - Added preprocessor directives for Mac OS X changes. (see diff)
  • Changed SDL_perl.xs - Added preprocessor directives to handle SFont namespace conflict. (see diff)
  • Changed SFont.c - Added preprocessor directives to handle SFont namespace conflict. (see diff)
  • Changed SFont.h - Added preprocessor directives to handle SFont namespace conflict. (see diff)
  • Changed detect.c - Added preprocessor directives to handle different OpenGL paths. (see diff)

A unified diff is available here.

Useful Links