How to build Jape on Mac OS X

0. Software version problems
Japes built on Leopard (OS X 10.5) won't run on Tiger (OS X 10.4). Currently I build Jape on Leopard. The OCaml website says that OCaml 3.10 and 3.11 won't run on Tiger, but Bernard Sufrin says he just built Jape on Tiger with 3.10. The build process will now work with OCaml 3.09 (which definitely does work on Tiger). Investigations are continuing, and I shall see if the Tiger Jape will run on Leopard. (2009/03/11).

1. Install the developer tools (get them from Apple or from a CD).

1a. Make sure ant (installed by the developer tools) is known to the shell (and why Apple doesn't do this, I don't know). I added the following lines to ~/.profile:

## ant variables added by richard 13/ii/2008 start
## Do not remove the previous line
PATH="$PATH:/usr/share/ant/bin"
export PATH
ANTHOME="/usr/share/ant"
export ANTHOME
JAVA_HOME="/Library/Java/Home"
export JAVA_HOME
## Do not remove the next line
## ant variables added by richard 13/ii/2008 end

2. Install the latest OCaml to build the jape ‘engine’ (at time of writing, Jape is built using ocaml 3.10, but no doubt 3.11 would work just as well).

3. Get jarbundler, an ant task, to put the parts together and make a Mac OS X application. It's on sourceforge but the latest version is always available from the developer at http://informagen.com/JarBundler/ (sorry, don't know how to make that a hyperlink in TextEdit!). Follow the instructions and put jarbundler-?.?.?.jar in /usr/share/ant/lib.

4. In the directory where you found this file (japesource/MacOSX):
   
   make local 
   -- builds the engine and the GUI interface, bundles them together and puts them in ./build/Jape.app

   make run
   -- to try it out. If it works, move build/Jape.app where you like

5. If you want to make a version that runs on PowerPC and on Intel, you have to do a bit more.

5a. You have to be running on an Intel Mac, and you need two copies of Ocaml, as follows.

5b. First install the PPC Ocaml (it will overwrite the one you already have, if any, but don't worry).

5c. Squirrel away two parts of it:
	sudo mv /usr/local/bin/ocamlopt /usr/local/bin/ocamloptppc
	sudo mv /usr/local/lib/ocaml /usr/local/lib/ocamlppc

5d. Now install the Intel OCaml. 

5e. make release 
	will now do the business and give you a universal ./build/Jape.app.

Richard Bornat
richard@bornat.me.uk
11th March 2009