1{ stdenv, fetchurl, makeWrapper, jre, unzip }:
2
3let
4 version = "1.2.30";
5in stdenv.mkDerivation rec {
6 inherit version;
7 name = "kotlin-${version}";
8
9 src = fetchurl {
10 url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
11 sha256 = "0wg08cncwfajxfx8860wdf5dr4h92j069qvdr90l5m01ff3nasad";
12 };
13
14 propagatedBuildInputs = [ jre ] ;
15 buildInputs = [ makeWrapper unzip ] ;
16
17 installPhase = ''
18 mkdir -p $out
19 rm "bin/"*.bat
20 mv * $out
21
22 for p in $(ls $out/bin/) ; do
23 wrapProgram $out/bin/$p --prefix PATH ":" ${jre}/bin ;
24 done
25 '';
26
27 meta = {
28 description = "General purpose programming language";
29 longDescription = ''
30 Kotlin is a statically typed language that targets the JVM and JavaScript.
31 It is a general-purpose language intended for industry use.
32 It is developed by a team at JetBrains although it is an OSS language
33 and has external contributors.
34 '';
35 homepage = http://kotlinlang.org/;
36 license = stdenv.lib.licenses.asl20;
37 maintainers = with stdenv.lib.maintainers;
38 [ nequissimus ];
39 platforms = stdenv.lib.platforms.all;
40 };
41}