Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }:
2
3if !lib.versionAtLeast ocaml.version "4.07"
4then throw "lua-ml is not available for OCaml ${ocaml.version}"
5else
6
7stdenv.mkDerivation rec {
8 pname = "lua-ml";
9 name = "ocaml${ocaml.version}-${pname}-${version}";
10 version = "0.9.1";
11
12 src = fetchFromGitHub {
13 owner = "lindig";
14 repo = pname;
15 rev = version;
16 sha256 = "04lv98nxmzanvyn4c0k6k0ax29f5xfdl8qzpf5hwadslq213a044";
17 };
18
19 nativeBuildInputs = [ opaline ];
20 buildInputs = [ ocaml findlib ocamlbuild ];
21
22 buildFlags = [ "lib" ];
23
24 installPhase = ''
25 opaline -prefix $out -libdir $OCAMLFIND_DESTDIR
26 '';
27
28 meta = {
29 description = "An embeddable Lua 2.5 interpreter implemented in OCaml";
30 inherit (src.meta) homepage;
31 inherit (ocaml.meta) platforms;
32 license = lib.licenses.bsd2;
33 maintainers = [ lib.maintainers.vbgl ];
34 };
35}