# $Id: Portfile 115215 2013-12-28 12:04:26Z raphael@macports.org $

PortSystem          1.0
PortGroup           xcodeversion 1.0

name                geomview
version             1.9.4
revision            7
categories          science graphics x11
license             LGPL-2.1
maintainers         raphael 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/
platforms           darwin
master_sites        sourceforge:project/geomview/geomview/${version}
checksums           rmd160  adf7c8ba745db9ff003e3ed74089379b2a72c712 \
                    sha256  0647acb8582609836e588b97a7f16f70b08edb8f69d6b42f9794c142e04f75a6
patchfiles          patch-iobuffer.c.diff \
                    patch-glob.c.diff

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

depends_lib         port:openmotif \
                    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 conflicts no_opengl description {Use OpenGL} {
    configure.args-delete       --without-opengl
    configure.args-append       --with-opengl=${prefix}
    depends_lib-append          port:mesa
}

variant no_opengl conflicts opengl description {Legacy compatibility variant} {}

if {[variant_isset no_opengl]} {
    default_variants -opengl
} else {
    default_variants +opengl
}
