citizen428 / ClojureX forked from carlism/Clojure-MacOSX

An easy way to set up a full Clojure development environment on OS X

This URL has Read+Write access

name age message
file .gitignore Sun Mar 29 05:28:43 -0700 2009 First commit [mreid]
file .gitmodules Sun Aug 23 14:48:23 -0700 2009 Added Emacs stuff (clojure-mode, slime and swan... [citizen428]
submodule Clojure.tmbundle - 689e399 Wed Jul 29 09:55:30 -0700 2009 Added textmate bundle [carlism]
file README.markdown Fri Dec 11 17:00:33 -0800 2009 Small changes to README [citizen428]
file build.xml Tue Sep 08 03:16:08 -0700 2009 Added 'update_all' script and modified README t... [citizen428]
file clj Fri Dec 11 17:00:33 -0800 2009 Small changes to README [citizen428]
submodule clojure - 1ca9c8b Tue Oct 06 11:47:04 -0700 2009 Updated submodule refs [citizen428]
submodule clojure-contrib - 39618b6 Thu Sep 03 08:11:01 -0700 2009 Updated submodule refs [citizen428]
submodule clojure-mode - 2e83506 Tue Oct 06 11:47:04 -0700 2009 Updated submodule refs [citizen428]
file configure_emacs Sat Oct 10 07:47:48 -0700 2009 Updated configure_emacs to make swank-clojure w... [citizen428]
file configure_textmate Sun Aug 23 14:48:23 -0700 2009 Added Emacs stuff (clojure-mode, slime and swan... [citizen428]
file create_symlink Sun Aug 23 14:48:23 -0700 2009 Added Emacs stuff (clojure-mode, slime and swan... [citizen428]
submodule jline - 4d2e4ba Mon Jul 27 13:54:02 -0700 2009 Added modules, a build file, beginning docs, an... [carlism]
submodule slime - 9e3e99e Tue Oct 06 11:47:04 -0700 2009 Updated submodule refs [citizen428]
submodule swank-clojure - 96b6246 Tue Oct 06 11:47:04 -0700 2009 Updated submodule refs [citizen428]
file test.clj Wed Apr 01 03:08:15 -0700 2009 Added simple instructions [mreid]
file update_all Tue Sep 08 03:16:08 -0700 2009 Added 'update_all' script and modified README t... [citizen428]
README.markdown

ClojureX

Easy set up for Clojure.

Supported Platforms

  • Linux (tested on Ubuntu 9.10)
  • Mac OS X 10.5+
  • Windows (Cygwin)

Set Up Instructions

$ git clone git://github.com/citizen428/ClojureX.git clojure
$ cd clojure

Grab all packages (clojure, clojure-contrib, jline and TextMate/Emacs support):

$ git submodule init
$ git submodule update

Build the packages:

$ ant

To create a symlink for the clj script in /usr/local/bin you can run the following command:

$ ./create_symlink

If you prefer to create the link somewhere else, you can do it manually like this:

$ ln -s <full path to this project>/clj <destination path>/clj

To setup support for TextMate, run the following command which creates a symlink to the bundle in ~/Library/Application\ Support/TextMate/Bundles/:

$ ./configure_textmate

If you prefer Emacs for Clojure development the following command will add the necessary configuration for clojure-mode, slime and swank-clojure to your ~/.emacs:

$ ./configure_emacs

Usage

The clj command can be used to open an interactive session:

$ clj
Clojure
user=> 

It can be used to run a script:

$ clj test.clj 
Hello, Clojure!

or it can be used to make a script file executable by starting your file with this line:

#!/usr/bin/env clj

then chmod u+x your file and run it.

You can also open a debug port like this:

# clj -d 1234 test.clj

Note: The clj script expects $JAVA_HOME in its environment. If $JAVA_HOME is not set, it will attempt to determine it for you. Currently, automatic detection works on Mac OS X 10.5+ only. If for some reason you cannot provide $JAVA_HOME, you can set the $JAVA variable at the top of the clj script.

Working with Clojure

To add extra jar files to Clojure's classpath on a project-by-project basis, just create a .clojure file in the project's directory. Here's an example:

If your project directory is ~/code/clojure/cafe, you can add the Grinder and Frother jars from the ~/code/clojure/cafe/lib directory by putting their relative paths, separated by a colon, into the .clojure file:

$ cd ~/code/clojure/cafe
$ echo "lib/grinder.jar:lib/frother.jar" > .clojure

Staying up to date

Once you have a local checkout of ClojureX, it's easy to keep your Clojure installation up to date:

$ cd clojure
$ cd <submodule you want to update>
$ git pull origin master

To update the source for all submodules at the same time, you can issue the following command:

$ ./update_all

If there were any updates to clojure, clojure-contrib or jline you will have to rebuild them like this:

$ ant

Todo

  • Add scripts to work with Clojure projects after installation

Acknowledgements