From b364168989544a8c52de56b3a4ed15cd49b05254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Lafuente?= Date: Wed, 18 Nov 2020 17:47:54 +0100 Subject: [PATCH] clojure: Mimic upstream install script Also installs exec.jar in the expected location --- .../interpreters/clojure/default.nix | 22 ++++++++++++------- 1 file 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 '';