diff options
Diffstat (limited to 'pkgs/development/interpreters/clojure/default.nix')
-rw-r--r-- | pkgs/development/interpreters/clojure/default.nix | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix index 53cef387ae4..9ae94f0a248 100644 --- a/pkgs/development/interpreters/clojure/default.nix +++ b/pkgs/development/interpreters/clojure/default.nix @@ -1,12 +1,13 @@ -{ stdenv, fetchurl, installShellFiles, jdk11, rlwrap, makeWrapper }: +{ lib, stdenv, fetchurl, installShellFiles, jdk, rlwrap, makeWrapper }: stdenv.mkDerivation rec { pname = "clojure"; - version = "1.10.1.645"; + version = "1.10.3.855"; src = fetchurl { + # https://clojure.org/releases/tools url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz"; - sha256 = "1z6a9an8ls992y4japmzdxay7c5d2z9s2q1xl4g615r23jwpcsf9"; + sha256 = "sha256-y2PuOBRq5kZlTpPV8NwkWhspQKlNxwjl+k/Drwixk4Q="; }; nativeBuildInputs = [ @@ -14,24 +15,35 @@ stdenv.mkDerivation rec { makeWrapper ]; + # See https://github.com/clojure/brew-install/blob/1.10.3/src/main/resources/clojure/install/linux-install.sh installPhase = let - binPath = stdenv.lib.makeBinPath [ rlwrap jdk11 ]; + binPath = lib.makeBinPath [ rlwrap jdk ]; in '' - mkdir -p $out/libexec - cp clojure-tools-${version}.jar $out/libexec - cp example-deps.edn $out - cp deps.edn $out - cp clj_exec.clj $out + runHook preInstall + clojure_lib_dir=$out + bin_dir=$out/bin + + echo "Installing libs into $clojure_lib_dir" + install -Dm644 deps.edn "$clojure_lib_dir/deps.edn" + install -Dm644 example-deps.edn "$clojure_lib_dir/example-deps.edn" + install -Dm644 exec.jar "$clojure_lib_dir/libexec/exec.jar" + install -Dm644 clojure-tools-${version}.jar "$clojure_lib_dir/libexec/clojure-tools-${version}.jar" + + echo "Installing clojure and clj into $bin_dir" substituteInPlace clojure --replace PREFIX $out + substituteInPlace clj --replace BINDIR $bin_dir + install -Dm755 clojure "$bin_dir/clojure" + install -Dm755 clj "$bin_dir/clj" - install -Dt $out/bin clj clojure - wrapProgram $out/bin/clj --prefix PATH : $out/bin:${binPath} - wrapProgram $out/bin/clojure --prefix PATH : $out/bin:${binPath} + wrapProgram $bin_dir/clojure --prefix PATH : $out/bin:${binPath} + wrapProgram $bin_dir/clj --prefix PATH : $out/bin:${binPath} installManPage clj.1 clojure.1 + + runHook postInstall ''; doInstallCheck = true; @@ -41,7 +53,7 @@ stdenv.mkDerivation rec { -Sverbose \ -Scp $out/libexec/clojure-tools-${version}.jar ''; - meta = with stdenv.lib; { + meta = with lib; { description = "A Lisp dialect for the JVM"; homepage = "https://clojure.org/"; license = licenses.epl10; @@ -64,7 +76,7 @@ stdenv.mkDerivation rec { offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs. ''; - maintainers = with maintainers; [ jlesquembre ]; + maintainers = with maintainers; [ jlesquembre thiagokokada ]; platforms = platforms.unix; }; } |