nixpkgs/pkgs/development/tools/ktlint/default.nix
2020-06-10 06:12:14 +00:00

39 lines
923 B
Nix

{ stdenv, fetchurl, makeWrapper, jre }:
stdenv.mkDerivation rec {
pname = "ktlint";
version = "0.37.1";
src = fetchurl {
url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint";
sha256 = "0i5frcy3ya1qwq0hl67gq6fgz0c8vgskgha25irsw7j2ndf4qp8i";
};
nativeBuildInputs = [ makeWrapper ];
propagatedBuildInputs = [ jre ];
unpackCmd = ''
mkdir -p ${pname}-${version}
cp $curSrc ${pname}-${version}/ktlint
'';
installPhase = ''
mkdir -p $out/bin
mv ktlint $out/bin/ktlint
chmod +x $out/bin/ktlint
'';
postFixup = ''
wrapProgram $out/bin/ktlint --prefix PATH : "${jre}/bin"
'';
meta = with stdenv.lib; {
description = "An anti-bikeshedding Kotlin linter with built-in formatter";
homepage = "https://ktlint.github.io/";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ tadfisher ];
};
}