# $Id: Portfile 107232 2013-06-23 17:16:01Z mww@macports.org $

PortSystem          1.0
PortGroup           ocaml 1.0

name                ocaml-zarith
version             1.2.1
categories          devel ml
maintainers         mww openmaintainer
license             LGPL-2
platforms           darwin
description         Arbitrary-precision integers for OCaml
long_description    \
        The Zarith library implements arithmetic and logical operations \
        over arbitrary-precision integers. It uses GMP to efficiently \
        implement arithmetic over big integers. Small integers are \
        represented as Caml unboxed integers, for speed and space economy.
homepage            http://forge.ocamlcore.org/projects/zarith/
master_sites        http://forge.ocamlcore.org/frs/download.php/1199/
distname            zarith-${version}
extract.suffix      .tgz

checksums           rmd160  62bdca2311b381a4e4bf9882dd9b6a56d2fea173 \
                    sha256  916801cc39599d3fca07384fbfeec4bfaa5ffcb497d68ef89320af40ba5e4144

depends_lib         port:ocaml port:ocaml-findlib port:gmp

patchfiles          patch-configure.diff patch-caml_z_x86_64.S.diff

configure.pre_args
configure.args       -installdir ${ocamlfind_destdir} -ocamllibdir ${prefix}/lib/ocaml
configure.cc_archflags
configure.ld_archflags

use_parallel_build  no

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} Changes LICENSE README \
        ${destroot}${prefix}/share/doc/${name}
}

test.run            yes
test.cmd            make test && ./test

livecheck.type      regex
livecheck.url       http://forge.ocamlcore.org/frs/?group_id=243
livecheck.regex     "zarith-(\[0-9\\.\]+).tgz"
