From a03eab619f7861b7ca8db2a2fb1b45da6b26db51 Mon Sep 17 00:00:00 2001 From: nikolaiser Date: Fri, 23 Aug 2024 11:09:59 +0200 Subject: [PATCH] scala-next: Init at 3.5.1 This change allows to use the latest non-LTS scala version --- pkgs/by-name/sc/scala-next/package.nix | 10 ++++ pkgs/development/compilers/scala/bare.nix | 49 ++++++++++++-------- pkgs/development/compilers/scala/default.nix | 20 ++++++-- 3 files changed, 57 insertions(+), 22 deletions(-) create mode 100644 pkgs/by-name/sc/scala-next/package.nix diff --git a/pkgs/by-name/sc/scala-next/package.nix b/pkgs/by-name/sc/scala-next/package.nix new file mode 100644 index 000000000000..edbe49945f1a --- /dev/null +++ b/pkgs/by-name/sc/scala-next/package.nix @@ -0,0 +1,10 @@ +{ scala, fetchurl }: + +scala.bare.overrideAttrs (oldAttrs: { + version = "3.5.1"; + pname = "scala-next"; + src = fetchurl { + inherit (oldAttrs.src) url; + hash = "sha256-pRfoCXFVnnEh3zyB9HbUZK3qrQ94Gq3iXX2fWGS/l9o="; + }; +}) diff --git a/pkgs/development/compilers/scala/bare.nix b/pkgs/development/compilers/scala/bare.nix index bbbb573f2f5a..684537e160c7 100644 --- a/pkgs/development/compilers/scala/bare.nix +++ b/pkgs/development/compilers/scala/bare.nix @@ -1,15 +1,25 @@ -{ lib, stdenv, fetchurl, makeWrapper, jre, ncurses }: +{ + lib, + stdenv, + fetchurl, + makeWrapper, + jre, + ncurses, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { version = "3.3.3"; pname = "scala-bare"; src = fetchurl { - url = "https://github.com/lampepfl/dotty/releases/download/${version}/scala3-${version}.tar.gz"; + url = "https://github.com/scala/scala3/releases/download/${finalAttrs.version}/scala3-${finalAttrs.version}.tar.gz"; hash = "sha256-61lAETEvqkEqr5pbDltFkh+Qvp+EnCDilXN9X67NFNE="; }; - propagatedBuildInputs = [ jre ncurses.dev ] ; + propagatedBuildInputs = [ + jre + ncurses.dev + ]; nativeBuildInputs = [ makeWrapper ]; installPhase = '' @@ -20,23 +30,24 @@ stdenv.mkDerivation rec { # Use preFixup instead of fixupPhase # because we want the default fixupPhase as well preFixup = '' - bin_files=$(find $out/bin -type f ! -name common) - for f in $bin_files ; do - wrapProgram $f --set JAVA_HOME ${jre} --prefix PATH : '${ncurses.dev}/bin' - done + bin_files=$(find $out/bin -type f ! -name "*common*" ! -name "scala-cli.jar") + for f in $bin_files ; do + wrapProgram $f --set JAVA_HOME ${jre} --prefix PATH : '${ncurses.dev}/bin' + done ''; meta = with lib; { - description = "Research platform for new language concepts and compiler technologies for Scala"; - longDescription = '' - Dotty is a platform to try out new language concepts and compiler technologies for Scala. - The focus is mainly on simplification. We remove extraneous syntax (e.g. no XML literals), - and try to boil down Scala’s types into a smaller set of more fundamental constructs. - The theory behind these constructs is researched in DOT, a calculus for dependent object types. - ''; - homepage = "http://dotty.epfl.ch/"; - license = licenses.bsd3; + description = "The Scala 3 compiler, also known as Dotty"; + homepage = "https://scala-lang.org/"; + license = licenses.asl20; platforms = platforms.all; - maintainers = with maintainers; [ karolchmist virusdave kashw2 ]; + maintainers = with maintainers; [ + karolchmist + virusdave + kashw2 + natsukagami + hamzaremmal + dottybot + ]; }; -} +}) diff --git a/pkgs/development/compilers/scala/default.nix b/pkgs/development/compilers/scala/default.nix index 2ad68ffec3b3..8d27707dff7f 100644 --- a/pkgs/development/compilers/scala/default.nix +++ b/pkgs/development/compilers/scala/default.nix @@ -1,8 +1,19 @@ -{ stdenv, fetchurl, makeWrapper, jre, callPackage }: +{ + stdenv, + fetchurl, + makeWrapper, + jre, + callPackage, +}: let bare = callPackage ./bare.nix { - inherit stdenv fetchurl makeWrapper jre; + inherit + stdenv + fetchurl + makeWrapper + jre + ; }; in @@ -21,4 +32,7 @@ stdenv.mkDerivation { ''; inherit (bare) meta; -} // { inherit bare; } +} +// { + inherit bare; +}