1{ stdenv, fetchurl, unzip, ant, jdk, makeWrapper }:
2
3let version = "1.6.0"; in
4
5stdenv.mkDerivation {
6 name = "clojure-${version}";
7
8 src = fetchurl {
9 url = "http://repo1.maven.org/maven2/org/clojure/clojure/${version}/clojure-${version}.zip";
10 sha256 = "0yv67gackrzlwn9f8cnpw14y2hwspklxhy1450rl71vdrqjahlwq";
11 };
12
13 buildInputs = [ unzip ant jdk makeWrapper ];
14
15 buildPhase = "ant jar";
16
17 installPhase = ''
18 mkdir -p $out/share/java $out/bin
19 install -t $out/share/java clojure.jar
20 makeWrapper ${jdk.jre}/bin/java $out/bin/clojure --add-flags "-cp $out/share/java/clojure.jar clojure.main"
21 '';
22
23 meta = {
24 description = "A Lisp dialect for the JVM";
25 homepage = http://clojure.org/;
26 license = stdenv.lib.licenses.bsd3;
27 longDescription = ''
28 Clojure is a dynamic programming language that targets the Java
29 Virtual Machine. It is designed to be a general-purpose language,
30 combining the approachability and interactive development of a
31 scripting language with an efficient and robust infrastructure for
32 multithreaded programming. Clojure is a compiled language - it
33 compiles directly to JVM bytecode, yet remains completely
34 dynamic. Every feature supported by Clojure is supported at
35 runtime. Clojure provides easy access to the Java frameworks, with
36 optional type hints and type inference, to ensure that calls to Java
37 can avoid reflection.
38
39 Clojure is a dialect of Lisp, and shares with Lisp the code-as-data
40 philosophy and a powerful macro system. Clojure is predominantly a
41 functional programming language, and features a rich set of immutable,
42 persistent data structures. When mutable state is needed, Clojure
43 offers a software transactional memory system and reactive Agent
44 system that ensure clean, correct, multithreaded designs.
45 '';
46 maintainers = with stdenv.lib.maintainers; [ the-kenny ];
47 };
48}