nixpkgs/pkgs/development/tools/build-managers/leiningen/default.nix

55 lines
1.6 KiB
Nix
Raw Normal View History

2014-02-08 21:48:50 +01:00
{ stdenv, fetchurl, makeWrapper
2016-08-23 12:38:24 +02:00
, coreutils, jdk, rlwrap, gnupg1compat }:
stdenv.mkDerivation rec {
pname = "leiningen";
2018-01-09 14:06:44 +01:00
version = "2.8.1";
name = "${pname}-${version}";
src = fetchurl {
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
2018-01-09 14:06:44 +01:00
sha256 = "0wk4m7m66xxx7i3nis08mc8qna7acgcmpim562vdyyrpbxdhj24i";
};
jarsrc = fetchurl {
2015-01-10 14:38:45 +01:00
# NOTE: This is actually a .jar, Github has issues
url = "https://github.com/technomancy/leiningen/releases/download/${version}/${name}-standalone.zip";
2018-01-09 14:06:44 +01:00
sha256 = "0n3wkb0a9g25r1xq93lskay2lw210qymz2qakjnl5vr5zz3vnjgw";
};
2016-08-23 12:38:24 +02:00
JARNAME = "${name}-standalone.jar";
2016-08-23 12:38:24 +02:00
unpackPhase = "true";
buildInputs = [ makeWrapper ];
2014-11-02 00:47:52 +01:00
propagatedBuildInputs = [ jdk ];
2016-08-23 12:38:24 +02: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
'';
meta = {
homepage = https://leiningen.org/;
description = "Project automation for Clojure";
license = stdenv.lib.licenses.epl10;
2014-11-11 15:44:45 +01:00
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
};
}