PortSystem 1.0

name                ocaml-mpi
version             1.01
revision            7
categories          science devel ocaml
maintainers         nomaintainer
license             LGPL-2
description         Caml bindings for a large subset of MPI functions
long_description    ${description}
homepage            http://cristal.inria.fr/~xleroy/software.html
platforms           darwin

master_sites        http://caml.inria.fr/distrib/bazar-ocaml \
                    https://forge.ocamlcore.org/frs/download.php/329/
distname            ocamlmpi-${version}

checksums           md5     31e86ecb812832eb9480e2a4c6981608 \
                    sha1    4f836f02f7e8852ba72d4293aea43cf7a3438b0f \
                    rmd160  c0a08090073c54e130cd2712c7d1cfbeb8d17793

depends_lib         port:ocaml port:ocaml-findlib path:bin/mpicc-mp:mpich-default

patchfiles          Makefile.diff

post-patch {
    file copy ${filespath}/META ${worksrcpath}
}

use_configure       no
use_parallel_build  no

if {[file exists ${prefix}/lib/mpich-mp-devel]} then {
   build.env           MPIINCDIR=${prefix}/include MPILIBDIR=${prefix}/lib/mpich-mp-devel
} else {
   build.env           MPIINCDIR=${prefix}/include MPILIBDIR=${prefix}/lib/mpich-mp
}

build.target        all

set ocamlfind_destdir ${destroot}${prefix}/lib/ocaml/site-lib
destroot.env        "OCAMLFIND_INSTFLAGS=-destdir $ocamlfind_destdir -ldconf ignore" OCAMLFIND_STUBLIBS=${ocamlfind_destdir}/stublibs
destroot.target     ocamlfind-install

pre-destroot {
    file mkdir $ocamlfind_destdir
}

livecheck.type      regex
livecheck.url       http://forge.ocamlcore.org/frs/?group_id=135
livecheck.regex     "ocamlmpi-(.*?).tar.gz"
