Thursday, August 16, 2012

Getting MacPorts to work on Mountain Lion

I recently upgraded to Mountain Lion and during some development work for ProdPad ran into a problem where my PHP from MacPorts didn't have GD extension installed. I went install it and ran into all sorts of problems.

Today I tried again, this time running the upgrade instructions from the MacPorts site and still had the same problem, everything was failing to compile. All with the similar messages along these lines:

Error: org.macports.configure for port gdbm returned: configure failure: command execution failed
Error: Failed to install gdbm
Please see the log file for port gdbm for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_gdbm/gdbm/main.log
Error: The following dependencies were not installed: autoconf help2man p5.12-locale-gettext perl5.12 gdbm perl5 xz

for package after package. Queue Google and nothing much to help. I reviewed a couple of log files and kept seeing this error message:

:info:configure nawk: illegal jump type 339
:info:configure  input record number 15, file
:info:configure  source line number 365
:info:configure sed: stdout: Broken pipe 
Some more Googling and found this ticket with a potential answer. Uninstall Nawk. Did that and hey presto it all works again. For good measure I installed Gawk instead.

So for whatever reason Nawk is broken and/or no longer useful for MacPorts. So if you are having trouble installing packages with MacPort on OSX Mountain Lion then uninstall Nawk.