Jul 3, 2009

haxe & neko for macports

Yay! I finally got the haXe and neko ports to compile properly, it took a while as I had to learn how Makefiles and Portfiles work (besides how to compile C and neko).

First, I’ve set up my own forks of both haXe and neko at github.com as it’s easier for me to modify and share with others, they’re updated from the official repositories regularly. And then I got neko to actually compile on Mac by modifying some parts of the source code. Then after alot of time spent on reading the MacPorts guide book I finally got a working Portfile for downloading (from github), patching the Makefile, compiling and finally installing the neko binaries into the MacPorts directories. This wasn’t so easy as I had alot of troubles getting the binaries to find the libraries afterwards.

After getting this far it was a lot easier as I understood how it all came together, so modifying the Makefile for haXe was much less work, and the only thing I had problems with was getting it to play nicely with the environment variables set for neko so it could compile the haxelib and haxedoc tools that comes with it (but I got it to work thanks to some people at the MacPorts irc channel).

Actually, I did one nice hacky solution to get the downloading for the haXe port to work properly: I created an extra git repository which submoduled the other repositories needed to compile haXe (haxe, neko and ocaml). It works like a charm though.

So you’d like to try it out you just need to clone my ports repository. And to use a local repository you just point to the repository in the sources.conf (usually found in /opt/local/etc/macports/). And then you just run “sudo port install haxe” and both of them should be compiled and installed (as neko is a dependency). Just remember to first uninstall haXe and neko (by removing the haXe and neko related files in /usr/lib and /usr/bin) in case you have an old version or you’ll get funny errors. Oh, and don’t forget to follow the instructions after the installation or you’ll get some errors when it won’t find the libraries. Apparently it’s the recommended way of setting environment variables with macports; telling the user to do it themselves.

These will be fixed some more, to preferably use the official sources on CVS, and if Nicolas and the others approves I might actually submit it to the official MacPorts repository eventually.

Comment
About
developing software is fun.
sitting in a pleasant sofa is fun.
combine for double the fun.
Search