1{ stdenv, fetchurl, makeWrapper, jre, gnugrep, coreutils }:
2
3stdenv.mkDerivation rec {
4 name = "scala-2.12.4";
5
6 src = fetchurl {
7 url = "http://www.scala-lang.org/files/archive/${name}.tgz";
8 sha256 = "089a54qj8psh4jxqbrrwk5zahw13fyqq24l87s3031xa675a0m4m";
9 };
10
11 propagatedBuildInputs = [ jre ] ;
12 buildInputs = [ makeWrapper ] ;
13
14 installPhase = ''
15 mkdir -p $out
16 rm "bin/"*.bat
17 mv * $out
18
19 # put docs in correct subdirectory
20 mkdir -p $out/share/doc
21 mv $out/doc $out/share/doc/scala
22
23 for p in $(ls $out/bin/) ; do
24 wrapProgram $out/bin/$p \
25 --prefix PATH ":" ${coreutils}/bin \
26 --prefix PATH ":" ${gnugrep}/bin \
27 --prefix PATH ":" ${jre}/bin \
28 --set JAVA_HOME ${jre}
29 done
30 '';
31
32 meta = {
33 description = "General purpose programming language";
34 longDescription = ''
35 Scala is a general purpose programming language designed to express
36 common programming patterns in a concise, elegant, and type-safe way.
37 It smoothly integrates features of object-oriented and functional
38 languages, enabling Java and other programmers to be more productive.
39 Code sizes are typically reduced by a factor of two to three when
40 compared to an equivalent Java application.
41 '';
42 homepage = http://www.scala-lang.org/;
43 license = stdenv.lib.licenses.bsd3;
44 platforms = stdenv.lib.platforms.all;
45 };
46}