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,60 @@
# This derivation should be redundant, now that regular smlnj works on Darwin,
# and is preserved only for pre-existing direct usage. New use cases should
# just use the regular smlnj derivation.
{
lib,
stdenv,
fetchurl,
cpio,
rsync,
xar,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "smlnj-bootstrap";
version = "110.91";
src = fetchurl {
url = "http://smlnj.cs.uchicago.edu/dist/working/${version}/smlnj-x86-${version}.pkg";
sha256 = "12jn50h5jz0ac1vzld2mb94p1dyc8h0mk0hip2wj5xqk1dbzwxl4";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
cpio
rsync
];
unpackPhase = ''
${xar}/bin/xar -xf $src
cd smlnj.pkg
'';
buildPhase = ''
cat Payload | gunzip -dc | cpio -i
'';
installPhase = ''
mkdir -p $out/bin
rsync -av bin/ $out/bin/
mkdir -p $out/lib
rsync -av lib/ $out/lib/
'';
postInstall = ''
wrapProgram "$out/bin/sml" --set "SMLNJ_HOME" "$out"
'';
meta = {
description = "Compiler for the Standard ML '97 programming language";
homepage = "http://www.smlnj.org";
license = lib.licenses.free;
platforms = lib.platforms.darwin;
maintainers = [ lib.maintainers.jwiegley ];
mainProgram = "sml";
};
}

View File

@@ -0,0 +1,101 @@
{
lib,
stdenv,
fetchurl,
}:
let
version = "110.99.8";
baseurl = "https://smlnj.cs.uchicago.edu/dist/working/${version}";
arch = if stdenv.hostPlatform.is64bit then "64" else "32";
hashes = builtins.fromJSON (builtins.readFile ./hashes.json);
fetchSource =
name:
fetchurl {
url = "${baseurl}/${name}";
hash = hashes.${name};
};
bootSource = if stdenv.hostPlatform.is64bit then "boot.amd64-unix.tgz" else "boot.x86-unix.tgz";
sources = map fetchSource [
bootSource
"config.tgz"
"cm.tgz"
"compiler.tgz"
"runtime.tgz"
"system.tgz"
"MLRISC.tgz"
"smlnj-lib.tgz"
"old-basis.tgz"
"ckit.tgz"
"nlffi.tgz"
"cml.tgz"
"eXene.tgz"
"ml-lpt.tgz"
"ml-lex.tgz"
"ml-yacc.tgz"
"ml-burg.tgz"
"pgraph.tgz"
"trace-debug-profile.tgz"
"heap2asm.tgz"
"smlnj-c.tgz"
"doc.tgz"
"asdl.tgz"
];
in
stdenv.mkDerivation {
pname = "smlnj";
inherit version sources;
unpackPhase = ''
for s in $sources; do
b=$(basename $s)
cp $s ''${b#*-}
done
unpackFile config.tgz
mkdir base
./config/unpack $TMP runtime
'';
patchPhase = ''
sed -i '/^PATH=/d' config/_arch-n-opsys base/runtime/config/gen-posix-names.sh
echo SRCARCHIVEURL="file:/$TMP" > config/srcarchiveurl
'';
buildPhase = ''
./config/install.sh -default ${arch}
'';
installPhase = ''
mkdir -pv $out
cp -rv bin lib $out
cd $out/bin
for i in *; do
sed -i "2iSMLNJ_HOME=$out/" $i
done
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Standard ML of New Jersey, a compiler";
homepage = "http://smlnj.org";
license = lib.licenses.bsd3;
platforms = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-darwin"
];
maintainers = with lib.maintainers; [
skyesoss
thoughtpolice
];
mainProgram = "sml";
};
}

View File

