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