2019-02-17 21:44:55 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ktlint";
|
2020-06-10 07:12:14 +01:00
|
|
|
version = "0.37.1";
|
2019-02-17 21:44:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint";
|
2020-06-10 07:12:14 +01:00
|
|
|
sha256 = "0i5frcy3ya1qwq0hl67gq6fgz0c8vgskgha25irsw7j2ndf4qp8i";
|
2019-02-17 21:44:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ jre ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
2019-08-15 13:41:18 +01:00
|
|
|
mkdir -p ${pname}-${version}
|
|
|
|
cp $curSrc ${pname}-${version}/ktlint
|
2019-02-17 21:44:55 +00: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";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://ktlint.github.io/";
|
2019-02-17 21:44:55 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ tadfisher ];
|
|
|
|
};
|
|
|
|
}
|