# -*- 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 92938 2012-05-11 14:36:43Z ryandesign@macports.org $

PortSystem                      1.0
PortGroup                       archcheck 1.0
PortGroup                       xcode 1.0
PortGroup                       xcodeversion 1.0

# Keep relevant lines in sync between graphviz-devel, graphviz-gui-devel and gvedit-devel.

name                            graphviz-gui-devel
conflicts                       graphviz-gui graphviz-oldgui
set my_name                     graphviz
version                         2.29.20120511.0445
categories                      graphics aqua
maintainers                     ryandesign
license                         EPL-1.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                       rmd160  908c04bf929f7b4e6ee42bb41dd8a9854b95d59c \
                                sha256  4196f28ad182f5c23ed6cc11d6e91f9179d7363fb2bdb8fccb55dab698da27de

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}

livecheck.type                  regex
livecheck.url                   ${homepage}Download_source.php
livecheck.regex                 ${my_name}-(\[0-9\]+\\.\[0-9\]*\[13579\](\\.\[0-9\]+)*)\\.tar
