September 14, 2006

The state of Mono support on Mac OS X

Author: Nathan Willis

Most Linux users are well acquainted with the Mono Project by now; the free implementation of Microsoft's .Net Framework and its associated development tools has produced some impressive applications, and is even shipping in the default releases of several prominent Linux distributions. But since Mono bills itself as a cross-platform alternative to .Net, I decided to see how it fares on Mac OS X.

Mono's officially supported platforms are Linux, Mac OS X, Windows, Solaris, and the big three BSD variants (FreeBSD, OpenBSD, and NetBSD). Mono creator Miguel de Icaza says that the BSD ports are completely community-driven, while the Solaris and OS X ports are maintained by programmers at corporate sponsor Novell.

Getting Windows users to switch over to Mono is bound to be an uphill battle, since they have Microsoft's .Net as a native application. On the other hand, Windows ports are already available for a great many other toolkits and libraries that originated on Linux, such as GTK+. That opens up the possibility of running Mono applications in addition to those written for .Net itself.

The distinction is that Mono implements not only the core ECMA/ISO .Net Framework, but a slew of class libraries to integrate that framework with GNOME, Mozilla, and other technologies. And most of the Mono apps familiar to Linux users -- such as F-Spot, Beagle, and Banshee -- make use of external libraries like GTK# to bind to the aforementioned non-.Net components.

The good news is that GTK#, GNOME, Mozilla, and most of the other components are concurrently developed for other Unix-like systems. That means that the BSDs and Solaris can use Mono apps like F-Spot and Beagle without much hassle.

The current state of Mac support

That brings us to Mac OS X, where Linux emigrants have long grappled with less-than-fluid integration between Apple's native APIs and components brought over from other operating systems.

In truth, 100% .Net applications run well on OS X. For example, Novell offers its own iFolder product for OS X -- equally supported alongside Windows and Linux. De Icaza also pointed me to a pair of interesting third-party applications: the 3-D game engine Unity and the instant messenger/social-network combo imeem.

Both are Windows-and-Mac products that utilize .Net on the former platform and Mono on the latter. To simplify matters for the end user, they both bundle the Mono runtime inside their OS X deployments. The end user need never even know.

For the Mac purist, then, Mono is clear win. But when you start craving those fancy Linux apps, things get complicated. Unlike the BSDs and Solaris, the imported Linux components are supported by neither Apple nor the Mono Project itself. In particular, virtually all Linux apps written for Mono depend on GTK#, the .Net bindings for the GTK+ toolkit (GTK# contains bindings to other GNOME libraries as well, but far and away the most critical one is GTK+).

Most Linux junkies on OS X make use of the Fink porting and packaging project to fill their free software vacancies. As of the current (0.8.1) release, Fink maintains OS X ports for more than 6,500 packages, including the entire GNOME desktop environment.

The official Mono on OS X installation instructions recommend installing the dependencies through Fink, then compiling GTK# from source in a process described as "a little effort-intensive."

Actually, running familiar Mono apps like Banshee on OS X is at present a herculean ordeal. You need to install the Mono package for OS X, then a bevy of ported Linux libraries via Fink, and then compile GTK# from source.

Native GTK+ -> Native GTK# -> Linux apps on OS X

A brighter future may be on the horizon, though. De Icaza points out that even with GTK+ installed, Mono apps that utilize it still depend on Apple's X11 implementation, not OS X's native GUI toolkit. But, he adds, a native OS X port of GTK+ is in the works.

Once it reaches stability, the Mono Project will be able to package it up with a GTK# installer and bundle it with their OS X Mono deployment, both simplifying the installation procedure and providing users with better-integrated applications.

The independent development house Imendio AB is leading the work on the OS X port of GTK+. Imendio's effort consists of supporting developer time and working within the main branch of GTK+, not of creating a separate OS X fork of the code.

You can follow their progress at the project page on Imendio's company wiki. There the company also maintains a roadmap, to-do list, and build instructions. Currently building GTK+ for OS X requires checking out the code from GNOME CVS.

Free software has an important role to play even on non-free operating systems. Mac aficionados have (regrettably) earned a reputation for hostility toward ports of Linux applications, stemming from an attitude that OS X is a "better" Unix than Linux, therefore Linux apps are something of a downgrade. A cross-platform framework like Mono could in theory help those users discover some great new apps for themselves. As of right now, though, we're still a long way off.

Click Here!