2019-02-17 22:44:55 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ktlint";
|
2019-10-22 09:18:14 +02:00
|
|
|
version = "0.35.0";
|
2019-02-17 22:44:55 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint";
|
2019-10-22 09:18:14 +02:00
|
|
|
sha256 = "0zj18wcapnqny7k4wvwkyjfds6l2f4y22w6a84k06rzih2ghv0gm";
|
2019-02-17 22:44:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ jre ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
2019-08-15 14:41:18 +02:00
|
|
|
mkdir -p ${pname}-${version}
|
|
|
|
cp $curSrc ${pname}-${version}/ktlint
|
2019-02-17 22:44:55 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv ktlint $out/bin/ktlint
|
|
|
|
chmod +x $out/bin/ktlint
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/ktlint --prefix PATH : "${jre}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An anti-bikeshedding Kotlin linter with built-in formatter";
|
|
|
|
homepage = https://ktlint.github.io/;
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ tadfisher ];
|
|
|
|
};
|
|
|
|
}
|