[Pythonmac-SIG] How to get setuptools to build a Universal Binary? [SOLVED!]

Joe Strout joe at strout.net
Thu Jan 8 17:50:43 CET 2009


Woot!  I finally got my MySQLdb-using Python app working as a Universal 
Binary!  (Trying to make sure all the relevant keywords are there for 
future googlers.)

The root cause of most of the trouble was the broken 5.1 MySQL 
distribution (bug #41940 on the MySQL tracker).  I tried patching it up 
as Ned suggested, but that didn't work for me.  However, going back to 
5.0 did work.

Here's what I did in more detail:

1. Deleted /usr/local/mysql-5.1.30-osx10.4-universal, and the 
MySQL-python egg (in 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/).

2. Downloaded the mysql-5.0.67-osx10.4-universal tarball from the MySQL 
5.0 downloads page.  Unpacked this into /usr/local, changed ownership 
and group as usual, and made the symlink to it as /usr/local/mysql. 
(Confirmed that all dylibs in its lib directory were really universal, 
using "file *.dylib".)

3. Reinstalled MySQLdb using the easy method Ned suggested: 
"easy_install -Z MySQL-python".  This worked fine; all the extra hackery 
at 
<http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/> 
appears to be unnecessary when you use easy_install, as is the manual 
unzipping of the egg (provided you remember the -Z flag).  Navigated 
into the newly created egg in site-packages and verified that the 
_mysql.so file was universal.

4. Rebuilt my app with py2app.

The resulting app works in 10.4 and 10.5 on both PPC and Intel machines. 
  Hooray!

Now, let's see... I owe a beer (or other beverage of choice) to Ned, 
Chris, Robin, and Andy... and I'm off to make a donation to both 
wxPython and MySQLdb...

Many thanks,
- Joe




More information about the Pythonmac-SIG mailing list