@@ -0,0 +1,46 @@
1+{ stdenv, fetchurl, makeWrapper, jre, gnugrep, coreutils }:
2+
3+stdenv.mkDerivation rec {
4+ name = "scala-2.13.0";
5+
6+ src = fetchurl {
7+ url = "https://www.scala-lang.org/files/archive/${name}.tgz";
8+ sha256 = "12g0a9i0xxqxxcvmimm5w2wgmrdhq80p8bsp52d6yldz4lrnbm7p";
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 = https://www.scala-lang.org/;
43+ license = stdenv.lib.licenses.bsd3;
44+ platforms = stdenv.lib.platforms.all;
45+ };
46+}