# $Id$

PortSystem          1.0
PortGroup           ocaml 1.0

name                ocaml-react
version             1.2.0
revision            2
categories          devel ml
license             BSD
maintainers         mww openmaintainer
description         Functional reactive progreamming for OCaml
long_description    React is an OCaml module for functional reactive programming (FRP).\
                    It provides support to program with time varying values : applicative \
                    events and signals. React doesn't define any primitive event or signal, \
                    this lets the client chooses the concrete timeline.
homepage            http://erratique.ch/software/react
platforms           darwin

master_sites        http://erratique.ch/software/react/releases/
use_bzip2           yes
extract.suffix      .tbz
distname            react-${version}

depends_build       port:ocaml-findlib
depends_lib         port:ocaml

checksums           rmd160  07a2621d5bef6c6509b80d7385393fbcded5139c \
                    sha256  887aaea9191870bc0f37f945c02ec4c90497d949cd4dedc3d565c3fbec7ad04e

use_configure       no

build {
  # from 'opam'
  system -W ${worksrcpath} "${ocaml} pkg/git.ml"
  system -W ${worksrcpath} "${ocaml} pkg/build.ml native=true native-dynlink=true"
}

livecheck.type      regex
livecheck.url       http://erratique.ch/software/react/releases/
livecheck.regex     react-(\[0-9.\]+)${extract.suffix}

set docdir ${destroot}${prefix}/share/doc/${name}
set libdir ${destroot}${ocamlfind_dir}/react
destroot {
  # from 'react.install'
  xinstall -m 0755 -d ${docdir} ${libdir}
  xinstall -m 0644 -W ${worksrcpath}/_build \
    CHANGES.md \
    README.md \
    ${docdir}
  xinstall -m 0644 -W ${worksrcpath}/_build \
    pkg/META \
    src/react.a \
    src/react.cma \
    src/react.cmi \
    src/react.cmti \
    src/react.cmx \
    src/react.cmxa \
    src/react.cmxs \
    src/react.mli \
    src/react_top.a \
    src/react_top.cma \
    src/react_top.cmxa \
    src/react_top.cmxs \
    ${libdir}
}