Krita on OS X

However, all is not completely well yet. It was quite hard to get this far — thanks are due to the fantastic helpfulness of all the people on #kde-mac. Thanks Illogical, Iggy, Mek and Rangerrick!

There are basically three options if you want KDE4 applications on your Mac:

  • Install the dependencies using fink or macports, and compile yourself
  • Install everything using macports
  • Install using pre-built packages

I opted for the first option (after trying the others, too: I suspect that had I been aware of the dbus issues, I could have success with both. This is how I did it:

The biggest problem in getting started is dbus: dbus really is a bad dependency if you want to be cross-platform, it seems to me, since it’s alien to both Windows and OS X, and it gives all kinds of errors and problems that users of those platforms simply should not be bothered with. In the end, once I had done rm /tmp/launch* and installed the patched dbus portfile from Illogical, I could run my first KDE apps.

First, I installed macports, then I  added the kde-mac macports line to /opt/local/etc/macports/sources.conf: rsync://theiggy.com/ports/4.1-svn, as the first line. I installed kdebase4 to get all dependencies, then removed kdebase4, kdelibs4 and qt4-mac. I’m actually not sure whether I also removed everything from kdesupport that this pulled in; and if I did, I am not sure whether that’s necessary at all.

Then I installed dbus, using this port file which I got from Illogical, using this command: sudo port install /path/to/unzipped_dir/dbus. Illogical said I had to start it manually, using launchchtl load -F /Libray/LaunchAgents/org.blaaaaaaa.dbus, but apparently that isn’t always necessary, since it worked for me.

Then I got the KDE svn sources in the usual way. I had a couple of problems, though, which I’ll note here:

  • Mek recently fixed a bug in automoc4: you need his recent version if you get complaints about double symbols in moc files.
  • There’s a bug in Leopard that means that if you have X11 installed, you need to move it out of your path when you compile. The macports ports from Iggy have this already fixed.
  • When running cmake, you get an enormous amount of warnings like this:
    CMake Warning at /Users/boudewijn/src/kde/ins/share/apps/cmake/modules/KDE4Macros.cmake:570 (add_library):
      Cannot generate a safe linker search path for target xsltimport because
      files in some directories may conflict with libraries in implicit
      directories:
    
        link library [libxml2.dylib] in /usr/lib may be hidden by files in:
          /opt/local/lib
        link library [libz.dylib] in /usr/lib may be hidden by files in:
          /opt/local/lib
        link library [libbz2.dylib] in /usr/lib may be hidden by files in:
          /opt/local/lib
    
      Some of these libraries may not be found correctly.
    Call Stack (most recent call first):
      filters/xsltfilter/import/CMakeLists.txt:11 (kde4_add_plugin)
    

    This may be ameliorated by adding -DCMAKE_SYSTEM_PREFIX_PATH=\"/opt/local\;/usr\" to your cmake commandline; but that didn’t work for me. It also seems to mean that cmake always runs before a compile starts, even if no CMakeLists.txt file has changed.

I also use the following .my-setup in my kde src dir to set all variables (that I cannot set globally, because I use this laptop for work, too, with a  different Qt and everything.)

export QTDIR=$HOME/src/kde/qt-copy
export PATH=$QTDIR/bin:$PATH
export KDEDIR=$HOME/src/kde/ins
export PKG_CONFIG_PATH=$KDEDIR/lib/pkgconfig/:$QTDIR/lib:$PKG_CONFIG_PATH
export PATH=$KDEDIR/bin:$PATH
export LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$KDEDIR/lib/kde4/plugins
export KDEDIRS=$KDEDIR
export KDEHOME=$HOME/.kde4
export QTEST_COLORED=1
export KDE_COLOR_DEBUG=1
export CMAKE_MODULE_PATH=$HOME/src/kde/ins/share/apps/cmake/modules/:$CMAKE_MODULE_PATH
export CMAKE_PREFIX_PATH=$HOME/src/kde/ins/share/apps/cmake/modules/:$CMAKE_PREFIX_PATH
export XDG_DATA_DIRS=/opt/local/share:$KDEDIR/share

Then, when running KDE applications on OS X, you’re in for a nasty surprise. They do not look good at all, with widgets and labels being drawn over each other. This is especially visible in, for instance, the breadcrumbs in the file selector. Also, KDE on OS X really should use the native file selector, not the KDE one, no matter how cool the functionality of our file selector is. These graphical glitches are everywhere. Some are KDE’s fault, others, like the unbelievably out-of-place docker tabs, are Qt’s fault.

There are other glitches: kdeinit is dying vociferously about thirty times a minute (which seems related to having a file open window open). Kate cannot be resized if the statusbar is visible. By default, KDE shows icons on buttons (which was already a bad idea when Borland brought out Turbo Pascal for Window 3.11) and text under toolbar buttons (which, I admit, a few Apple apps do, too, but the toolbars do not look native at all, and the text looks weirdish. The toolbars don’t disappear when you click on the toolbar-toggle button in the titlebar, but the titlebar does have that button. On OS X, the icons in the menu items shouldn’t be shown, they make the application look garish. The selection color in the file open dialog is black, while the text is black, too.

And finally, quite apart from the kdeinit crashes, there is no stability yet. I had hoped that I would be able to do krita development under OS X — but I doubt that will work out all that well. Cross-platformness is a worthy goal; but we have a long way to go yet.

And, you know, I don’t even really like Mac and OS X. My Macbook Pro 17″ has got a hair wedged between the backlight and the pixel plane, it came dead-on-arrival, half the time I open the lid the backlight gets sort of flamy striped instead of nicely even, it gets horribly hot and the case is really, really susceptible to scratches). And OS X, which, while in some respects not too bad — the terminal.app is good — is in other respects, really in the way. Progress notifications that popup the whole application window over what I’m doing, for instance. And yes, I know about the tradition that the end key moves you to the end of the document and the home key to the beginning, but it’s very annoying, especially when switching between OS X and Linux and windows in virtual machines.