@@ -0,0 +1,27 @@
{
"boot.amd64-unix.tgz": "sha256-udLexaSne+fK87rcEWauTL2RL7eyLAQclFlHf1348GQ=",
"boot.x86-unix.tgz": "sha256-pNPW12mc17QcLq+vg8l8nYmFOEy6VbdCAlRTFwOXL/o=",
"config.tgz": "sha256-63pvIXHI4XJ+R2mn7vcvcuxf8a6FYd1giICZeJjbAjs=",
"cm.tgz": "sha256-JBjG6OXw0F6DiDSd4O1wiGmRxxj4gXrs+baVevO4Xd0=",
"compiler.tgz": "sha256-GsEFh6XhEAi144+r2B0m5n7bWlPwnm5b89JxTBSAGGw=",
"runtime.tgz": "sha256-q4ViTS3/OuHkNChRrECOANWshmu0EGtFdSWF5jHIbcU=",
"system.tgz": "sha256-x7TzZKUNZFAmnv4iR4bJ0uK+pMVMKrt0F9NViJNw7s8=",
"MLRISC.tgz": "sha256-fKWObr2uulRF0HCUaG19xwUkHlSEyB2OmDvjsX9904o=",
"smlnj-lib.tgz": "sha256-79ExeRN/w/Tgi+L4FY6th5JKBh1Ga5SqlLZ7kErjYK0=",
"old-basis.tgz": "sha256-qkOFr+slwF/kMqH9346RHHqMCFUkhgt43JJedhNjHHI=",
"ckit.tgz": "sha256-VxeJBBJviCJGjiT0fb7nXKxPxrM5eZtOjHt9+Nw5wZ8=",
"nlffi.tgz": "sha256-miwWceBsB9M4iuFjgwPX1K6Ljx2NXPrL3YczbrSkEco=",
"cml.tgz": "sha256-pF0zZdSt8RMWKv7Yb6s3GTvfBiIIOfHqXLAs+tFH02c=",
"eXene.tgz": "sha256-XkaLMzyCTYD4vHrd83iZ40ETlZH8TQBO7c4WpqcSF3I=",
"ml-lpt.tgz": "sha256-vBZ7QUQSKaLN171usPGyORuxSg965egAwI2HgfylIWU=",
"ml-lex.tgz": "sha256-f2cSozI8QCZJByE4FFF8FAJPINAXkfTUeTLCebYS8yw=",
"ml-yacc.tgz": "sha256-eS7zzvEkkBg8teP3Kb8wMLXogUM6zLukkBXIEo0mm1Y=",
"ml-burg.tgz": "sha256-tRKoTgC0eGBvay6nfS+w8+XFnq2I6oaBltPhSNKCai4=",
"pgraph.tgz": "sha256-t7lrnIUHo9QPYP9VUxSc+BW98Ppc7JuBukjenvHy+jk=",
"trace-debug-profile.tgz": "sha256-ZEEY14wrAxayLUO7EKcnFRfsN78ZIoONXkNCJ0Wyggk=",
"heap2asm.tgz": "sha256-M94j6ElcXRjUYbRZGnvHORBdokEYomC2dB4hbFVOdOM=",
"smlnj-c.tgz": "sha256-ebZX6mgIPCBMA4ygCVMJrh8InqVFY/kNZEY0jwbFw6E=",
"doc.tgz": "sha256-Jml2Do2yufMtN80avD9ffRt5voTmLFIuMTOaiXLhHwo=",
"asdl.tgz": "sha256-nNiLcWjGqyEyp9JVrti+wT2LgxKqOV0GNK5z/NxKTG0=",
"version": "110.99.8"
}

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p bash curl nix-prefetch jq
# shellcheck shell=bash
set -euo pipefail
dir="$(dirname "$0")"
url="https://smlnj.cs.uchicago.edu/dist/working/"
hashfile="$dir/hashes.json"
nixfile="$dir/default.nix"
version="$(curl --silent "$url" \
| sed -n 's:.*<b>\([0-9]\{3\}\.[0-9.-]\+\)</b>.*:\1:p' \
| head -n1)"
echo "Latest SML/NJ release: $version"
if [[ -e "$hashfile" ]]; then
old_version="$(jq -r .version "$hashfile")"
if [[ $old_version = "$version" ]]; then
echo "Package is already up-to-date, skipping"
exit 0
fi
echo "Upgrading from $old_version to $version"
else
echo "Generating hashes for $version"
fi
files=(
boot.amd64-unix.tgz boot.x86-unix.tgz
config.tgz cm.tgz compiler.tgz runtime.tgz system.tgz MLRISC.tgz
smlnj-lib.tgz old-basis.tgz ckit.tgz nlffi.tgz cml.tgz eXene.tgz ml-lpt.tgz
ml-lex.tgz ml-yacc.tgz ml-burg.tgz pgraph.tgz trace-debug-profile.tgz
heap2asm.tgz smlnj-c.tgz doc.tgz asdl.tgz
)
tmpdir="$(mktemp --directory)"
trap 'rm -rf -- "$tmpdir"' EXIT
declare -a pids=()
for file in "${files[@]}"; do
nix-prefetch --silent fetchurl --url "$url/$version/$file" > "$tmpdir/$file" &
pids+=($!)
done
for pid in "${pids[@]}"; do
wait "$pid"
done
printf '{\n' > "$hashfile"
for file in "${files[@]}"; do
printf ' "%s": "%s",\n' "$file" "$(cat "$tmpdir/$file")" >> "$hashfile"
done
printf ' "version": "%s"\n' "$version" >> "$hashfile"
printf '}\n' >> "$hashfile"
sed --in-place 's:version = "[0-9.]\+";:version = "'"$version"'";:' "$nixfile"
echo "Done"