mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
generated using https://git.kybe.xyz/2kybe3/nixpkgs-github-redirect continuation of: #538981
64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
jdk17,
|
|
fetchFromGitHub,
|
|
jre_headless,
|
|
makeWrapper,
|
|
gradle,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "ktfmt";
|
|
version = "0.63";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Kotlin";
|
|
repo = "ktfmt";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-wAnlUEPFyilAbEXN6DGXHXeYfZgx2tlp4vDENP4O2Hw=";
|
|
};
|
|
|
|
patches = ./remove-idea-plugin.patch;
|
|
|
|
nativeBuildInputs = [
|
|
gradle
|
|
jdk17
|
|
makeWrapper
|
|
];
|
|
|
|
mitmCache = gradle.fetchDeps {
|
|
inherit (finalAttrs) pname;
|
|
data = ./deps.json;
|
|
};
|
|
__darwinAllowLocalNetworking = true; # this is required for using mitm-cache on Darwin
|
|
|
|
gradleFlags = [ "-Dfile.encoding=utf-8" ];
|
|
|
|
doCheck = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm644 core/build/libs/ktfmt-*-with-dependencies.jar $out/share/ktfmt/ktfmt.jar
|
|
|
|
makeWrapper ${jre_headless}/bin/java $out/bin/ktfmt \
|
|
--add-flags "-jar $out/share/ktfmt/ktfmt.jar"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions";
|
|
homepage = "https://github.com/Kotlin/ktfmt";
|
|
license = lib.licenses.asl20;
|
|
mainProgram = "ktfmt";
|
|
maintainers = with lib.maintainers; [ ghostbuster91 ];
|
|
sourceProvenance = with lib.sourceTypes; [
|
|
fromSource
|
|
binaryBytecode # mitm cache
|
|
];
|
|
inherit (jre_headless.meta) platforms;
|
|
};
|
|
})
|