From 656409d2a4cb5074c770eada3a9284fc8986c87f Mon Sep 17 00:00:00 2001 From: Filip Czaplicki Date: Sun, 5 May 2024 23:10:30 +0200 Subject: [PATCH] kotlin-interactive-shell: init at 0.5.2 (#285902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * kotlin-interactive-shell: init at 0.5.2 Apply suggestions from code review Add meta.mainProgram Co-authored-by: Robert Schütz Update pkgs/by-name/ki/ki/package.nix Co-authored-by: Sandro Rename ki to kotlin-interactive-shell * Update pkgs/by-name/ko/kotlin-interactive-shell/package.nix --------- Co-authored-by: Sandro --- .../ko/kotlin-interactive-shell/package.nix | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pkgs/by-name/ko/kotlin-interactive-shell/package.nix diff --git a/pkgs/by-name/ko/kotlin-interactive-shell/package.nix b/pkgs/by-name/ko/kotlin-interactive-shell/package.nix new file mode 100644 index 000000000000..23848a48969e --- /dev/null +++ b/pkgs/by-name/ko/kotlin-interactive-shell/package.nix @@ -0,0 +1,45 @@ +{ lib, maven, fetchFromGitHub, makeWrapper, jre }: + +maven.buildMavenPackage rec { + pname = "kotlin-interactive-shell"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "Kotlin"; + repo = "kotlin-interactive-shell"; + rev = "v${version}"; + hash = "sha256-3DTyo7rPswpEVzFkcprT6FD+ITGJ+qCXFKXEGoCK+oE="; + }; + + mvnHash = "sha256-m1o0m0foqJhEzWjC9behBeld5HT08WClcZN2xc3fZrI="; + mvnParameters = "-DskipTests compile"; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib} + cp lib/ki-shell.jar $out/lib/ki-shell.jar + makeWrapper ${lib.getExe jre} $out/bin/ki \ + --add-flags "-jar $out/lib/ki-shell.jar" + + runHook postInstall + ''; + + meta = with lib; { + description = "Kotlin Language Interactive Shell"; + longDescription = '' + The shell is an extensible implementation of Kotlin REPL with a rich set of features including: + - Syntax highlight + - Type inference command + - Downloading dependencies in runtime using Maven coordinates + - List declared symbols + ''; + homepage = "https://github.com/Kotlin/kotlin-interactive-shell"; + license = licenses.asl20; + maintainers = [ maintainers.starsep ]; + platforms = jre.meta.platforms; + mainProgram = "ki"; + }; +}