Getting Leiningen 2 to play along with LWJGL

Started by Cubic, October 09, 2012, 09:43:33

Previous topic - Next topic

Cubic

I'm trying to use LWJGL with Clojure (using Leiningen 2 for Project management). Specifying
org.lwjgl.lwjgl/lwjgl "2.8.4"
as a dependency did work more or less as expected, but didn't add any native dependencies (it downloaded them, but rather than putting them on java.library.path they ended up on the classpath).

Now I just ended up extracting all native libs from the jars, putting them in a directory called native, and pointed java.library.path there. It seems to work for now (on my linux machine anyway), but I am rather unhappy with this:


  • I'm not sure whether this will work on all platforms Windows/Linux/MacOSX. I don't see why not, but that never stopped anything from going wrong.
  • I want to make the project setup as simple as possible, because I have to "sell" this to a few friends of mine who never worked with clojure, opengl or had to deal with java native dependencies. Locating the 10th subdirectory in a (default hidden) Maven directory,  extracting the jars there and copying the contents into a new folder on the project path, then editing the project settings to point java.library.path to that directory, and then doing half of that again when wrapping the project up in an uberjar (because leiningen still doesn't know anything about the natives) isn't simple at all.

Ideally, I would like to be able to tell leiningen to do all of this in the project.clj.