How to make disk image with darktable application bundle (64 bit Intel only):

1). Build darktable (and make sure it works) using instructions found in this blog post:
    http://www.darktable.org/2012/08/bringing-current-darktable-to-os-x/
    Macports will need some tuning though, so before you build anything add these lines to /opt/local/etc/macports/macports.conf:
     buildfromsource always
     macosx_deployment_target 10.6
     cxx_stdlib libstdc++
    (practice showed that support for versions older than 10.6 isn't viable)
    To have working OpenMP (at least partly, only for C source files) you will also need gcc46:
     sudo port install gcc46
    Configure darktable with this command instead of just "cmake ..":
     CC=gcc-mp-4.6 cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6

2). Download, patch and install gtk-mac-bundler (assuming darktable was cloned into ~/src directory):
     $ cd ~/src
     $ curl -O http://ftp.gnome.org/pub/gnome/sources/gtk-mac-bundler/0.6/gtk-mac-bundler-0.6.1.tar.bz2
     $ tar -xf gtk-mac-bundler-0.6.1.tar.bz2
     $ cd gtk-mac-bundler-0.6.1
     $ patch -p1 < ../darktable/packaging/macosx/gtk-mac-bundler-0.6.1.patch
     $ make install

3). You will need to rebuild gtk2 with 'bundle' variant:
     $ sudo port install gtk2 +bundle
    The problem is that with this flag gtk2 works reliably only when included in bundle, so if you need working system gtk2 you will need to revert this change
    after you're done with bundle creation. To do that you can just run this command:
     $ sudo port install gtk2 -bundle
    Otherwise you can just add +bundle to /opt/local/etc/macports/variant.conf

4). Now preparation is done, run image creating script, it should create darktable-<VERSION>.dmg in current (packaging/macosx) directory:
     $ cd ~/src/darktable/packaging/macosx
     $ ./make-app-bundle
