How to build Ardour for OS X without X11 support

STOP! Do you really need to do this? We provide Tiger/Intel ready-to-run packages of Ardour, and soon will also offer Tiger/PPC. Unless you are a developer with experience compiling and building applications from source, this document is not for you. Please go back to the download page

Building Ardour from source code has never been a very easy task, mostly because of all the libraries it requires. Building the OSX "native" version is even more tricky because it requires that you use absolutely current versions of the GTK-OSX port, apply patches to that code, and deal with building several other libraries from source before you can even start thinking about Ardour.

Why is this so hard?

Apple provides a nice development environment for people who want to build applications that run only on OS X. Unfortunately, if you want to write applications that run on other platforms as well (like Ardour), Apple isn't there to make things easy. The MacPorts project has taken care of quite a lot of the hard part of setting up a development environment in which cross-platform applications can be built. Unfortunately, because Ardour relies on a version of GTK that hasn't really been released yet and then requires additional patches to both GTK and other libraries in order to function correctly, there's really no way around this incredibly difficult (and lengthy) process.

Lets summarize the steps involved before we start:

  1. make sure you have the developer tools (XCode) installed (from Apple)
  2. install Subversion
  3. make sure you have a suitable version of JACK
  4. install the Boost library
  5. install libraries required by GTK that are normally supplied by X11
  6. fetch the GTK/GNOME build script "jhbuild"
  7. run jhbuild's "bootstrap" step to get necessary tools installed
  8. build GTK-OSX
  9. patch the GTK-OSX sources with fixes for several important problems
  10. rebuild GTK-OSX
  11. fetch necessary libraries and build
  12. build Ardour
  13. create Ardour2.app

Install Xcode

You can check if you have xcode installed by running the command gcc --version in a terminal. If it works successfully, you've got Xcode.

Install Subversion

Note: Leopard (OS X 10.5) now includes Subversion, so you will not need to install it on systems running that version of OS X.

I would recommend the version provided here.

Make sure you have a suitable version of JACK

At present, you will need a version of JACK numbered 0.109.2 or later. If you build JACK from source yourself, you are strongly encouraged to fetch JACK from svn until JACK 0.113.0 is released.

Packages to get from MacPorts

This section has been removed because it is currently believed to be unnecesary.

Install Boost

Theoretically this can be done via MacPorts, but it appears broken at present. Instead, fetch the Boost 1_34_1 source tarball from boost.org, then build and install it according to their instructions. This takes a while - boost is large and complex C++ library.

Install libraries required by GTK

Use google to find freetype (I recommend version 2.3.5) and fontconfig (I recommend version 2.4.2). Download the tarballs. Use the conventional "./configure && make && sudo make install" process to build and install them (freetype first, then fontconfig).

At this point in the process, make sure the environment variable PKG_CONFIG_PATH includes /usr/local/lib/pkgconfig, so that later stages can find freetype and fontconfig.

Fetch the GTK/GNOME build script

First, get the install script and run it. It does not matter where you put this script.

sh gtk-osx-build-setup.sh
Now make sure that ~/bin is in your PATH.

Bootstrap

Next we need to make sure we have all the tools required to build GTK:

jhbuild bootstrap

Now do the same for GTK/OSX specific build tools and environment

jhbuild build meta-gtk-osx-bootstrap

Build GTK

jhbuild build

Patch

Next, as of July 2008, you need to apply some patches to the code. These have been submitted back to the GTK-OSX core team but are not in SVN yet. Fetch the GTK patch. Save it to disk, and then apply it using patch:
cd ~/gtk/source/gtk+
patch -p0 < /where/you/put/the/gtk.patch

Rebuild the GTK stack

jhbuild buildone gtk+

Fetch other libraries

Please use google to find these libraries, which avoids us having to maintain links here.

  1. Fetch libart
  2. Patch libart using this patch
  3. Build and install libart (using --prefix=/opt/gtk)
  4. Fetch, build and install libglade (using --prefix=/opt/gtk)
  5. Fetch libgnomecanvas. You must get version 2.9.1
  6. Patch libgnomecanvas using this patch
  7. Build and install libgnomecanvas (using --prefix=/opt/gtk)
  8. Fetch, build and install raptor (using --prefix=/usr/local) --> install ladspa.h
  9. Fetch, build and install lrdf (using --prefix=/usr/local)
  10. Fetch, build and install liblo (using --prefix=/usr/local)
  11. Fetch, build and install boost (using --prefix=/usr/local)
  12. Make a non-versions specific Boost header file directory visible by running this command in a terminal: sudo ln -s /usr/local/include/boost-VERSION/boost /usr/local/include/boost

Build JACK

For the time being, you should use JACK from svn at jackaudio.org.

Build Ardour

Before building Ardour, you need to be inside a shell that has been configured to use the Gtk-OSX libraries that you built earlier with jhbuild. The easiest way to do this is to run the command jhbuild shell from an existing shell. Then proceed with the normal scons-based build process (see the general build notes for a little more info on that).

There are 3 scons options you will want to set, so this is the scons command: scons GTKOSX=1 AUDIOUNITS=1. Once you have done this once, you do not need to specify the options again - they will "stick" until unset.

Create Ardour2.app (optional)

There is a script in tools/osx_packaging of ardour that will produce an application bundle, which is the preferred way to package applications on OS X. To run it:

cd tools/osx_packaging
./osx_build 
When it completes, you will have a directory called Ardour2.app. This is self-contained version of Ardour and all the libraries it needs. It can be copied, moved, distributed to others.

Thanks

This document represents the accumulated experience of Paul with lots of input from Josh Parmenter who was the first person after Paul to struggle through this process. Thanks Josh! If you find parts of the instructions are wrong or unclear, please let us know.