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)
    and this line to /opt/local/etc/macports/variant.conf:
     +llvm34 +ld64_236
    To have working OpenMP (at least partly, only for C source files) you will also need gcc49:
     sudo port install gcc49
    Configure darktable with this command instead of just "cmake ..":
     CC=gcc-mp-4.9 cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6
    If you are building on OS X 10.10 Yosemite also add this argument to the command above:
     -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk

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
    If you have an Apple Developer ID Application certificate and want to produce signed app then replace the previous command with this one:
     $ CODECERT="Developer ID Application" ./make-app-bundle
    You may have to provide more specific name for a certificate if you have several matching in your keychain.
