# -*- 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: Portfile 78210 2011-04-28 15:32:54Z ryandesign@macports.org $

PortSystem          1.0

name                lablgtk
version             1.2.7
revision            1
categories          x11
platforms           darwin
maintainers         nomaintainer

description         Objective Caml interface to gtk+

long_description    LablGTK is is an Objective Caml interface to gtk+. \
                    It uses the rich type system of Objective Caml 3 to provide a \
                    strongly typed, yet very comfortable, object-oriented interface to \
                    gtk+. This is not that easy if you know the dynamic typing approach \
                    taken by gtk+.

homepage            http://lablgtk.forge.ocamlcore.org/
master_sites        http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/

checksums           md5     73a797e3a459190fdcaa8288935f6fb9 \
                    sha1    fe43512efdc7ab4e0dafb7dc8254a784857a1ade \
                    rmd160  27be7ff29fe4370bc9a1bbef8c0fa0db590f27c4

depends_lib         port:ocaml \
                    port:gtk1

# ocaml is not universal
universal_variant   no

configure {
    system "cd ${worksrcpath} && make configure \
        USE_DOTOPT=1 \
        INSTALLDIR=${destroot}${prefix}/lib/ocaml/lablgtk \
        BINDIR=${destroot}${prefix}/bin \
        DLLDIR=${destroot}${prefix}/lib/ocaml/stublibs && make"
}

build.target        opt

post-destroot {
    system "ranlib ${destroot}${prefix}/lib/ocaml/lablgtk/lablgtk.a"
    system "ranlib ${destroot}${prefix}/lib/ocaml/lablgtk/liblablgtk.a"
    reinplace "s|${destroot}${prefix}|${prefix}|g" ${destroot}${prefix}/bin/${name}
}

livecheck.type      regex
livecheck.regex     {lablgtk-(1(\.[0-9]+)+)\.}
