PortSystem          1.0
PortGroup           xcodeversion 1.0

name                geomview
version             1.9.5
revision            1
categories          science graphics x11
license             LGPL-2.1
maintainers         {raphael @raphael-st} openmaintainer
description         interactive 3D viewing program
long_description    Geomview is an interactive 3D viewing program for Unix. \
                    It lets you view and manipulate 3D objects: you use the \
                    mouse to rotate, translate, zoom in and out, etc. It \
                    can be used as a standalone viewer for static objects \
                    or as a display engine for other programs which produce \
                    dynamically changing geometry. It can display objects \
                    described in a variety of file formats. It comes with a \
                    wide selection of example objects, and you can create \
                    your own objects too.
homepage            http://www.geomview.org/
master_sites        sourceforge:project/geomview/geomview/${version}

use_xz              yes

checksums           rmd160  fa1b3387e096b841e8c3981ffa8d28cb3d912829 \
                    sha256  dd1c2c55fb034c947792c726e241505503a896dcc609a7d51506fd47f0025402 \
					size    3498220

patchfiles          patch-iobuffer.c.diff no-finite.diff

configure.args      --without-opengl \
                    --with-htmlbrowser=open \
                    --with-pdfviewer=open

depends_lib         port:motif \
                    port:zlib \
                    port:xorg-libXt \
                    port:xorg-libXmu \
                    port:xorg-libsm \
                    port:xorg-libXext \
                    port:xorg-libX11 \
                    port:xorg-libXau \
                    port:xorg-libXdmcp

minimum_xcodeversions   {9 3.1}

build.env           LANG=C

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        ChangeLog \
        NEWS \
        README \
        ${destroot}${prefix}/share/doc/${name}
}

variant opengl description {Use OpenGL} {
    configure.args-delete       --without-opengl
    configure.args-append       --with-opengl=${prefix}
    depends_lib-append          port:mesa port:libGLU
}

default_variants +opengl
