2019-02-17 22:44:55 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ktlint-${version}";
|
2019-07-19 19:37:38 +02:00
|
|
|
version = "0.34.0";
|
2019-02-17 22:44:55 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint";
|
2019-07-19 19:37:38 +02:00
|
|
|
sha256 = "1mry999aqmbljp2ybkgf9hps8z4aa254b1bsivi559gzsvdkmqh7";
|
2019-02-17 22:44:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ jre ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
|
|
|
mkdir -p ${name}
|
|
|
|
cp $curSrc ${name}/ktlint
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|