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-10-09 19:29:22 +00:00
|
|
|
version = "1.0.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-10-09 19:29:22 +00:00
|
|
|
sha256 = "1pc1ck87l849xfy1lcdr1v3p84qyxn9725pvh09czvlqs58yy6ax";
|
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 ];
|
2023-07-15 17:15:38 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|