# $Id: Portfile 90536 2012-03-08 09:35:48Z mww@macports.org $

PortSystem          1.0

name                lablgl
version             20120306
categories          graphics
license             BSD Tcl/Tk
maintainers         nomaintainer
description         Objective Caml interface to OpenGL
long_description    LablGL is is an Objective Caml interface to OpenGL. \
                    Support is included for use with both Glut (standalone) and LablTk.\
                    LablGTK also includes specific support for LablGL.
homepage            http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html
platforms           darwin
master_sites        http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/
checksums           md5     c850c8500837165adfa98535ad33f770 \
                    sha1    996f0aba788f5fa1531587fb06d667b94237cc92 \
                    rmd160  1b596ca0b970b1b2f36179502a48db2251a80574
depends_lib         port:ocaml
build.target        lib libopt glut glutopt
use_parallel_build  no
worksrcdir          lablGL

livecheck.type      regex
livecheck.url       http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html
livecheck.regex     {>lablgl-(.*)\.tar\.gz}

configure {
    copy ${worksrcpath}/Makefile.config.osx ${worksrcpath}/Makefile.config
}

set stublibsdir        ${destroot}${prefix}/lib/ocaml/stublibs/
pre-destroot {
    file mkdir ${stublibsdir}
}
destroot.args \
    INSTALLDIR=${destroot}${prefix}/lib/ocaml/lablgl \
    BINDIR=${destroot}${prefix}/bin \
    DLLDIR=${stublibsdir}

post-destroot {
        xinstall -d -m 755 ${destroot}${prefix}/lib/ocaml/site-lib/lablgl
        xinstall -m 644 ${filespath}/META ${destroot}${prefix}/lib/ocaml/site-lib/lablgl/META
}
