diff options
Diffstat (limited to 'pkgs/development/interpreters/clojure/default.nix')
-rw-r--r-- | pkgs/development/interpreters/clojure/default.nix | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix index bebb5376b8a2..f12645ec2b62 100644 --- a/pkgs/development/interpreters/clojure/default.nix +++ b/pkgs/development/interpreters/clojure/default.nix @@ -14,22 +14,28 @@ stdenv.mkDerivation rec { makeWrapper ]; + # See https://github.com/clojure/brew-install/blob/1.10.1/src/main/resources/clojure/install/linux-install.sh installPhase = let binPath = stdenv.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 exec.jar $out + 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 + 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 ''; |