One of my favorite aspects of the Clojure community is how quickly it evolves.
- Install the core ZeroMQ libraries:
brew install zeromq
- Homebrew recently updated its formula for
pkg-config
to the require 0.25, so simply install it:brew install pkg-config
- Link
pkg.m4
into/usr/share/aclocal
sojzmq
can find it:sudo ln -s /usr/local/share/aclocal/pkg.m4 /usr/share/aclocal/pkg.m4
- Build
jzmq
git clone git://github.com/zeromq/jzmq.git cd jzmq ./autogen.sh ./configure make sudo make install
- A new trick: Use
maven
to install the requiredZmq.jar
into your local repository (located at$HOME/.m2/repositories
by default):mvn install:install-file -Dfile=src/Zmq.jar -DgroupId=org.zeromq -DartifactId=jzmq -Dversion=2.0.8-SNAPSHOT -Dpackaging=jar
- At this point, the steps from the previous article take over. Edit your
project.clj
for the install.(defproject my-project "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contrib "1.2.0"] [org.zeromq/jzmq "2.0.8-SNAPSHOT"] [org.clojars.mikejs/clojure-zmq "2.0.7-SNAPSHOT"]] :dev-dependencies [[swank-clojure "1.2.1"]] ; This sets the 'java.library.path' property ; so Java can find the ZeroMQ dylib :native-path "/usr/local/lib")
- Build the project dependencies:
lein deps
- Enjoy!
This process is much refined over the original. It's simple enough now that I was able to wrap everything up into a single installer script, available as a gist on Github. It installs the supporting libraries via Homebrew, builds jzmq
, then pulls down a simple test app to verify that everything is installed correctly.