2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
, coreutils, jdk, rlwrap, gnupg }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "leiningen";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "2.9.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "1sgnxw58srjxqnskl700p7r7n23pfpjvqpiqnz1m8r6c76jwnllr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
jarsrc = fetchurl {
|
2021-10-01 09:20:50 +00:00
|
|
|
url = "https://github.com/technomancy/leiningen/releases/download/${version}/${pname}-${version}-standalone.jar";
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "13f4n15i0gsk9jq52gxivnsk32qjahmxgrddm54cf8ynw0a923ia";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
JARNAME = "${pname}-${version}-standalone.jar";
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ jdk ];
|
|
|
|
|
|
|
|
# the jar is not in share/java, because it's a standalone jar and should
|
|
|
|
# never be picked up by set-java-classpath.sh
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
cp -v $src $out/bin/lein
|
|
|
|
cp -v $jarsrc $out/share/$JARNAME
|
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
chmod +x $out/bin/lein
|
|
|
|
patchShebangs $out/bin/lein
|
|
|
|
substituteInPlace $out/bin/lein \
|
|
|
|
--replace 'LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar' "LEIN_JAR=$out/share/$JARNAME"
|
|
|
|
wrapProgram $out/bin/lein \
|
2021-02-05 17:12:51 +00:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ rlwrap coreutils ]}" \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set LEIN_GPG ${gnupg}/bin/gpg \
|
|
|
|
--set JAVA_CMD ${jdk}/bin/java
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://leiningen.org/";
|
|
|
|
description = "Project automation for Clojure";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.epl10;
|
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
maintainers = with lib.maintainers; [ thiagokokada ];
|
2022-01-07 04:07:37 +00:00
|
|
|
mainProgram = "lein";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|