# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           ocaml 1.1

github.setup        pdonadeo ocaml-lua 1.8 v
revision            0
categories          lang devel ocaml
license             MIT
maintainers         nomaintainer
description         OCaml bindings to Lua API
long_description    \
    This library provides OCaml bindings to Lua API which allows the \
    application to exchange data with Lua programs and also to extend Lua with \
    OCaml functions.

homepage            https://github.com/pdonadeo/ocaml-lua

github.tarball_from archive

checksums           rmd160  7d3722ec9398d87e7ffdf878e3c49586b07a47f9 \
                    sha256  8f1575411c1db2ed2736846b1b29d6d1b34fe440a81cdb7e0b0c1c7c87534f67 \
                    size    589247

ocaml.build_type    dune
dune.packages       ocaml-lua

# Lua 5.1.5 sources are bundled; extract them before dune builds
pre-build {
    system -W ${worksrcpath}/src/lua_c "tar xf lua-5.1.5.tar.gz"
    system -W ${worksrcpath}/src/lua_c/lua-5.1.5 "patch -p1 -i ../lua.patch"
    file rename ${worksrcpath}/src/lua_c/lua-5.1.5 ${worksrcpath}/src/lua_c/lua515
}

livecheck.type      regex
livecheck.url       https://github.com/pdonadeo/ocaml-lua/releases
livecheck.regex     {v(\d+\.\d+)}
