Portfile

# $Id: Portfile 23199 2007-03-27 04:52:19Z ryandesign@macports.org $

PortSystem 1.0
name graphviz
version 2.12
revision 1
categories graphics
maintainers ryandesign@macports.org
description Graph visualization software from AT&T and Bell Labs
long_description \
Graph Visualization Software from AT&T Laboratories and \
Bell Laboratories (Lucent Technologies). \
\
The package contains: \
dot - batch program for drawing directed graphs as \
hierarchies \
neato - batch program for drawing undirected graphs \
using Kamada-Kawai spring models. \
\
Users wishing to have only the graph layout \
programs (for non-interactive use) can use the +no_x11 \
variant to build graphviz without its display routines.

platforms darwin

homepage http://www.graphviz.org/
master_sites http://www.graphviz.org/pub/graphviz/ARCHIVE/

checksums md5 e5547bc0ec47943c72f5c3e2b5dff58f

platform darwin 6 {
patchfiles-append patch-Makefile.in
ui_msg "Note: dot2gxl and gxl2dot do not build on OS X 10.2 (Jaguar). Sorry."
}

platform darwin 7 {
configure.env-append MACOSX_DEPLOYMENT_TARGET=10.3
build.env-append MACOSX_DEPLOYMENT_TARGET=10.3

depends_lib-append port:gnuregex

post-extract {
reinplace "s|regex.h|gnuregex.h|g" ${worksrcpath}/lib/gvc/gvconfig.c
}
}

platform darwin 8 {
configure.env-append MACOSX_DEPLOYMENT_TARGET=10.4 \
CC=/usr/bin/gcc-4.0 \
CPP=/usr/bin/cpp-4.0 \
CXX=/usr/bin/g++-4.0

build.env-append MACOSX_DEPLOYMENT_TARGET=10.4
}

depends_lib lib:libX11.6:XFree86 \
port:cairo \
port:pango \
port:jpeg \
port:libpng \
port:freetype \
port:expat \
port:zlib \
port:gettext

depends_run port:urw-fonts

# All of the language bindings except tcl are disabled by default.
# (If you're running DP, you have a good enough tcl to get the languange
# binding. If this is a problem for anyone it is easily remedied.)
#
configure.env CPPFLAGS=-I${prefix}/include \
LDFLAGS=-L${prefix}/lib

configure.args --mandir=${prefix}/share/man \
--with-mylibgd \
--with-pangocairo \
--disable-guile \
--disable-lua \
--disable-ocaml \
--disable-perl \
--disable-php \
--disable-python \
--disable-ruby

variant guile { depends_lib-append port:guile
configure.args-append --enable-guile
}

variant lua { depends_lib-append port:lua
configure.args-append --enable-lua
}

variant ocaml { depends_lib-append port:ocaml
configure.args-append --enable-ocaml
}

variant perl { depends_lib-append port:perl5.8
configure.args-append --enable-perl
}

variant php { depends_lib-append port:php4
configure.args-append --enable-php
}

variant python { depends_lib-append port:python24
configure.args-append --enable-python
}

variant ruby { depends_lib-append port:ruby
configure.args-append --enable-ruby
}

variant all_lang { depends_lib-append port:guile \
port:lua \
port:ocaml \
port:perl5.8 \
port:php4 \
port:python24 \
port:ruby

configure.args-append --enable-guile \
--enable-lua \
--enable-ocaml \
--enable-perl \
--enable-php \
--enable-python \
--enable-ruby
}

variant no_x11 { depends_lib-delete lib:libX11.6:XFree86
configure.args-append --without-x
}


# Make the configuration file that makes the plugins work:

post-activate {
system "dot -c"
}

files