# $Id: Portfile 66862 2010-04-24 09:04:31Z avsm@macports.org $

PortSystem          1.0

name                caml-lwt
version             2.1.0
distname            lwt-${version}
categories          devel ml
maintainers         avsm
description         Cooperative threading library for OCaml
long_description    LWT is a lightweight thread library for OCaml to implement \
                    co-operative concurrency.
homepage            http://ocsigen.org/lwt
platforms           darwin
master_sites        http://ocsigen.org/download/

depends_lib         port:ocaml port:caml-findlib port:caml-ssl \
                    port:caml-react port:caml-text

checksums           md5     93feaa322f1bc585dc60a891cae4e40f \
                    sha1    301080f0d5241658c248c3b7f959688ee17e54e8 \
                    rmd160  c1af42b3a5661d89b003efdf6e188f3c69587938

use_configure       no
use_parallel_build  no
patchfiles          patch-Makefile.diff

set ocamlfind_destdir ${destroot}${prefix}/lib/ocaml/site-lib
destroot.post_args  DESTDIR="$ocamlfind_destdir"
build.target        "all doc"

livecheck.type      regex
livecheck.url       http://ocsigen.org/download/
livecheck.version   ${version}
livecheck.regex     {>lwt-(.*)\.tar\.gz\.asc}

post-destroot {
        xinstall -d -755 ${destroot}${prefix}/share/doc/${name}
        eval xinstall -m 644 [glob ${worksrcpath}/_build/lwt.docdir/*] \
            ${destroot}/${prefix}/share/doc/${name}
}
