from __future__ import *

pygame 1.7.0 for Mac OS X 10.3

March 11, 2005 at 03:43 AM | categories: python, macosx, PyObjC, packman, pygame | View Comments

Pygame is a set of Python modules designed for writing games. It is written on top of the excellent SDL library. This allows you to create fully featured games and multimedia programs in the Python language. Pygame is highly portable and runs on nearly every platform and operating system.

Although the official sdist tarball isn't cut yet, I've packaged what should be pygame 1.7.0 for Mac OS X 10.3 (Panther) users. It is available from pythonmac.org packages.

This installer ships with:

pygame:
Installed to /Library/Python2.3/
pygame headers:
Installed to /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/
pygame examples and documentation:
Installed to /Developer/Python/pygame/
SDL with my AltiVec patches, SDL_mixer, SDL_ttf, SDL_image, smpeg:
Installed to /Library/Frameworks/

To use pygame, you will need PyObjC 1.2 or later, and you will probably want Numeric, PIL and PyOpenGL installed. All of these are also available from pythonmac.org packages.

The following improvements are especially relevant to Mac OS X:

  • Calls into nasty private Apple SPI (CPSEnableForegroundOperation) to grab GUI access if it doesn't already have it (read: no pythonw required)
  • Can now read the default font and icon out of any PEP 302 get_data compliant loader (read: py2app 0.1.8 can put pygame entirely in the site-packages.zip, and it works!).
  • Includes newer versions of all dependencies (it sure has been a long time since 1.6.0!)
  • Most surface operations should be significantly faster on G4 and G5 computers due to my AltiVec patches to SDL

As it has been quite a long time since the last release, there are pages full of bug fixes and feature enhancements. When pygame.org updates for the 1.7 release, check WhatsNew.

Note that I will not be making a Mac OS X 10.2 (Jaguar) compatible release for Python 2.3. When Python 2.4.1 is out (and probably not until there is an official distribution of it), I may build a pygame release for that.

UPDATE: I built PyOpenGL, with some ugly hacking and lots of compiling. If there was an award for having a crappy build process, I would nominate PyOpenGL, twice.

Read and Post Comments

pythonmac.org packages and missing extensions

March 09, 2005 at 09:32 PM | categories: python, macosx, py2app, packman | View Comments

The Python 2.3.0 distributed with Mac OS X 10.3 is missing three extensions typically found on other platforms:

_bsddb
_tkinter
readline

Since these are part of the standard library, it is somewhat annoying to build them after the fact. I have put together a little svn repository with the relevant setup scripts and sources:

http://svn.red-bean.com/bob/MacPythonPantherExtras/trunk/

Installer packages for these three extensions are available at:

http://pythonmac.org/packages/

Note that _bsddb and readline include their respective dependencies statically, where _tkinter requires TclTkAqua 8.4.

