# -*- 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
# $Id: Portfile 89881 2012-02-14 02:13:33Z takanori@macports.org $

PortSystem              1.0
PortGroup               cmake 1.0

name                    gl2ps
version                 1.3.5
revision                2
categories              graphics print
platforms               darwin
maintainers             nomaintainer
license                 GL2PS-2 LGPL-2

description             an OpenGL to PostScript printing library

long_description        GL2PS is a C library providing high quality vector \
                        output for any OpenGL application. The main difference \
                        between GL2PS and other similar libraries is the use of \
                        sorting algorithms capable of handling intersecting and \
                        stretched polygons, as well as non manifold objects. \
                        GL2PS provides advanced smooth shading and text \
                        rendering, culling of invisible primitives, mixed \
                        vector/bitmap output, and much more...

homepage                http://geuz.org/gl2ps/
master_sites            ${homepage}src/
extract.suffix          .tgz

checksums               sha1    cf2c5220662581f48ef59173c64f41dc47011c6b \
                        rmd160  bced0f28d0912670ee09c847a47e87c6787e94c3

depends_lib-append      port:zlib \
                        port:libpng \
                        port:ghostscript \

worksrcdir              ${name}-${version}-source

configure.args-append   -DZLIB_INCLUDE_DIR=${prefix}/include \
                        -DZLIB_LIBRARY=${prefix}/lib/libz.dylib \
                        -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
                        -DPNG_INCLUDE_DIR=${prefix}/include

use_parallel_build      yes

test.run                yes

variant bibtex description {Add BibTeX support} {
    depends_lib-append port:bibtex2html
    configure.args-append -DBIBTEX_COMPILER=${prefix}/lib/
}

variant latex description {Add LaTeX support} {
    depends_lib-append port:latex2html
    configure.args-append -DLATEX2HTML_CONVERTER=${prefix}/lib/
}

livecheck.type          regex
livecheck.url           [lindex ${master_sites} 0]
livecheck.regex         ${name}-(\[0-9.\]+)\\.
