# $Id: Portfile 68618 2010-06-08 07:25:31Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       archcheck 1.0
PortGroup                       xcode 1.0
PortGroup                       xcodeversion 1.0

name                            graphviz-gui-devel
conflicts                       graphviz-gui graphviz-oldgui
set my_name                     graphviz
# keep version in sync between graphviz-devel and graphviz-gui-devel
version                         2.27.20100608.0445
categories                      graphics aqua
maintainers                     ryandesign
license                         CPLv1.0
homepage                        http://www.graphviz.org/
master_sites                    ${homepage}pub/graphviz/development/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     95e3339b28597e99ef5c6f0d8fb26223 \
                                sha1    d44029a942665682413525b69e892fa1e5d99ed2 \
                                rmd160  6456ccaf77ca651c45dd8ef34924cf0a6a98d4f7

depends_lib                     port:graphviz-devel

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-devel and graphviz-gui-devel
livecheck.type                  regex
livecheck.url                   ${homepage}Download_source.php
livecheck.regex                 ${my_name}-(\[0-9\]+\\.\[0-9\]*\[13579\](\\.\[0-9\]+)*)\\.tar
