a glob of nerdishness

November 27, 2010

Building CouchDB for PowerPC on Mac OS X 10.5 Leopard

written by natevw @ 8:52 pm

My first Mac was a G4 mini which now mostly just serves an external drive to our home network as a Time Machine backup destination. Since it’s powered up 24/7, I’ve been wanting to make a bit more use of it as a server, which means Couch of course.

Unfortunately, the process wasn’t terribly “relaxing” — I couldn’t find a PPC build of CouchDB for Mac OS X on the ENTIRE INTERNETS. Yet fortunately, after who knows how many hours of blood, sweat and swearing under my breath, I was able to coax out a working build. For the 3 other CouchDB fans out there who still have a PowerPC machine plugged in and enjoy sysadmin pain, here are my build notes:

  1. First, install git if necessary and follow the instructions for the build-couchdb helper scripts until the “rake” part.
  2. To avoid a mktmpdir issue in rake, you’ll need to get a Ruby 1.8.7 version of Rake working. I don’t recommend this route, but when it was all said and done I moved aside /usr/bin/ruby, /usr/bin/rake and /usr/bin/gem (each to /usr/bin/X-orig) and then followed the first few steps of these instructions to get newer versions working out of /usr/local/bin instead.
  3. To avoid an unsupported architecture crash-and-burn, you’ll need to go into build-couchdb/tasks/erlang.rake and comment out a 64-bit option line: #configure.push '--enable-darwin-64bit' if DISTRO[0] == :osx
  4. The CouchDB build doesn’t like the Leopard version of libcurl, so build and install the latest from source. Temporarily move /usr/bin/curl-config to /usr/bin/curl-config-orig so the build process will use the right curl libraries. (Again, there’s maybe a better way to do this, but I wasn’t feeling picky at this point…)

If any of that made any sense, and I didn’t forget anything, you may even be able to reproduce this on your own PowerPC Mac at your own risk. PLEASE PLEASE PLEASE let me know if there’s a better way to get build-couchdb using the right versions of Ruby and libcurl without desperately mucking around in /usr/bin like I did.

1 Comment

  1. Thanks for this!

    I am the Build CouchDB maintainer. I would like to integrate these changes into the system however first I have to track down a PPC Mac!

    Since libcurl is a build dependency for couchdb there is really no excuse that it does not ship with Build CouchDB. I have also been receiving pressure from various people (Solaris, old Linux distros, etc.) to write a workaround for the mktmpdir issue so that also must be done. It’s a shame to have to build Ruby and Rake for something so simple like mktmpdir. (Incidentally, I use ruby-inabox for my own projects which is a dead-simple standalone Ruby builder much like build-couchdb: http://github.com/jhs/ruby-inabox .)

    Comment by Jason Smith — November 28, 2010 @ 6:48 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.