1{ stdenv, fetchurl, jdk11, rlwrap, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "clojure";
5 version = "1.10.1.469";
6
7 src = fetchurl {
8 url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz";
9 sha256 = "0hpb6rixmgllss69vl9zlpb41svm4mx4xmfbq1q7y12jsxckzgpq";
10 };
11
12 buildInputs = [ makeWrapper ];
13
14 outputs = [ "out" "prefix" ];
15
16 installPhase = let
17 binPath = stdenv.lib.makeBinPath [ rlwrap jdk11 ];
18 in ''
19 mkdir -p $prefix/libexec
20 cp clojure-tools-${version}.jar $prefix/libexec
21 cp example-deps.edn $prefix
22
23 substituteInPlace clojure --replace PREFIX $prefix
24
25 install -Dt $out/bin clj clojure
26 wrapProgram $out/bin/clj --prefix PATH : $out/bin:${binPath}
27 wrapProgram $out/bin/clojure --prefix PATH : $out/bin:${binPath}
28 '';
29
30 meta = with stdenv.lib; {
31 description = "A Lisp dialect for the JVM";
32 homepage = https://clojure.org/;
33 license = licenses.epl10;
34 longDescription = ''
35 Clojure is a dynamic programming language that targets the Java
36 Virtual Machine. It is designed to be a general-purpose language,
37 combining the approachability and interactive development of a
38 scripting language with an efficient and robust infrastructure for
39 multithreaded programming. Clojure is a compiled language - it
40 compiles directly to JVM bytecode, yet remains completely
41 dynamic. Every feature supported by Clojure is supported at
42 runtime. Clojure provides easy access to the Java frameworks, with
43 optional type hints and type inference, to ensure that calls to Java
44 can avoid reflection.
45
46 Clojure is a dialect of Lisp, and shares with Lisp the code-as-data
47 philosophy and a powerful macro system. Clojure is predominantly a
48 functional programming language, and features a rich set of immutable,
49 persistent data structures. When mutable state is needed, Clojure
50 offers a software transactional memory system and reactive Agent
51 system that ensure clean, correct, multithreaded designs.
52 '';
53 maintainers = with maintainers; [ jlesquembre ];
54 platforms = platforms.unix;
55 };
56}