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";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "0.47.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-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-ozOtAXI2mlzZc66oPgLotpjAai2qxvMpJdoDBJqj3Oc=";
|
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;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ tadfisher SubhrajyotiSen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|