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-07-14 12:49:19 +00:00
|
|
|
version = "0.46.1";
|
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-07-14 12:49:19 +00:00
|
|
|
sha256 = "sha256-RcXhEESQsvKjQtO33dlImOp24mfJmRAL5AeR/3JCdq0=";
|
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
|
|
|
};
|
|
|
|
}
|