2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper
|
2019-03-20 18:23:30 +00:00
|
|
|
, coreutils, jdk, rlwrap, gnupg }:
|
2012-01-19 20:34:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "leiningen";
|
2020-12-21 15:14:01 +00:00
|
|
|
version = "2.9.5";
|
2012-01-19 20:34:59 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-05-11 04:36:13 +01:00
|
|
|
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
|
2020-12-21 15:14:01 +00:00
|
|
|
sha256 = "12kv3286a2vkm3qpm2msiks87mkspxddgl7bwiacdias9dfda09n";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
jarsrc = fetchurl {
|
2015-01-10 13:38:45 +00:00
|
|
|
# NOTE: This is actually a .jar, Github has issues
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://github.com/technomancy/leiningen/releases/download/${version}/${pname}-${version}-standalone.zip";
|
2020-12-21 15:14:01 +00:00
|
|
|
sha256 = "1shyvg1471sc3bv4h3ax51626xw8a8w05f43bny6gmp8pyc0qjfz";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
JARNAME = "${pname}-${version}-standalone.jar";
|
2012-05-11 04:36:13 +01:00
|
|
|
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-11-01 23:47:52 +00:00
|
|
|
propagatedBuildInputs = [ jdk ];
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2018-12-04 01:57:28 +00:00
|
|
|
# the jar is not in share/java, because it's a standalone jar and should
|
|
|
|
# never be picked up by set-java-classpath.sh
|
|
|
|
|
2016-08-23 11:38:24 +01:00
|
|
|
installPhase = ''
|
2018-12-04 01:57:28 +00:00
|
|
|
mkdir -p $out/bin $out/share
|
2016-08-23 11:38:24 +01:00
|
|
|
cp -v $src $out/bin/lein
|
2018-12-04 01:57:28 +00:00
|
|
|
cp -v $jarsrc $out/share/$JARNAME
|
2016-08-23 11:38:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
chmod +x $out/bin/lein
|
|
|
|
patchShebangs $out/bin/lein
|
|
|
|
substituteInPlace $out/bin/lein \
|
2018-12-04 01:57:28 +00:00
|
|
|
--replace 'LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar' "LEIN_JAR=$out/share/$JARNAME"
|
2016-08-23 11:38:24 +01:00
|
|
|
wrapProgram $out/bin/lein \
|
2021-01-23 12:26:19 +00:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ rlwrap coreutils ]}" \
|
2019-03-20 18:23:30 +00:00
|
|
|
--set LEIN_GPG ${gnupg}/bin/gpg \
|
2016-08-23 11:38:24 +01:00
|
|
|
--set JAVA_CMD ${jdk}/bin/java
|
|
|
|
'';
|
|
|
|
|
2012-01-19 20:34:59 +00:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://leiningen.org/";
|
2012-01-19 20:34:59 +00:00
|
|
|
description = "Project automation for Clojure";
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.epl10;
|
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
maintainers = with lib.maintainers; [ thiagokokada ];
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
2012-02-29 14:35:34 +00:00
|
|
|
}
|