# $Id: Portfile 64709 2010-03-15 10:18:58Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       archcheck 1.0
PortGroup                       xcode 1.0
PortGroup                       xcodeversion 1.0

name                            graphviz-gui
conflicts                       graphviz-gui-devel graphviz-oldgui
set my_name                     graphviz
# keep version in sync between graphviz and graphviz-gui
version                         2.26.3
categories                      graphics aqua
maintainers                     ryandesign
license                         CPLv1.0
homepage                        http://www.graphviz.org/
master_sites                    ${homepage}pub/graphviz/stable/SOURCES/
use_parallel_build              yes
dist_subdir                     ${my_name}
distname                        ${my_name}-${version}
xcode.configuration             Release

description                     Mac OS X Aqua GUI for viewing and exporting \
                                Graphviz graphs

long_description                ${description}.

checksums                       md5     6f45946fa622770c45609778c0a982ee \
                                sha1    04503ac5a9eaa579859f0d017811fa245717edec \
                                rmd160  b2fbaf03b2006b43ed70e2a710363d7efbcfda77

depends_lib                     port:graphviz

archcheck.files                 lib/libgvc.dylib

pre-fetch {
    if {"darwin" != ${os.platform}} {
        ui_error "${name} requires Mac OS X."
        return -code error "incompatible operating system"
    }
    if {${os.major} < 9} {
        ui_error "${name} requires Mac OS X 10.5 or greater. Try graphviz-oldgui instead."
        return -code error "incompatible Mac OS X version"
    }
}

# graphviz needs Xcode 3.1+ to avoid the libGL error when building the smyrna variant
# graphviz-gui needs Xcode 3.1.2+; see #18811
minimum_xcodeversions           {9 3.1.2}

extract.post_args-append        ${worksrcdir}/macosx ${worksrcdir}/doc

patchfiles                      patch-project.pbxproj.diff

build.dir                       ${worksrcpath}/macosx
xcode.build.settings            PREFIX=${prefix}

xcode.destroot.settings         ${xcode.build.settings}

# keep livecheck in sync between graphviz and graphviz-gui
livecheck.type                  regex
livecheck.url                   ${homepage}Download_source.php
livecheck.regex                 ${my_name}-(\[0-9\]+\\.\[0-9\]*\[02468\](\\.\[0-9\]+)*)\\.tar
