MacPorts: Installing Unix Bits

written by Geoff Bowers on Saturday, 5 April, 2008 @ 03:03 PM

Embarked on finding the ultimate IRC client for my Mac and got a bit side-tracked getting that old stalwart XChat running under Leopard. Turns out this whole Unix on OSX caper is kind of fun -- got myself a copy of MacPorts and with some 4,500+ ports available, I'm installing Unix bits all over the place. Here's a quick run down of just how easy it all is.


First of all you need to get a hold of and install "MacPorts" (

"The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. To that end we provide the command-line driven MacPorts software package under a BSD License, and through it easy access to thousands of ports that greatly simplify the task of compiling and installing open-source software on your Mac."

MacPorts is the new name for DarwinPorts from the ill fated Open Darwin project.

"OpenDarwin was originally created with the goal of providing a development environment for building and developing Mac OS X sources as well as developing a standalone Darwin OS derivative. OpenDarwin was meant to be a development community and a proving ground for fixes and features for Mac OS X and Darwin, which could be picked up by Apple for inclusion in the canonical sources. OpenDarwin has failed to achieve its goals in 4 years of operation, and moves further from achieving these goals as time goes on. For this reason, OpenDarwin will be shutting down."

If you've got a vanilla Leopard installation you'll need to add a couple of developer features from the installation disk. In order to install and run MacPorts you've got to have the following components:

  • Apple's Xcode 3.0 Developer Tools for the Leopard platform or 2.4.1 for Tiger, found at the Apple Developer Connection site or on your Mac OS X installation CDs/DVD
  • The X11 windowing environment (A.K.A. "X11 User") and its related SDK package ("X11SDK") for ports that depend on the functionality they provide to compile and run

When you are ready to go, run through the MacPorts Installer. I just accepted all the defaults.

Once the installer has done its magic, you'll want to run a quick self-update to make sure you are running the very latest version of "port". Open up a Terminal window and run an update from the command line:

% sudo port -v selfupdate

Ok. So lets try installing our first ported application. Scanning through the ports for IRC (, it turns out xchat no longer has a maintainer and is a bit of a dinosaur but there is an active xchat2 client (

% sudo port install xchat2

This will take a while if its your first bit of ported kit -- you need to pick up all the common software dependencies for xchat2 and build them -- just make a cup of tea, and kick up your heels.

% which xchat

And then something like:

% /opt/local/bin/xchat