Many other packages are also available from this repository, including PantherPythonFix, wxPython, Numeric and numarray (with AltiVec support via Apple's Accelerate framework), PIL (with tiff, jpeg, and Tkinter support), and matplotlib (with Agg, wxPython, and Tkinter support contributed by Chris Barker).

The majority of these packages are only available for the Python 2.3.0 that ships with Mac OS X 10.3 (Panther), but a few are available for Mac OS X 10.2 (Jaguar). These Jaguar packages are compatible with the MacPython 2.3 distribution (even if used on Mac OS X 10.3 or later).

Most of the packages in this repository were built with the bdist_mpkg command of py2app. Building your own redistributable package installers can be as easy as:

bdist_mpkg setup.py --zipdist

The --zipdist option is currently only available in py2app svn trunk, but will be part of the 0.1.8 release later this month.

Read and Post Comments

from __future__ import packman

January 07, 2005 at 06:44 AM | categories: python, py2app, PyObjC, packman, pygame | View Comments

For quite some time I've been neglecting my packman repository. I find it hard to make time and the infrastructure for maintainers and users alike are quite archaic.

Ideally I would like to move everything over to using Apple's installation tools with .mpkg based distributions. That, along with replacing some ugly distribution scripts in PyObjC, were why I wrote py2app's bdist_mpkg command. This opens up several doors and has a few immediate advantages:

  • Installer can authenticate. packman can't. Several packages need this, especially those requiring headers. The current PackageManager UI requires the user to drop to shell and change permissions on these folders in a very obnoxious and unintuitive way.
  • Installer creates receipts.
  • Installer packages are standard. Other things use them. For example, SDL, a dependency of pygame, is already available in .pkg format from the source. That means less maintenance and more accountability.
  • Installer (as of Mac OS X 10.3, anyway) can safely detect certain kinds of dependencies, where packman runs arbitrary code (uh oh!).
  • Some people don't like the PackageManager UI. These people could download the packages themselves and simply double-click to install (though they would have to manage dependencies themselves).
  • Installer can allow the user to customize an installation (to disable installation of scripts or documentation, for example). bdist_mpkg already organizes packages in a manner suitable for this.
  • Installer will show important information such as the License and ReadMe before installation.
  • installer can alternatively be used (but this does require authentication) for a hassle-free installation, or when installing by command-line (think ssh).
  • Installer is understood by Apple's tools. Think custom installation DVDs, Mac OS X Server, Apple Remote Desktop, Apple's internal build process, etc.
  • Installer may be improved in future versions of Mac OS X, which means that the packman infrastructure would get an upgrade for free (well, cheap).
  • Using bdist_mpkg, packman could "record" (not perform) an installation so that it may be performed later or elsewhere. For a given package, packman would download it and all of its dependencies and create a self-contained .mpkg for simple installation and transport. People who have broadband at work or school and dial-up at home would probably be particularly fond of this feature.

... Of course, even after this is developed, it's no promise that I'll have a long-term interest in maintaining my own repository. However, with this kind of infrastructure and the right tools, I think that someone else (hopefully several others) will!

Read and Post Comments

PackageManager repository update

February 20, 2004 at 10:34 PM | categories: python, packman | View Comments

Another update to my OS X 10.3 Package Manager repository

New packages:

  • PySQLite 0.5.0, Python wrapper for SQLite, an embeddable SQL database engine (linked statically against SQLite 2.8.12 configured with --enable-utf8).
Read and Post Comments

PackageManager repository update

February 05, 2004 at 12:57 AM | categories: python, packman | View Comments

Another update to my OS X 10.3 Package Manager repository

Updated packages:

  • numarray updated from 0.7 to 0.8, now using Apple's Accelerate framework for LAPACK and BLAS

New packages:

  • pCFITSIO 0.99.0, a SWIG wrapper for CFITSIO (the source looked to be in a pretty sad state, but someone asked for it.. no guarantees).
Read and Post Comments

Today in MacPython - snippets

January 25, 2004 at 06:04 AM | categories: python, PyObjC, packman | View Comments

Here's some links and snippets of interest from today on the MacPython Channel:

  • READ THE FAQ! PLEASE! :)
  • Squeak - when do we get GUI tools like this for MacPython?
  • unicodedata - u'N{DEGREE SIGN}' is the same as unicodedata.lookup('DEGREE SIGN')
  • Zope - How is it different from Apache+PHP? The Plone installer is a good way to try it out on the Mac.
  • ZODB - It doesn't use ExtensionClass anymore! But you still have to subclass Persistent.
  • bundlebuilder - How do I make a pygame bundle? It's still hard (but I'm working on that). Python+pygame would be a great language to use for the iDevGames 21 Days Later contest, but the bundles are beyond the 2.1 MiB compressed limit! It's possible to make small bundles, but the means to do so are not currently available (but ask me in two weeks if you are participating!)
  • IDEs - Vim, Emacs, SubEthaEdit and Xcode do syntax highlighting, PyOXIDE is an up and coming Cocoa IDE.
  • Chemistry - PyQuante looks like a good way to learn some quantum chemistry.
  • PyObjC - it rocks, but you should already know that. A 1.1 release should be coming out Very Soon Now, but has been set back by sourceforge CVS issues.
  • wxPython still has bugs on the Mac
  • XUL and Renaissance are XML-based-GUIs
  • Enthought Python is a good way to get a scientific/engineering enabled version of Python. We don't have that yet for the Mac, but we should!
  • Opportunity landed, but NASA TV is only available via Real (yuck!)
  • New PackageWishList node on the wiki, use it!
Read and Post Comments

The quickest possible way to get readline in Panther Python

January 21, 2004 at 06:13 PM | categories: python, packman | View Comments

python `python -c "import pimp; print pimp.__file__"` -i readline

Done! Don't even need to download the MacPython addons, though you should.

Read and Post Comments

More PackageManager fun

November 10, 2003 at 11:58 PM | categories: python, packman | View Comments

I threw a couple more packages into my OS X 10.3 Package Manager repository ( http://undefined.org/python/pimp/ ). Highlights include:
  • pycrypto 1.9a6
  • Pyndex 0.3.2a
  • pyOpenSSL 0.5.1
  • pyPgSQL 2.4
  • Quotient 0.7.0
  • Reverend 0.2.4
  • spambayes 1.0a7
  • Twisted 1.1.0
Read and Post Comments