Featured Posts

BuddyPress -- Pages failing to load (404) I was going insane working on a buddypress install for our intranet's tech-blog because every page I attempted to load into Wordpress following the Buddypress install...

Read more

BuddyPress -- Pages failing to load (404) I was going insane working on a buddypress install for our intranet's tech-blog because every page I attempted to load into Wordpress following the Buddypress install...

Read more

Renaming mongodb Columns Today I was putzing around in the geo-spatial collection when I noticed that I had an unhappy over one of the column names within the collection. In the mySQL world,...

Read more

SWTOR: iMac Graphic Settings for 30-70 fps Framerate Star Wars - The Old Republic (SWTOR) has pretty much dried-up my technical productivity since it's release last week.  Staying true to my altoholic self, I've now got...

Read more

Why is my mongo query so slow? Why's my mongodb query so slow? I got my geospatial collection set-up -- I am running some really great queries making sure that the locations I am pulling aren't in any...

Read more

Subscribe

Lion Upgrade — Recovering mac ports, ncurses and mongodb

Category : Technical
No Gravatar

Lion ate my mac ports install.

On the other hand, mac ports has never been very robust when it comes to operating system upgrades.

Earlier this week, I did a time machine restore to a new mac book pro from an (much older) mac book pro — I spent the next four hours or so recovering and rebuilding my XCode and mac ports environment.

So, it wasn’t really that much a surprise to see that my mac ports installation failed to selfupdate or upgrade outdated following the Lion OS update.

The first thing I had to do was grab the new (OX X 10.8) version of XCode from the Apple AppStore.  This, as it turned out, was a bit of a challenge.  I couldn’t see to get the new rev to download from the AppStore and, Apple being Apple, there’s no such thing as  a mirror site.   Long story short, it took about 36 hours of repeated download requests/attempts to get the upgrade downloaded.

Once I installed the XCode update, the next step was to re-build mac ports from scratch.

# sudo svn checkout http://svn.macports.org/repository/macports/trunk

# cd trunk/base

# sudo ./configure --enable-readline

# sudo make install

# sudo make distclean

# sudo port -v selfupdate

# sudo port upgrade outdated

…and this is where I started getting a lot of errors…  Basically, ncurses was failing to install returning with a shell-error command.  If I tried to install individual packages that depended on ncurses like, say, mongodb, then I got returned to this error.

About 30 minutes of reading in the mac ports bug filings, and I learned that there is an issue between ncurses -> libiconv -> gawk.  The tl;dr of the issue is (if I remember right) that libiconv was looking for awk and finding gawk and wasn’t building.  Since it didn’t build, then nurses won’t build, and if ncurses won’t build, you’re pretty much screwing the pooch on your mongodb install.

So, through trial-and-error, and you may have to repeat the sequence, I figured out the following commands to get all the innards back into the stomach of mac ports:

(note: either sudo these commands or exec as root.)

  1. port clean gawk
  2. port uninstall gawk
  3. port clean libiconv
  4. port uninstall libiconv
  5. port install gawk
    1. this will automagically reinstall libiconv
  6. port clean ncurses
  7. port install ncurses

This should result in a clean build and installation of ncurses.  Earlier in the process, since ncurses is dependent on ncursesw, I cleaned, uninstalled, and installed ncursesw.  But I’m not convinced that was a necessary step.  If the above process is failing for you, then maybe you should try r&r’ing ncursesw first.

I’m still having issues with mongodb…and I’ll document the solutions as I figure them out — but the ncurses dependency is, for the moment, addressed.

<pre>In file included from util/processinfo_darwin.cpp:30:
/usr/include/mach/shared_memory_server.h:48:2: warning: #warning "&lt;mach/shared_memory_server.h&gt; is deprecated.  Please use &lt;mach/shared_region.h&gt; instead."
In file included from util/processinfo_darwin.cpp:23:
/usr/include/mach/task_info.h:252: error: 'vm_extmod_statistics_data_t' does not name a type
/opt/local/include/boost/system/error_code.hpp:214: warning: 'boost::system::posix_category' def</pre>

And I see there’s a bug reported for this issue with the comment that they’re kicking it over to the folks at mongodb for a fix.

Stay tuned…

[Edit 8/1/2011]

I did a Lion upgrade on a fresh Leopard system – there’s been some changes since I wrote the article, most notably, the problems with ncurses, gawk, et. all., seemed to have been fixed.  The steps are pretty simple, actually:

  1. download (holy constipated broadband! anyone else notice the slow-as-frozen-cement download speeds Apple squicks out for this application?)  and install XCode for Lion from Apple’s AppStore application.
  2. check and, if necessary, modify your PATH variable to include the mondodb bin path (for me: /opt/local/bin).
  3. self-update the mac port install  (sudo port selfupdate)
  4. update the outdated ports  (sudo port upgrade outdated)
  5. Follow the steps left by Peter in the comments below to patch and install mongodb.  (Thank-you, Peter!)
Once I did this, I had a fully-functional port installation, complete with mongodb and all the other cool kids. (Apache2, mysql5, php5, etc.)
Hope this helps!

Thanks for this post, Michael! I just ran into this issue, and this post was already the first result on Google for “macports libiconv lion”. :)

-Bill

Nice one Michael. I had a very similar issue with ncurses failing to install, in addition to your steps I had to do re-install gettext, but you saved me a lot of googling. Cheers!

I realized that my original problem was the mongodb source Lion incompatibility.

The patch mentioned on the Jira issue

sudo port clean mongodb
sudo port extract mongodb
cd $(port work mongodb)/mongodb*
sudo curl -O https://jira.mongodb.org/secure/attachment/12395/lion.patch
sudo patch -p1 < lion.patch
cd
sudo port install mongodb

did work.

Page optimized by WP Minify WordPress Plugin

Weather forecast by WP Wunderground & Denver Snow Removal