# $Id: Portfile 78632 2011-05-14 22:50:58Z ryandesign@macports.org $

PortSystem          1.0
name                caml-ancient
version             0.9.0
categories          devel ml
maintainers         mww openmaintainer
description         Mark objects as 'ancient' so they are taken out of the OCaml heap
long_description    ${description}
homepage            http://git.et.redhat.com/?p=ocaml-ancient.git
platforms           darwin

master_sites        http://www.ocaml-programming.de/godi-backup/
distname            ancient-${version}

checksums           md5     a5529e09f3c96247f362b7640e710157 \
                    sha1    be60cddcc3047cd34fa452d816d5ab13edd6ea54 \
                    rmd160  96c3ef4f3c6d8f303ebbc3bc60ae336db23a3fb2

depends_lib         port:ocaml port:caml-findlib

use_parallel_build  no

configure.dir       ${worksrcpath}/mmalloc

build {
   system "cd ${worksrcpath}/mmalloc && make all"
   system "cd ${worksrcpath} && CFLAGS='-I${prefix}/lib/ocaml' make all"
}

destroot {
   set ocamlfind_destdir ${destroot}${prefix}/lib/ocaml/site-lib
   xinstall -m 755 -d "${ocamlfind_destdir}/stublibs"
   system "cd ${worksrcpath} && ocamlfind install -destdir $ocamlfind_destdir -ldconf ignore ancient ancient.cmi *.mli *.cma ancient.cmx *.cmxa *.a *.so mmalloc/*.a META"
   system "strip  '${ocamlfind_destdir}/stublibs/dllancient.so'"
}

livecheck.type      regex
livecheck.url       http://www.ocaml-programming.de/godi-backup/
livecheck.regex     "ancient-(.*?).tar.gz"
