OS X 10.8 Mountain Lion Preview + MacPorts

I love having access to software early, so I bought a Mac Developer Program membership last year for 100 bones and subsequently never really used it. I got an invite last week to download the Developer Preview of Mountain Lion, the forthcoming OS X upgrade, so I did.

Note: as soon as you upgrade to Mountain Lion, you need to install the preview of Xcode 4.4. After doing that, you have to install Xcode command line tools, which doesn’t happen automatically. If you don’t follow this extra step, you won’t have anything at your disposal in Terminal – make, svn, etc.

Installing pre-release software is dangerous and will break things all over the place. I’m going to tell you what breaks (that I know of so far) and how to fix it (if i know).


I’m not going to pretend like I know why, but Chrome runs like shit so far in Mountain Lion. Might have something to do with Darwin 11 vs 12, might not. However, Safari is NOT broken and runs faster and smoother than I have ever seen it. I have a strong affinity for Chrome so I may not switch back yet, but man, it is fast.

Little Snitch

If you have pirated software and you want to block all attempts at activation pings in a managed way, you probably have a program like Little Snitch helping you since it allows you to block all internet access to selected programs. I use it because I have Adobe Master Collection installed and I, not surprisingly, didn’t pay the thousands of dollars that it costs. Little Snitch doesn’t work because it sniffs the OS version (10.8) and deems itself incompatible.

MacPorts – specific ports

This one’s a doozy. If you run port upgrade outdated, every one of your MacPorts will be up for upgrade because they were previously compiled on Darwin 11, not Darwin 12 which ships with OS X 10.8. Annoying, and time-consuming, but not a deal-breaker… until you get to any ports which require libxml2, which is “most.”

Because some of your ports will bail on error, you need to upgrade ports individually (get the list using port outdated) using port upgrade fontforge or whatever.

Once you have upgraded every port that doesn’t die on error, you will realize you have a ton of ports that are in limbo, namely, php5 and all php5-* extensions, X11 and all libraries, and postgresql90. They all have libxml2 as a dependency which no worky. The error is due to locale in reinplace which is not fixed in the distributed version of MacPorts but is fixed in SVN trunk of MacPorts project: http://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl?rev=89839.

So, if we want to fix our ports, we need to run trunk of MacPorts while running the dev version of Mountain Lion.

mkdir -p /opt/mports
cd /opt/mports
svn checkout https://svn.macports.org/repository/macports/trunk
cd /opt/mports/trunk/base
./configure --enable-readline
sudo make install
make distclean

port edit libxml2
--- and change "reinplace" to "reinplace -locale C"

At this point, you need to go back to individually upgrading ports, but you’ll find that most of them get upgraded as dependencies of other ports, so it won’t take as long as before.

Ports that are still broken after this for me: ffmpeg – due to failure of libvpx port (VP8 codec), postgresql90, and the PHP PostgreSQL extension (php5-postgresql). I’m sure there are many others.

Mountain Lion is pretty cool and worth upgrading to if you have the option. Once you upgrade, you can’t go back to Lion without having previously cloned your hard drive, etc, so be careful and be willing to get your hands dirty when things don’t work.

I installed Mountain Lion on my laptop, which I have been using less and less for programming lately, but I often need to run local PHP, so I had no choice but to figure all of this out.

18 thoughts on “OS X 10.8 Mountain Lion Preview + MacPorts

  1. So far I’m really stumbling along here; I did the whole svn process but libxml2 won’t build (looks like the same problem you experienced) and nor will apr-util

    these are both stopping me on a lot of different ports.

    any other ideas on what you might have done to get the apr-util to update?

  2. Fix for libxml2:-

    run “port edit libxml2” and I think change “reinplace” to “reinplace -locale C”

    Compiled fine for me after doing the above. Thanks for your post – would never have got to this point without your page :)

  3. Pingback: Mountain Lion and my MacPorts installations | Mind the Gapp

  4. I’m stuck at compiling my project with libxml2 and Xcode 4.4 on Mountain Lion, can you please tell me how to change “reinplace” to “reinplace -locale C” ? I haven’t used macports before … so forgive me for noobness ….

  5. Getting this message when I try to SVN co something:

    Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the –message (-m) or –file (-F) options
    svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no ‘editor-cmd’ run-time configuration option was found.

    Even though I a have the following in the .bash_profile:

    This worked before. What’s the deal with this upgrade anyhow?

  6. Getting the following message when I try to commit:

    svn: Commit failed (details follow):
    svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the –message (-m) or –file (-F) options
    svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no ‘editor-cmd’ run-time configuration option was found

    Even though I have this in my .bash_profile:

    Highly Annoying..

Leave a Reply