# $Id: Portfile 64888 2010-03-16 17:33:19Z raphael@macports.org $

PortSystem          1.0
PortGroup           xcodeversion 1.0

name                geomview
version             1.9.4
revision            3
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
checksums           md5 29c7e6d678af7b9968980f92954419bb \
                    sha1 b5e04dfee5cef46655766c2456199905832cd45c \
                    rmd160 adf7c8ba745db9ff003e3ed74089379b2a72c712
patchfiles          patch-iobuffer.c.diff \
                    patch-geomview.texi.diff \
                    patch-geomview-pt_BR.texi.diff

post-extract {      delete ${worksrcpath}/doc/geomview.html
                    delete ${worksrcpath}/doc/geomview-pt_BR.html
}

configure.args      --with-opengl=${prefix} \
                    --with-htmlbrowser=open \
                    --with-pdfviewer=open

depends_lib         port:openmotif \
                    port:zlib \
                    port:xorg-libXt \
		    port:mesa \
                    port:libpng \
                    port:jpeg \
                    port:xorg-libXp \
                    port:Xft2 \
                    port:xrender \
                    port:fontconfig \
                    port:libiconv \
                    port:expat \
                    port:freetype \
                    port:xorg-libXmu \
                    port:xorg-libsm \
                    port:xorg-libXext \
                    port:xorg-libX11 \
                    port:xorg-libXau \
                    port:xorg-libXdmcp

depends_build       path:bin/tex:texlive \
                    port:texinfo

minimum_xcodeversions   {9 3.1}

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 no_zlib description {Do not use zlib} {
    configure.args-append       --without-zlib
    depends_lib-delete          port:zlib
}

variant no_opengl description {Do not use OpenGL} {
    configure.args-append       --without-opengl
    configure.args-delete       --with-opengl=${prefix}
    depends_lib-delete          port:mesa
}
