2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenvNoCC
|
|
|
|
, mlton
|
|
|
|
, lua5_3
|
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.1.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
in
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenvNoCC.mkDerivation {
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit version;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
pname = "lunarml";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "minoki";
|
|
|
|
repo = "LunarML";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-wM6ppH0g8yIi+4fwTejzZGn1uv/Wvlajn87A+IKbPXw=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
mlton
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
lua5_3
|
|
|
|
];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
make -C thirdparty install
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $doc/lunarml $out/{bin,lib}
|
2023-07-15 17:15:38 +00:00
|
|
|
cp -r bin $out
|
|
|
|
cp -r lib $out
|
2023-10-09 19:29:22 +00:00
|
|
|
cp -r example $doc/lunarml
|
|
|
|
|
|
|
|
runHook postInstall
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Standard ML compiler that produces Lua/JavaScript";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "lunarml";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/minoki/LunarML";
|
|
|
|
license = lib.licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with lib.maintainers; [ toastal ratsclub ];
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = mlton.meta.platforms;
|
|
|
|
};
|
|
|
|
}
|