Skip to content

Commit

Permalink
lunarml: init at unstable-2022-12-12
Browse files Browse the repository at this point in the history
  • Loading branch information
toastal committed Dec 14, 2022
1 parent b49d4ff commit 3b6b111
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
67 changes: 67 additions & 0 deletions pkgs/development/compilers/lunarml/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{ lib
, fetchFromGitHub
, fetchzip
, stdenvNoCC
# build inputs
, mlton
# check inputs
, lua5_3
, luajit
, nodejs
# flags
, withExamples ? false
}:

stdenvNoCC.mkDerivation rec {
name = "lunarml";
version = "unstable-2022-12-12";

src = fetchFromGitHub rec {
owner = "minoki";
repo = "LunarML";
rev = "c5f474554122d3e11288723e3076826e505b40b1";
sha256 = "sha256-SBDPUqccSpnXeDz2r2dd3YfDF5VO8Ey8rFynWcu/5b8=";
};

nativeBuildInputs = [
mlton
];

checkInputs = [
lua5_3
luajit
nodejs
];

postPatch = ''
cd "thirdparty"
make smlnj-lib
make ml-yacc
cd ".."
'';

postBuild = ''
cd "thirdparty"
make install-smlnj-lib
make install-mlyacc-lib
cd ".."
'';

doCheck = true;

installPhase = ''
mkdir -p $out/{bin,lib,share/doc/${name}}
cp -r bin lib $out
cp -r doc/* README.* LICENSE* $out/share/doc/${name}
'' + lib.optionalString withExamples ''
cp -Tr example $out/share/doc/${name}/example
'';

meta = {
description = "Standard ML compiler that produces Lua/JavaScript";
homepage = "https://github.com/minoki/LunarML";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ toastal ];
platforms = mlton.meta.platforms;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14937,6 +14937,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreServices Security;
};

lunarml = callPackage ../development/compilers/lunarml { };

manticore = callPackage ../development/compilers/manticore { };

marst = callPackage ../development/compilers/marst { };
Expand Down

0 comments on commit 3b6b111

Please sign in to comment.