Mike Wirth | 31 Jul 21:41 2012
Picon

Pygame on Mac OS X 10.8 "Mountain Lion"

Folks,

I was happily running a pygame app using a standard install of Python 2.7.3 (not the Apple pre-install) on Mac OS X 10.7 "Lion".  Used IDLE as the "control panel".

Then I installed OS X 10.8 "Mountain Lion" and my app didn't work anymore.  Looked like a conflict between 32-bit and 64-bit versions of various modules(e.g., had to add the 64-bit version to the -arch options for the compiler).  Didn't find a binary install of pygame for Mountain Lion, so I did a reinstall from source, generally following the instructions on:
http://pygame.org/wiki/MacCompile
but updating environment variables and modules (e.g., the various SDL packages) to their latest, purportedly 64-bit compatible, versions.

Almost there, but get one remaining error when loading the app.  When importing the pygame base.so I get:
Symbol not found: _SDL_EnableUNICODE

My guess is that this symbol no longer exists in the current SDL modules, but the latest pygame still refers to it.

Any help here?  Once I get through this (and any other remaining :-) problem(s) I should be good to go.  And I'll be happy to update the MacCompile webpage to reflect what I've learned.

Mike
 
 
Russell Owen | 31 Jul 22:57 2012

Re: Pygame on Mac OS X 10.8 "Mountain Lion"

You might want to try this binary installer:
which requires python.org's 64-bit python 2.7 (the one labelled "10.6")

My build notes are appended.

I built it using:
- Mac OS X 10.6 (the oldest OS that works with python.org's 64-bit python, for maximum backward compatibility)
- python.org 64-bit python 2.7.3
- SDL 1.2.15
- SDL image 1.2.12
- SDL mixer 1.2.12
- SDL ttf 2.0.11

I haven't heavily tested it (I just use it to play sound cues) and I haven't tried MacOS X 10.8. I would be very interested to hear how well it works for you.

Regards,

-- Russell


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)

Mike Wirth | 1 Aug 03:22 2012
Picon

Re: Pygame on Mac OS X 10.8 "Mountain Lion"

Bingo, did the trick.  App starts up and runs fine.


Thanks!

Looks like you ought to post your binary :-)

Mike

On Tue, Jul 31, 2012 at 1:57 PM, Russell Owen <rowen-lfcS8c3Mqgg@public.gmane.org> wrote:
You might want to try this binary installer:
which requires python.org's 64-bit python 2.7 (the one labelled "10.6")

My build notes are appended...

Gmane