Monday, September 7, 2009

Fixing MacPorts for Snow Leopard

This is off topic so if you are one of my regular readers you probably don't care. This isn't anywhere else on the web though so I figured I'd add it to my blog so people can find the information.

OK so from here on out I'm assuming you were a Tiger or Leopard MacPorts user who has upgraded to Snow Leopard and is getting an error message that looks like:

dlopen(/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib, 10): no suitable image found.  Did find:
/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: mach-o, but wrong architecture
while executing
"load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib"
("package ifneeded Pextlib 1.0" script)
invoked from within
"package require Pextlib 1.0"
(file "/opt/local/bin/port" line 40)
What's happening is you have a PowerPC version of this TCL library. You need an Intelx86 version to run port. Rather than reinstall you can just fix this. I've put a zip file of the correct version on the associated website.

download and unzip this to /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib
replacing the broken one then you can do your
sudo port -d selfupdate 
and everything will be fine.