2022-09-30 11:47:45 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, jre_headless, gnused }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ktlint";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.49.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";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "1vm064b591lp5yygryz0p0zdfwlp1nhl5dv2nzx0y92j3911q0yz";
|
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 = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
wrapProgram $out/bin/ktlint --prefix PATH : "${lib.makeBinPath [ jre_headless gnused ]}"
|
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;
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md";
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ tadfisher SubhrajyotiSen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|