3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/build-managers/leiningen/default.nix

54 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeWrapper
, coreutils, jdk, rlwrap, gnupg }:
stdenv.mkDerivation rec {
pname = "leiningen";
2020-12-21 15:14:01 +00:00
version = "2.9.5";
src = fetchurl {
url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
2020-12-21 15:14:01 +00:00
sha256 = "12kv3286a2vkm3qpm2msiks87mkspxddgl7bwiacdias9dfda09n";
};
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";
2020-12-21 15:14:01 +00:00
sha256 = "1shyvg1471sc3bv4h3ax51626xw8a8w05f43bny6gmp8pyc0qjfz";
};
JARNAME = "${pname}-${version}-standalone.jar";
2019-06-19 16:45:34 +01:00
dontUnpack = true;
nativeBuildInputs = [ 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 ":" "${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 = lib.licenses.epl10;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [ thiagokokada ];
};
}