2022-11-27 13:25:49 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenvNoCC
|
|
|
|
, mlton
|
|
|
|
, lua5_3
|
|
|
|
}:
|
|
|
|
|
2024-11-12 08:57:25 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2024-11-12 09:06:03 +00:00
|
|
|
version = "0.2.1";
|
2022-11-27 13:25:49 +00:00
|
|
|
|
2023-09-27 03:17:40 +00:00
|
|
|
pname = "lunarml";
|
2022-11-27 13:25:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "minoki";
|
|
|
|
repo = "LunarML";
|
2024-11-12 08:57:25 +00:00
|
|
|
rev = "refs/tags/v${finalAttrs.version}";
|
2024-11-12 09:06:03 +00:00
|
|
|
hash = "sha256-wNcsvtIR/MbvwAIhybc7zzbS+RgfwndQ1jdDVdte+44=";
|
2022-11-27 13:25:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
mlton
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
lua5_3
|
|
|
|
];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
make -C thirdparty install
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-08-29 16:30:19 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $doc/lunarml $out/{bin,lib}
|
2022-11-27 13:25:49 +00:00
|
|
|
cp -r bin $out
|
|
|
|
cp -r lib $out
|
2023-08-29 16:30:19 +00:00
|
|
|
cp -r example $doc/lunarml
|
|
|
|
|
|
|
|
runHook postInstall
|
2022-11-27 13:25:49 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Standard ML compiler that produces Lua/JavaScript";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "lunarml";
|
2022-11-27 13:25:49 +00:00
|
|
|
homepage = "https://github.com/minoki/LunarML";
|
|
|
|
license = lib.licenses.mit;
|
2023-08-29 16:30:19 +00:00
|
|
|
maintainers = with lib.maintainers; [ toastal ratsclub ];
|
2022-11-27 13:25:49 +00:00
|
|
|
platforms = mlton.meta.platforms;
|
|
|
|
};
|
2024-11-12 08:57:25 +00:00
|
|
|
})
|