3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #142709 from AndersonTorres/new-kotlin-native

kotlin-native: init at 1.5.31
This commit is contained in:
Anderson Torres 2021-10-24 20:11:19 -03:00 committed by GitHub
commit 47a8fe3ac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,64 @@
{ lib
, stdenv
, fetchurl
, jre
, makeWrapper
}:
stdenv.mkDerivation rec {
pname = "kotlin-native";
version = "1.5.31";
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-+9AF42AlPn1/8c14t8u+NN8FkoEmdt6tpmIKU9Rp2AM=";
"macos-x86_64" = "sha256-/eciSo4Eps2TTsv1XU1Rlm+KBmgQT0MWp2s/OAYtGt4=";
"linux-x86_64" = "sha256-Y2t+nlTu+j+h0oRneo7CJx0PmLAkqKYBJ+8go7rargM=";
}.${arch};
in
fetchurl {
url = getUrl version getArch;
hash = 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 = "A 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.
'';
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
};
}

View file

@ -12277,6 +12277,7 @@ with pkgs;
koka = haskell.lib.justStaticExecutables (haskellPackages.callPackage ../development/compilers/koka { });
kotlin = callPackage ../development/compilers/kotlin { };
kotlin-native = callPackage ../development/compilers/kotlin/native.nix { };
lazarus = callPackage ../development/compilers/fpc/lazarus.nix {
fpc = fpc;