mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-01 13:14:42 +00:00
smlnj: init at 2026.1
This commit is contained in:
@@ -7,7 +7,7 @@ set -euo pipefail
|
||||
dir="$(dirname "$0")"
|
||||
url="https://smlnj.cs.uchicago.edu/dist/working/"
|
||||
hashfile="$dir/hashes-legacy.json"
|
||||
nixfile="$dir/legacy.nix"
|
||||
nixfile="$dir/package.nix"
|
||||
|
||||
version="$(curl --silent "$url" \
|
||||
| sed -n 's:.*<b>\([0-9]\{3\}\.[0-9.-]\+\)</b>.*:\1:p' \
|
||||
96
pkgs/development/compilers/smlnj/default.nix
Normal file
96
pkgs/development/compilers/smlnj/default.nix
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
callPackage,
|
||||
fetchFromGitHub,
|
||||
fetchurl,
|
||||
automake,
|
||||
autoconf,
|
||||
versionCheckHook,
|
||||
}:
|
||||
let
|
||||
version = "2026.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "smlnj";
|
||||
repo = "smlnj";
|
||||
tag = "v${version}";
|
||||
fetchSubmodules = true;
|
||||
hash = "sha256-n5oWhignhFl8B/cXSO3g/KQXInZqT1A0Mp8GzLeGqNc=";
|
||||
};
|
||||
|
||||
llvm = callPackage ./llvm.nix { inherit src version; };
|
||||
|
||||
bootFile =
|
||||
if stdenv.hostPlatform.isUnix && stdenv.hostPlatform.isx86_64 then
|
||||
fetchurl {
|
||||
url = "https://smlnj.cs.uchicago.edu/dist/working/${version}/boot.amd64-unix.tgz";
|
||||
hash = "sha256-caFguKkhFOjgJDtcOcF6YAbzFl2nQYXbtWCjvaBjL6o=";
|
||||
}
|
||||
else if stdenv.hostPlatform.isUnix && stdenv.hostPlatform.isAarch64 then
|
||||
fetchurl {
|
||||
url = "https://smlnj.cs.uchicago.edu/dist/working/${version}/boot.arm64-unix.tgz";
|
||||
hash = "sha256-qygH0n163jiwm4CsltPeCCpHqnBxCHKP5O20GZyq1/0=";
|
||||
}
|
||||
else
|
||||
throw "Unsupported host platform: ${stdenv.hostPlatform.config}";
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "smlnj";
|
||||
inherit src version;
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
automake
|
||||
];
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
patchPhase = ''
|
||||
runHook prePatch
|
||||
|
||||
unpackFile ${bootFile}
|
||||
mkdir -pv runtime/bin runtime/lib
|
||||
ln -s ${llvm}/bin/llvm-config runtime/bin/llvm-config
|
||||
ln -s ${llvm}/lib/libCFGCodeGen.a runtime/lib/libCFGCodeGen.a
|
||||
|
||||
runHook postPatch
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export INSTALLDIR=$out
|
||||
mkdir -pv $out
|
||||
./build.sh
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "@SMLversion";
|
||||
doInstallCheck = true;
|
||||
|
||||
passthru.llvm = llvm;
|
||||
|
||||
meta = {
|
||||
description = "Standard ML of New Jersey, a Standard ML compiler";
|
||||
homepage = "https://smlnj.org";
|
||||
downloadPage = "https://smlnj.org/dist/working/${version}/install.html";
|
||||
changelog = "https://smlnj.org/dist/working/${version}/README.html";
|
||||
license = lib.licenses.bsd3;
|
||||
sourceProvenance = with lib.sourceTypes; [
|
||||
fromSource
|
||||
binaryNativeCode
|
||||
];
|
||||
maintainers = [ lib.maintainers.skyesoss ];
|
||||
mainProgram = "sml";
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform);
|
||||
};
|
||||
}
|
||||
50
pkgs/development/compilers/smlnj/llvm.nix
Normal file
50
pkgs/development/compilers/smlnj/llvm.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
git,
|
||||
python3,
|
||||
ninja,
|
||||
src,
|
||||
version,
|
||||
}:
|
||||
let
|
||||
targets =
|
||||
lib.optional stdenv.targetPlatform.isx86_64 "X86"
|
||||
++ lib.optional stdenv.targetPlatform.isAarch64 "AArch64";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "smlnj-llvm";
|
||||
inherit src version;
|
||||
sourceRoot = "${src.name}/runtime/llvm21";
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
git
|
||||
python3
|
||||
ninja
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"--preset=smlnj-llvm-release"
|
||||
(lib.cmakeFeature "LLVM_TARGETS_TO_BUILD" (lib.concatStringsSep ";" targets))
|
||||
(lib.cmakeBool "LLVM_ENABLE_DUMP" true)
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Custom LLVM for Standard ML of New Jersey";
|
||||
homepage = "https://smlnj.org";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
maintainers = with lib.maintainers; [
|
||||
skyesoss
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -4108,8 +4108,7 @@ with pkgs;
|
||||
|
||||
# smlnjBootstrap should be redundant, now that smlnj works on Darwin natively
|
||||
smlnjBootstrap = callPackage ../development/compilers/smlnj/bootstrap.nix { };
|
||||
smlnj = callPackage ../development/compilers/smlnj/legacy.nix { };
|
||||
smlnj-legacy = callPackage ../development/compilers/smlnj/legacy.nix { };
|
||||
smlnj = callPackage ../development/compilers/smlnj { };
|
||||
|
||||
squeak = callPackage ../development/compilers/squeak {
|
||||
stdenv = clangStdenv;
|
||||
|
||||
Reference in New Issue
Block a user