# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

set realname        camlidl
name                ocaml-${realname}
version             1.05
categories          devel ml
platforms           darwin
license             {QPL LGPL}
maintainers         takeshi openmaintainer
description         stub code generator and COM binding for Objective Caml
long_description \
    CamlIDL comprises two parts: \
    * A stub code generator that generates the C stub code required for the Caml/C interface, \
      based on an MIDL specification. (MIDL stands for Microsoft's Interface Description Language \
      it looks like C header files with some extra annotations, plus a notion of object interfaces \
      that look like C++ classes without inheritance.) \
    * A (currently small) library of functions and tools to import COM components in Caml applications, \
      and export Caml code as COM components.
homepage            http://caml.inria.fr/pub/old_caml_site/camlidl/
master_sites        http://caml.inria.fr/pub/old_caml_site/distrib/bazar-ocaml/
distname            ${realname}-${version}
depends_build       port:ocaml
  
checksums           rmd160 2b103dc407986fc29501fd2b2b41ec212b28dd10 \
                    sha256 857ed5bd3b2f99c62813070e1a5b4b6375e837c6815f4ad956baeb6f8c660311

universal_variant   no
use_configure       no

pre-build {
    file rename ${worksrcpath}/config/Makefile.unix ${worksrcpath}/config/Makefile
}

build.args          CPP=/usr/bin/cpp \
                    CAMLLIB=${prefix}/lib/ocaml \
                    OCAMLC="${prefix}/bin/ocamlc -g" \
                    OCAMLOPT=${prefix}/bin/ocamlopt \
                    OCAMLYACC="${prefix}/bin/ocamlyacc -v" \
                    OCAMLLEX=${prefix}/bin/ocamllex \
                    OCAMLDEP=${prefix}/bin/ocamldep \
                    CFLAGS=${configure.cflags}

pre-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/lib/ocaml
    xinstall -d -m 755 ${destroot}${prefix}/lib/ocaml/caml
}

destroot.args       BINDIR=${destroot}${prefix}/bin \
                    CAMLLIB=${prefix}/lib/ocaml \
                    OCAMLLIB=${destroot}${prefix}/lib/ocaml