# -*- 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

PortSystem          1.0
PortGroup           github 1.0

github.setup        garrigue lablgl 1.07 v
github.tarball_from archive
revision            0
epoch               1
categories          graphics ocaml
license             BSD Tcl/Tk
maintainers         {pmetzger @pmetzger} openmaintainer
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            https://github.com/garrigue/lablgl

checksums           rmd160  f27d546750c8fe126ea29d33ab65f2a4d1efc628 \
                    sha256  845477ed8d5aeaad63907a9edfc1d8f8d62b932c6e37a32502926ee402a6271f \
                    size    567464

depends_lib         port:ocaml \
                    port:ocaml-camlp-streams \
                    port:ocaml-findlib
build.target        lib libopt glut glutopt
use_parallel_build  no

# ocaml is not universal
universal_variant no

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
}
