nixpkgs/pkgs/development/compilers/kotlin/native.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

74 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchurl,
jre,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "kotlin-native";
version = "1.9.24";
src =
let
getArch =
{
"aarch64-darwin" = "macos-aarch64";
"x86_64-darwin" = "macos-x86_64";
"x86_64-linux" = "linux-x86_64";
}
.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");
getUrl =
version: arch:
"https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-native-${arch}-${version}.tar.gz";
getHash =
arch:
{
"macos-aarch64" = "sha256-RGXi2SyUviH9HdMApSoBJfEdeOfnssaTnWldvGJ6ysY=";
"macos-x86_64" = "sha256-eDwbmVV0jLN5REb3D5JfDbjzUuZujxA2puw75Te1aFs=";
"linux-x86_64" = "sha256-sEvljAwLSzBxUxxpRAPxtlDnKlwH4FGQTDaQI+XcGaE=";
}
.${arch};
in
fetchurl {
url = getUrl version getArch;
sha256 = getHash getArch;
};
nativeBuildInputs = [
jre
makeWrapper
];
installPhase = ''
runHook preInstall
mkdir -p $out
mv * $out
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/run_konan --prefix PATH ":" ${lib.makeBinPath [ jre ]}
'';
meta = {
homepage = "https://kotlinlang.org/";
description = "Modern programming language that makes developers happier";
longDescription = ''
Kotlin/Native is a technology for compiling Kotlin code to native
binaries, which can run without a virtual machine. It is an LLVM based
backend for the Kotlin compiler and native implementation of the Kotlin
standard library.
'';
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ fabianhjr ];
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
};
}