diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fabc8dfbef69..0e30343b8da9 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7431,6 +7431,13 @@ github = "DSeeLP"; githubId = 46624152; }; + dshatz = { + email = "dev@dshatz.com"; + github = "dshatz"; + githubId = 23437798; + name = "Daniels Å atcs"; + keys = [ { fingerprint = "7452B4B47EA8F6635AB545CA4B974CC26375BB06"; } ]; + }; dsluijk = { name = "Dany Sluijk"; email = "nix@dany.dev"; diff --git a/pkgs/by-name/ko/kotlin-cli/package.nix b/pkgs/by-name/ko/kotlin-cli/package.nix new file mode 100644 index 000000000000..02ca48c9c907 --- /dev/null +++ b/pkgs/by-name/ko/kotlin-cli/package.nix @@ -0,0 +1,62 @@ +{ + lib, + fetchurl, + stdenv, + jre, + makeWrapper, + nix-update-script, + jdk25, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "kotlin-cli"; + version = "0.11.1"; + + src = fetchurl { + url = "https://packages.jetbrains.team/maven/p/amper/amper/org/jetbrains/kotlin/kotlin-cli/${finalAttrs.version}/kotlin-cli-${finalAttrs.version}-dist.tgz"; + hash = "sha256-De0qQ09r8ZOyTiptVsO6RD9CMnIRVaZaqoNyeJQSES8="; + }; + sourceRoot = "."; + dontBuild = true; + nativeBuildInputs = [ makeWrapper ]; + + strictDeps = true; + __structuredAttrs = true; + + installPhase = '' + mkdir -p $out/share/kotlin-cli + cp -r * $out/share/kotlin-cli/ + + mkdir -p $out/bin + chmod +x $out/share/kotlin-cli/bin/launcher.sh + + # Override amper runtime JVM. + sed -i 's|^[[:space:]]*jre_url=.*| jre_url=""|' $out/share/kotlin-cli/bin/launcher.sh + sed -i 's|^[[:space:]]*jre_target_dir=.*| jre_target_dir="${jdk25}"|' $out/share/kotlin-cli/bin/launcher.sh + + # Create the missing .flag file to satisfy the runtime check + touch $out/share/kotlin-cli/.flag + + # Override kotlin toolchain launcher JVM. + makeWrapper $out/share/kotlin-cli/bin/launcher.sh $out/bin/kotlin \ + --set KOTLIN_CLI_JAVA_HOME "${jdk25.home}" + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--url=https://github.com/JetBrains/kotlin-toolchain" + ]; + }; + + meta = { + description = "Kotlin Toolchain CLI"; + homepage = "https://github.com/JetBrains/kotlin-toolchain"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.dshatz ]; + platforms = jre.meta.platforms; + sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; + mainProgram = "kotlin"; + }; +})