# $Id: Portfile 78753 2011-05-21 14:00:08Z ryandesign@macports.org $

PortSystem          1.0

name                caml-sqlite3
version             1.5.9
categories          devel ml databases
maintainers         landonf openmaintainer
description         OCaml bindings for SQLite 3
long_description    ${description}

homepage            http://www.ocaml.info/home/ocaml_sources.html
platforms           darwin
master_sites        http://www.ocaml.info/ocaml_sources/

distname            ocaml-sqlite3-${version}

checksums           sha1    e92f3d352a145389af7acaedc3cc001a63764bba \
                    rmd160  9c9ea73c66ba8d12a72bb727cbe5070364d44fb6

depends_lib         port:ocaml \
                    port:caml-findlib \
                    port:sqlite3

# ocaml is not universal
universal_variant   no

patchfiles          patch-Makefile.in

# ocamlmklib does not hanle the -arch flag
if {[info exists build_arch] && ${os.platform} == "darwin"} {
  configure.cc_archflags
  configure.ld_archflags
  configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
}

configure.args      --with-sqlite3=${prefix}

use_parallel_build  no

pre-destroot {
    set ocaml_site_path [exec ocamlfind printconf destdir]
    file mkdir ${destroot}/${ocaml_site_path}
    file mkdir ${destroot}/${ocaml_site_path}/stublibs
}

livecheck.type      regex
livecheck.regex     {>ocaml-sqlite3-release-(.*)\.tar\.bz2}
