wxPython Universal Binary

Binaries available from the wxPython downloads page.

There's probably only one FAQ, but it's a big and important one for some, so I'm documenting it here so that the answer can be in one place.

Q: Why does the wxPython Universal Binary only run on Tiger, while Universal Python runs on Panther, too?

A: The short answer is, there's a problem with Panther's dyld linker when reading libraries built using gcc4. It doesn't properly read certain global symbols from the wxWidgets C++ libraries, and as a result, wx.ArtProvider, for example, doesn't work at all on Panther. I've done a lot of testing, and from the results I've determined that there's probably only one way the wxPython Universal Binary could ever work on Panther - and that is to ensure that the PPC builds of both the wxWidgets C++ libraries and the wxPython extensions (built using distutils) are built using gcc 3.3. At the moment, I want to move on to solving some more pressing problems (for me, in any case), but if someone does want to try this, I think there is a trick we could do to lipo the finished PPC and Universal builds without actually setting up any new build systems. It would pretty much exactly go like this:

1. Download latest wxPython PPC build, cd into <package_name>/Contents/Resources and unpack the .pax.gz file containing the wxPython install tree.

2. Do the same for the latest wxPython Universal build.

3. For the Universal build, we need to remove the PPC portion of the binaries. To do this, run the following command on the wxWidgets .dylib files and the wxPython .so extensions in the Universal build:

lipo -thin i386 <lib_file> -output <lib_file>.i386

(the above example appends .i386 to the filename)

4. Now, we need to lipo together the ppc and i386 builds with the following command for each library:

lipo -create <ppc_lib> <i386_lib> -output <univ_lib>

(directory for univ_lib would be the Universal build tree)

5. Delete all .i386 binary files in the Universal build tree.

6. Repackage the Universal build tree into a new installer, perhaps using the buildpkg.py script in <wxWidgets>/wxPython/distrib/mac.

7. Get people to test that it works on Panther, Tiger PPC and Tiger i386. :-)

8. Get brandished with the ultimate in nicknames - "the man". ;-)

There are no guarantees that this will work, but considering that PPC builds of wxPython DO work with Universal Python (on PPC), it strongly suggests that merging that working build into a Universal build should be successful.