push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
{
stdenv,
lib,
fetchurl,
makeWrapper,
jre,
gnugrep,
coreutils,
writeScript,
common-updater-scripts,
git,
gnused,
nix,
majorVersion,
}:
let
repo = "git@github.com:scala/scala.git";
versionMap = {
"2.12" = {
version = "2.12.18";
hash = "sha256-naIJCET+YPrbXln39F9aU3DBdnjcn7PYMmhDxETOA5g=";
pname = "scala_2_12";
};
"2.13" = {
version = "2.13.15";
hash = "sha256-jXIZ0q2IHIHPdwmp5JU05s4S0Bft4Uc+r9Hpuyh8ObE=";
pname = "scala_2_13";
};
};
in
with versionMap.${majorVersion};
stdenv.mkDerivation rec {
inherit version;
name = "scala-${version}";
src = fetchurl {
inherit hash;
url = "https://www.scala-lang.org/files/archive/scala-${version}.tgz";
};
propagatedBuildInputs = [ jre ];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out
rm bin/*.bat
mv * $out
# put docs in correct subdirectory
mkdir -p $out/share/doc
mv $out/doc $out/share/doc/${name}
mv $out/man $out/share/man
for p in $(ls $out/bin/) ; do
wrapProgram $out/bin/$p \
--prefix PATH ":" ${coreutils}/bin \
--prefix PATH ":" ${gnugrep}/bin \
--prefix PATH ":" ${jre}/bin \
--set JAVA_HOME ${jre}
done
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/scalac -version 2>&1 | grep '^Scala compiler version ${version}'
echo 'println("foo"*3)' | $out/bin/scala 2>/dev/null | grep "foofoofoo"
'';
passthru = {
updateScript = writeScript "update.sh" ''
#!${stdenv.shell}
set -o errexit
PATH=${
lib.makeBinPath [
common-updater-scripts
coreutils
git
gnused
nix
]
}
versionSelect='v${lib.versions.major version}.${lib.versions.minor version}.*'
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"')"
latestTag="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags ${repo} "$versionSelect" | tail --lines=1 | cut --delimiter='/' --fields=3 | sed 's|^v||g')"
if [ "$oldVersion" != "$latestTag" ]; then
update-source-version ${pname} "$latestTag" --version-key=version --print-changes
else
echo "${pname} is already up-to-date"
fi
'';
};
meta = with lib; {
description = "General purpose programming language";
longDescription = ''
Scala is a general purpose programming language designed to express
common programming patterns in a concise, elegant, and type-safe way.
It smoothly integrates features of object-oriented and functional
languages, enabling Java and other programmers to be more productive.
Code sizes are typically reduced by a factor of two to three when
compared to an equivalent Java application.
'';
homepage = "https://www.scala-lang.org/";
license = licenses.bsd3;
platforms = platforms.all;
branch = versions.majorMinor version;
maintainers = with maintainers; [
nequissimus
kashw2
];
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
jre,
ncurses,
}:
stdenv.mkDerivation (finalAttrs: {
version = "3.3.6";
pname = "scala-bare";
src = fetchurl {
url = "https://github.com/scala/scala3/releases/download/${finalAttrs.version}/scala3-${finalAttrs.version}.tar.gz";
hash = "sha256-cmdSQkDuKJl2/tG4vAjABF1dKQ0/ruB8a3E3pCUrW5c=";
};
propagatedBuildInputs = [
jre
ncurses.dev
];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out
mv * $out
'';
# Use preFixup instead of fixupPhase
# because we want the default fixupPhase as well
preFixup = ''
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 = "Scala 3 compiler, also known as Dotty";
homepage = "https://scala-lang.org/";
license = licenses.asl20;
platforms = platforms.all;
mainProgram = "scala";
maintainers = with maintainers; [
virusdave
kashw2
natsukagami
hamzaremmal
dottybot
];
};
})

View File

@@ -0,0 +1,37 @@
{
stdenv,
fetchurl,
makeWrapper,
jre,
callPackage,
}:
let
bare = callPackage ./bare.nix {
inherit
stdenv
fetchurl
makeWrapper
jre
;
};
in
stdenv.mkDerivation {
pname = "scala";
inherit (bare) version;
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
ln -s ${bare}/bin/scalac $out/bin/scalac
ln -s ${bare}/bin/scaladoc $out/bin/scaladoc
ln -s ${bare}/bin/scala $out/bin/scala
ln -s ${bare}/bin/common $out/bin/common
'';
inherit (bare) meta;
passthru = { inherit bare; };
}