2014-02-08 20:48:50 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
2016-08-23 11:38:24 +01:00
|
|
|
, coreutils, jdk, rlwrap, gnupg1compat }:
|
2012-01-19 20:34:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "leiningen";
|
2017-02-06 07:44:20 +00:00
|
|
|
version = "2.7.1";
|
2012-01-19 20:34:59 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2012-05-11 04:36:13 +01:00
|
|
|
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
|
2017-02-06 07:44:20 +00:00
|
|
|
sha256 = "0rmshl4xchf3blwvar4q9dpxm9xznn3yzas4vwxqiq3yhapgqkn0";
|
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
|
|
|
|
url = "https://github.com/technomancy/leiningen/releases/download/${version}/${name}-standalone.zip";
|
2017-02-06 07:44:20 +00:00
|
|
|
sha256 = "0ivwb1qlxs1hyical0fjgavm9wfkw3f10sk67p5g2p5lpf4pxp1d";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
|
|
|
|
2016-08-23 11:38:24 +01:00
|
|
|
JARNAME = "${name}-standalone.jar";
|
2012-05-11 04:36:13 +01:00
|
|
|
|
2016-08-23 11:38:24 +01:00
|
|
|
unpackPhase = "true";
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2012-05-11 04:36:13 +01:00
|
|
|
buildInputs = [ makeWrapper ];
|
2014-11-01 23:47:52 +00:00
|
|
|
propagatedBuildInputs = [ jdk ];
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2016-08-23 11:38:24 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/java
|
|
|
|
|
|
|
|
cp -v $src $out/bin/lein
|
|
|
|
cp -v $jarsrc $out/share/java/$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/java/$JARNAME"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/lein \
|
|
|
|
--prefix PATH ":" "${stdenv.lib.makeBinPath [ rlwrap coreutils ]}" \
|
|
|
|
--set LEIN_GPG ${gnupg1compat}/bin/gpg \
|
|
|
|
--set JAVA_CMD ${jdk}/bin/java
|
|
|
|
'';
|
|
|
|
|
2012-01-19 20:34:59 +00:00
|
|
|
meta = {
|
2017-08-02 22:50:51 +01:00
|
|
|
homepage = https://leiningen.org/;
|
2012-01-19 20:34:59 +00:00
|
|
|
description = "Project automation for Clojure";
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.epl10;
|
2014-11-11 14:44:45 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
2014-04-23 13:26:16 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
2012-02-29 14:35:34 +00:00
|
|
|
}
|