Building Cocotron for use with CCL

First, install Xcode on a Macintosh.

Next, install the Cocotron tools. Follow the directions found at

With the tools installed, you are ready to build the Cocotron sources. You will need to install Mercurial. Check out the source code with

hg clone cocotron

Next, apply the patch from $REPO/trunk/aux/cocotron/win32/cocotron/cocotron-r59942ee67d15.patch (This patch contains some changes to NSDocument.m and NSApplication.m.) Something like this will probably work:

$ cd cocotron/AppKit
$ patch -p2 </path/to/patch

Open cocotron/Cocoa/Cocoa.xcodeproj, and build it.

Now, do the following:

$ mkdir /tmp/cocotron
$ cd /Developer/Cocotron/1.0/Windows/i386/Frameworks
$ /Developer/Cocotron/1.0/bin/retargetBundle -F . -framework Foundation -framework AppKit  -destination /tmp/cocotron

To build interfaces, you need an interface translator. The process is similar to that outlines in BuildFFIGEN, but you use the patches in, and the gcc sources from the Cocotron tools.

Now, assuming that on your Windows system you have a ccl:cocotron; directory, do the following steps:

  • tar up /tmp/cocotron and untar it into ccl:cocotron; on the Windows system
  • get the win32-headers directory from svn onto your Macintosh system, go into win32-headers/cocoa/C/ and run
  • tar up win32-headers/cocoa/C and move it over to the Windows system
  • on the Windows system, parse the ffi files in the usual way, i.e., (require 'parse-ffi) (dotimes (i 2) (parse-standard-ffi-files :cocoa))

If you're lucky, it might work.