nixpkgs/pkgs/development/tools/ktlint/default.nix

39 lines
923 B
Nix
Raw Normal View History

2019-02-17 21:44:55 +00:00
{ stdenv, fetchurl, makeWrapper, jre }:
stdenv.mkDerivation rec {
pname = "ktlint";
2019-12-08 13:16:28 +00:00
version = "0.36.0";
2019-02-17 21:44:55 +00:00
src = fetchurl {
url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint";
2019-12-08 13:16:28 +00:00
sha256 = "0pjxd4z0byqrr5qbk3k38vr1ln052m5vhlrky4agmhg5zhn38mm6";
2019-02-17 21:44:55 +00:00
};
nativeBuildInputs = [ makeWrapper ];
propagatedBuildInputs = [ jre ];
unpackCmd = ''
mkdir -p ${pname}-${version}
cp $curSrc ${pname}-${version}/ktlint
2019-02-17 21:44:55 +00:00
'';
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/";
2019-02-17 21:44:55 +00:00
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ tadfisher ];
};
}