2021-01-12 19:48:25 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }:
|
2019-12-08 07:56:32 +00:00
|
|
|
|
2021-01-11 12:49:15 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.07"
|
2019-12-08 07:56:32 +00:00
|
|
|
then throw "lua-ml is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lua-ml";
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
2020-08-01 17:30:02 +01:00
|
|
|
version = "0.9.1";
|
2019-12-08 07:56:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lindig";
|
|
|
|
repo = pname;
|
2020-11-01 22:39:49 +00:00
|
|
|
rev = version;
|
2020-08-01 17:30:02 +01:00
|
|
|
sha256 = "04lv98nxmzanvyn4c0k6k0ax29f5xfdl8qzpf5hwadslq213a044";
|
2019-12-08 07:56:32 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ opaline ocaml findlib ocamlbuild ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2019-12-08 07:56:32 +00:00
|
|
|
|
|
|
|
buildFlags = [ "lib" ];
|
|
|
|
|
2021-01-12 19:48:25 +00:00
|
|
|
installPhase = ''
|
|
|
|
opaline -prefix $out -libdir $OCAMLFIND_DESTDIR
|
|
|
|
'';
|
2019-12-08 07:56:32 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "An embeddable Lua 2.5 interpreter implemented in OCaml";
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
inherit (ocaml.meta) platforms;
|
2021-01-11 12:49:15 +00:00
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2019-12-08 07:56:32 +00:00
|
|
|
};
|
|
|
|
}
|