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

53 lines
1.6 KiB
Nix
Raw Normal View History

2014-02-08 20:48:50 +00:00
{ stdenv, fetchurl, makeWrapper
, coreutils, jdk, rlwrap, gnupg }:
stdenv.mkDerivation rec {
pname = "leiningen";
version = "2.9.1";
src = fetchurl {
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
sha256 = "1h0gpzpr7xk6hvmrrq41bcp2k9aai348baf8ad9bxvci01n4zb12";
};
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}/${pname}-${version}-standalone.zip";
sha256 = "1y2mva5s2w2szzn1b9rhz0dvkffls4ravii677ybcf2w9wd86z7a";
};
JARNAME = "${pname}-${version}-standalone.jar";
2019-06-19 16:45:34 +01:00
dontUnpack = true;
buildInputs = [ makeWrapper ];
2014-11-01 23:47: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
2016-08-23 11:38:24 +01:00
installPhase = ''
mkdir -p $out/bin $out/share
2016-08-23 11:38:24 +01:00
cp -v $src $out/bin/lein
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 \
--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 \
--prefix PATH ":" "${stdenv.lib.makeBinPath [ rlwrap coreutils ]}" \
--set LEIN_GPG ${gnupg}/bin/gpg \
2016-08-23 11:38:24 +01:00
--set JAVA_CMD ${jdk}/bin/java
'';
meta = {
homepage = "https://leiningen.org/";
description = "Project automation for Clojure";
license = stdenv.lib.licenses.epl10;
2014-11-11 14:44:45 +00:00
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}