2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, jre_headless }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ktlint";
|
2022-02-20 05:27:41 +00:00
|
|
|
version = "0.44.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://github.com/pinterest/ktlint/releases/download/${version}/ktlint";
|
2022-02-20 05:27:41 +00:00
|
|
|
sha256 = "1l2pmvqw8rjl2xmsdp31j8015clshab6p81i3i05h40rjjz57mvr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-11-09 15:59:12 +00:00
|
|
|
install -Dm755 $src $out/bin/ktlint
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2020-11-09 15:59:12 +00:00
|
|
|
wrapProgram $out/bin/ktlint --prefix PATH : "${jre_headless}/bin"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An anti-bikeshedding Kotlin linter with built-in formatter";
|
|
|
|
homepage = "https://ktlint.github.io/";
|
|
|
|
license = licenses.mit;
|
2020-11-09 15:59:12 +00:00
|
|
|
platforms = jre_headless.meta.platforms;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ tadfisher SubhrajyotiSen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|