# $Id$

PortSystem          1.0
PortGroup           ocaml 1.0

name                ocaml-js_of_ocaml
version             1.3.2
revision            3
categories          lang devel www ml
platforms           darwin
license             LGPL-2
maintainers         mww openmaintainer
description         Js_of_ocaml is a compiler of OCaml bytecode to Javascript
long_description    \
    Js_of_ocaml is a compiler of OCaml bytecode to Javascript. It makes it \
    possible to run Ocaml programs in a Web browser.
homepage            http://ocsigen.org/js_of_ocaml/
master_sites        http://ocsigen.org/download/
distname            js_of_ocaml-${version}
checksums           rmd160  e79ec4bab7976d76e9573c2edb7f61f0bdcd9818 \
                    sha256  5996d2a9bc32121186e1964af557bb411eb5a27aa155d2c6a8a144ee5f3d0c36

depends_lib         port:ocaml port:ocaml-findlib port:ocaml-deriving-ocsigen port:ocaml-lwt

configure {
    reinplace "s|ocamlfind|${ocamlfind_wrapper}|g" ${worksrcpath}/Makefile
}

use_parallel_build  no
build.target        all doc
build.args          BINDIR=${prefix}/bin

destroot.destdir    BINDIR=${destroot}${prefix}/bin

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CHANGES LICENSE README TODO.txt VERSION \
        ${destroot}${prefix}/share/doc/${name}
    file copy ${worksrcpath}/doc/api-html \
        ${destroot}${prefix}/share/doc/${name}/api
    xinstall -m 755 -d ${destroot}${prefix}/share/examples
    file copy ${worksrcpath}/examples \
        ${destroot}${prefix}/share/examples/${name}
}

livecheck.url       http://ocsigen.org/js_of_ocaml/install
livecheck.type      regex
livecheck.regex     js_of_ocaml-(\[0-9\\.\]+)\\.tar\\.gz