Inkscape on OS X
While this doesn’t have to do with the Summer of Code work, it’s still quite cool. Inkscape 0.42 will have an OS X .app style release, just like Gimp.app. I’ve spent a fair bit of time over the last month setting it all up and allowing automation of OS X builds. All you need is Apple’s X11User package installed and then Inkscape can be dragged to Applications, added to the dock, and launched in any expected way such as dropping SVG files on its dock icon.
Sometime around the end of last week I commited a build script and all the necessary files to build an OS X app bundle of Inkscape. The build script is a heavily modified version of Kees’ osx-build.sh script and all the other support files are in packaging/macosx. The following is a little bit of a discussion of the process.
Dylibs, the equivilent of shared objects in Linux, have their full path and the full path of any other dylibs they are linked with compiled into them. This is called their install_name. Inkscape on OS X is built using gtkmm and all the other dependencies from fink. For Inkscape to work on the machines of users without fink we need to include all the dylibs that Inkscape depends on. For this we should be able to adjust the install names of all the dylibs to a relative path from the executable (the approach used by Kees’ first attempt). This does work but seems to cause runtime startup problems with some of the dylibs. The Gimp.app people probably found the same problem since they don’t use this approach either. Instead of altering the install_names they just set a variable DYLD_LIBRARY_PATH to point to the appropriate path. This works for us to, though it slows down the loading of the executable slightly if you don’t have fink.
The packaging/macosx directory itself contains two directories. The first, ScriptExec contains the modified source of the Platypus application wrapper. This is some code that handles app bundle events, such as files being dropped on the icon in the dock. It also lauches X11 before starting inkscape. One of my modifications to this was adding a link button to the dialog displayed if X11 can’t be found. The extra button launches a browser window with the download page for Apple’s X11. I’ve never programmed with any of Apple’s APIs and adding this functionality turned out to be quite simple and elegantly sovable.
The second directory, Resources, contains all the extra files that need to be included in the app bundle for Mac but are not needed for any other system. These include some scripts for setting up an environment for inkscape and icon files in Apple’s format.
Other than that, the script works with an installed copy of Inkscape, and the Info.plist file in the base inkscape directory, which contains version information and is created by configure.
July 15th, 2005 at 3:02 pm
Congrats on the summer of code thingo! I shall have to read your blog now..
February 14th, 2007 at 9:13 am
It all sounds nice but I just installed Inkscape and when I double click it I just launch X11 and see nothing else. I don’t have Fink.
May 8th, 2007 at 12:44 pm
Marino, please post a bug report to the Inkscape Bug Tracker with details of your problem, including Inkscape version number, as well as your OS X version, etc. Myself or someone else should be able to offer some help.