clojure: Mimic upstream install script
Also installs exec.jar in the expected location
This commit is contained in:
parent
6625284c39
commit
b364168989
@ -14,22 +14,28 @@ stdenv.mkDerivation rec {
|
|||||||
makeWrapper
|
makeWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# See https://github.com/clojure/brew-install/blob/1.10.1/src/main/resources/clojure/install/linux-install.sh
|
||||||
installPhase =
|
installPhase =
|
||||||
let
|
let
|
||||||
binPath = stdenv.lib.makeBinPath [ rlwrap jdk ];
|
binPath = stdenv.lib.makeBinPath [ rlwrap jdk ];
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
mkdir -p $out/libexec
|
clojure_lib_dir=$out
|
||||||
cp clojure-tools-${version}.jar $out/libexec
|
bin_dir=$out/bin
|
||||||
cp example-deps.edn $out
|
|
||||||
cp deps.edn $out
|
|
||||||
cp exec.jar $out
|
|
||||||
|
|
||||||
|
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 clojure --replace PREFIX $out
|
||||||
|
install -Dm755 clojure "$bin_dir/clojure"
|
||||||
|
install -Dm755 clj "$bin_dir/clj"
|
||||||
|
|
||||||
install -Dt $out/bin clj clojure
|
wrapProgram $bin_dir/clojure --prefix PATH : $out/bin:${binPath}
|
||||||
wrapProgram $out/bin/clj --prefix PATH : $out/bin:${binPath}
|
wrapProgram $bin_dir/clj --prefix PATH : $out/bin:${binPath}
|
||||||
wrapProgram $out/bin/clojure --prefix PATH : $out/bin:${binPath}
|
|
||||||
|
|
||||||
installManPage clj.1 clojure.1
|
installManPage clj.1 clojure.1
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user