2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "kotlin-native";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.9.23";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
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: {
|
2024-04-21 15:54:59 +00:00
|
|
|
"macos-aarch64" = "1v1ld4nxa77vjxiz4jw5h29s8i4ghfbmq0d01r15i75pr46md8r7";
|
|
|
|
"macos-x86_64" = "05ywdhagj3qzjaw5sd94sgjk89dysky7d7lfqpwvc8s35v77rv8f";
|
|
|
|
"linux-x86_64" = "1j2lpl1r7r30dgard6ia29n3qrsr98wb3qwpc80z4jh6k42qn6id";
|
2021-10-28 06:52:43 +00:00
|
|
|
}.${arch};
|
|
|
|
in
|
|
|
|
fetchurl {
|
|
|
|
url = getUrl version getArch;
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = getHash getArch;
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern programming language that makes developers happier";
|
2021-10-28 06:52:43 +00:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
license = lib.licenses.asl20;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with lib.maintainers; [ fabianhjr ];
|
2021-10-28 06:52:43 +00:00
|
|
|
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|