# $Id: Portfile 67250 2010-05-03 13:42:12Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           archcheck 1.0

name                antigraingeometry
version             2.5
revision            3
categories          graphics devel
maintainers         nomaintainer
description         A high quality rendering engine for C++
long_description \
    Anti-Grain Geometry (AGG) is a general purpose graphical toolkit \
    written completely in standard and platform independent C++.  It can be \
    used in many areas of computer programming where high quality 2D \
    graphics is an essential part of the project.  For example, if you \
    render 2D geographic maps AGG is a must.  AGG uses only C++ and standard \
    C runtime functions, such as memcpy, sin, cos, sqrt, etc.  The basic \
    algorithms don't even use C++ Standard Template Library.  Thus, AGG can \
    be used in a very large number of applications, including embedded \
    systems.

platforms           darwin

homepage            http://www.antigrain.com/
master_sites        ${homepage}
distname            agg-${version}

checksums           md5 0229a488bc47be10a2fee6cf0b2febd6 \
                    sha1 08f23da64da40b90184a0414369f450115cdb328 \
                    rmd160 fac24d8ea56ee0a87307189f73c432b07b6d3c50

depends_build       port:pkgconfig

depends_lib         port:freetype
archcheck.files     lib/libfreetype.dylib

# These patchfiles hack out sdl support, it can't be done with a
# configure flag because of some autoconf/automake issues...
if {![variant_isset sdl]} {
    patchfiles      patch-configure.in.diff patch-src-platform-Makefile.am.diff
}

use_autoreconf        yes
autoreconf.args       -fvi
autoreconf.env        AUTOMAKE="automake --foreign --add-missing --ignore-deps"

configure.args      --disable-ctrl \
                    --disable-examples \
                    --disable-platform

variant sdl description {Add SDL support} {
    depends_lib-append  path:lib/pkgconfig/sdl.pc:libsdl
    archcheck.files-append  lib/libSDL.dylib
}
