Index: /trunk/dports/graphics/graphviz/Portfile
===================================================================
--- /trunk/dports/graphics/graphviz/Portfile	(revision 99139)
+++ /trunk/dports/graphics/graphviz/Portfile	(revision 99140)
@@ -6,11 +6,11 @@
 PortGroup                       xcodeversion 1.0
 
-# Keep relevant lines in sync between graphviz, graphviz-gui and gvedit.
+# Please keep the graphviz and graphviz-devel ports as similar as possible.
 
 name                            graphviz
-conflicts                       graphviz-devel
 set my_name                     graphviz
 version                         2.28.0
-revision                        8
+set thisbranch                  [strsed ${name} "g/^${my_name}//"]
+set otherbranch                 [expr {${thisbranch} == {} ? {-devel} : {}}]
 categories                      graphics
 maintainers                     ryandesign
@@ -42,4 +42,11 @@
 # graphviz-gui needs Xcode 3.1.2+; see #18811
 minimum_xcodeversions           {9 3.1.2}
+
+if {${name} == ${subport}} {
+revision                        8
+
+conflicts                       graphviz${otherbranch}
+
+depends_build                   port:pkgconfig
 
 depends_lib                     port:xorg-libXaw \
@@ -57,6 +64,4 @@
                                 port:zlib \
                                 port:gettext
-
-depends_build                   port:pkgconfig
 
 depends_run                     port:urw-fonts
@@ -297,2 +302,74 @@
 livecheck.url                   ${homepage}Download_source.php
 livecheck.regex                 ${my_name}-(\[0-9\]+\\.\[0-9\]*\[02468\](\\.\[0-9\]+)*)\\.tar
+} else {
+    livecheck.type              none
+}
+
+subport graphviz-gui${thisbranch} {
+    PortGroup                   xcode 1.0
+    
+    conflicts                   graphviz-gui${otherbranch} graphviz-oldgui
+    
+    categories-append           aqua
+    
+    description                 OS X Aqua GUI for viewing and exporting \
+                                Graphviz graphs
+    
+    long_description            ${description}.
+    
+    depends_lib                 port:graphviz${thisbranch}
+    
+    pre-fetch {
+        if {"darwin" != ${os.platform}} {
+            ui_error "${subport} requires OS X."
+            return -code error "incompatible operating system"
+        }
+        if {${os.major} < 9} {
+            ui_error "${subport} requires OS X 10.5 or greater. Try graphviz-oldgui instead."
+            return -code error "incompatible OS X version"
+        }
+    }
+    
+    extract.post_args-append    ${worksrcdir}/macosx ${worksrcdir}/doc
+    
+    patchfiles                  patch-project.pbxproj.diff
+    
+    xcode.configuration         Release
+    
+    build.dir                   ${worksrcpath}/macosx
+    xcode.build.settings        PREFIX=${prefix}
+    
+    xcode.destroot.settings     ${xcode.build.settings}
+}
+
+subport gvedit${thisbranch} {
+    PortGroup                   qt4 1.0
+    
+    revision                    2
+    
+    conflicts                   gvedit${otherbranch}
+    
+    description                 Qt-based GUI for Graphviz
+    
+    long_description            gvedit is a ${description}. You may prefer \
+                                the Mac-native GUI in the graphviz-gui${thisbranch} port.
+    
+    depends_lib-append          port:graphviz${thisbranch}
+    
+    patchfiles                  patch-cmd-gvedit-Makefile.in.diff \
+                                patch-cmd-gvedit-csettings.cpp.diff
+    
+    # nawk: illegal jump type 339
+    conflicts_build             nawk
+    
+    configure.args              --disable-silent-rules \
+                                --with-qt
+    
+    build.dir                   ${worksrcpath}/cmd/gvedit
+    
+    post-destroot {
+        set app GVEdit
+        xinstall -d ${destroot}${applications_dir}/${app}.app/Contents/MacOS
+        ln -s ${prefix}/bin/gvedit ${destroot}${applications_dir}/${app}.app/Contents/MacOS/${app}
+    }
+}
Index: /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-Makefile.in.diff
===================================================================
--- /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-Makefile.in.diff	(revision 99140)
+++ /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-Makefile.in.diff	(revision 99140)
@@ -0,0 +1,21 @@
+--- cmd/gvedit/Makefile.in.orig	2011-05-06 22:27:39.000000000 -0500
++++ cmd/gvedit/Makefile.in	2012-01-02 02:16:24.000000000 -0600
+@@ -68,8 +68,7 @@
+ 	gvedit-mdichild.$(OBJEXT) $(am__objects_1)
+ gvedit_OBJECTS = $(am_gvedit_OBJECTS)
+ am__DEPENDENCIES_1 =
+-gvedit_DEPENDENCIES = $(top_builddir)/lib/gvc/libgvc.la \
+-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
++gvedit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ AM_V_lt = $(am__v_lt_$(V))
+ am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+@@ -538,7 +541,7 @@
+ 	-DGVEDIT_DATADIR=\""$(pkgdatadir)/gvedit"\"
+ 
+ gvedit_LDADD = \
+-	$(top_builddir)/lib/gvc/libgvc.la \
++	-lgvc \
+ 	$(QTGUI_LIBS) \
+ 	$(QTCORE_LIBS) \
+ 	$(EXPAT_LIBS) $(Z_LIBS) 
Index: /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-csettings.cpp.diff
===================================================================
--- /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-csettings.cpp.diff	(revision 99140)
+++ /trunk/dports/graphics/graphviz/files/patch-cmd-gvedit-csettings.cpp.diff	(revision 99140)
@@ -0,0 +1,17 @@
+http://hg.research.att.com/graphviz/rev/a7620a110c4e
+--- cmd/gvedit/csettings.cpp.orig	Wed Aug 03 16:07:10 2011 -0400
++++ cmd/gvedit/csettings.cpp	Wed Aug 03 16:19:05 2011 -0400
+@@ -373,11 +373,11 @@
+     if (!graph)
+ 	return false;
+     QString sfx = WIDGET(QComboBox, cbExtension)->currentText();
++    QString fileName(WIDGET(QLineEdit, leOutput)->text());
+ 
+-    if (sfx == QString("NONE"))
++    if ((fileName == QString("")) || (sfx == QString("NONE")))
+ 	doPreview(QString());
+     else {
+-	QString fileName(WIDGET(QLineEdit, leOutput)->text());
+ 	fileName = stripFileExtension(fileName);
+ 	fileName = fileName + "." + sfx;
+ 	if (fileName != activeWindow->outputFile)
Index: /trunk/dports/graphics/graphviz/files/patch-project.pbxproj.diff
===================================================================
--- /trunk/dports/graphics/graphviz/files/patch-project.pbxproj.diff	(revision 99140)
+++ /trunk/dports/graphics/graphviz/files/patch-project.pbxproj.diff	(revision 99140)
@@ -0,0 +1,55 @@
+--- macosx/graphviz.xcodeproj/project.pbxproj.orig	2011-04-05 09:08:13.000000000 -0500
++++ macosx/graphviz.xcodeproj/project.pbxproj	2011-04-08 02:02:57.000000000 -0500
+@@ -376,12 +376,10 @@
+ 				INFOPLIST_FILE = Info.plist;
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				LIBRARY_SEARCH_PATHS = (
+-					../lib/cdt/.libs,
+-					../lib/graph/.libs,
+-					../lib/gvc/.libs,
++					"$(PREFIX)/lib",
+ 				);
+ 				PRODUCT_NAME = Graphviz;
+-				USER_HEADER_SEARCH_PATHS = "../lib/common ../lib/cdt ../lib/pathplan ../lib/graph ../lib/gvc";
++				USER_HEADER_SEARCH_PATHS = "$(PREFIX)/include/graphviz";
+ 				WRAPPER_EXTENSION = app;
+ 				ZERO_LINK = YES;
+ 			};
+@@ -399,13 +397,10 @@
+ 				INFOPLIST_FILE = Info.plist;
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				LIBRARY_SEARCH_PATHS = (
+-					../lib/cdt/.libs,
+-					../lib/graph/.libs,
+-					../lib/gvc/.libs,
++					"$(PREFIX)/lib",
+ 				);
+ 				PRODUCT_NAME = Graphviz;
+-				USER_HEADER_SEARCH_PATHS = "../lib/common ../lib/cdt ../lib/pathplan ../lib/graph ../lib/gvc";
+-				VALID_ARCHS = "i386 x86_64";
++				USER_HEADER_SEARCH_PATHS = "$(PREFIX)/include/graphviz";
+ 				WRAPPER_EXTENSION = app;
+ 			};
+ 			name = Release;
+@@ -416,21 +411,15 @@
+ 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ 				GCC_WARN_UNUSED_VARIABLE = YES;
+ 				PREBINDING = NO;
+-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ 			};
+ 			name = Debug;
+ 		};
+ 		C05733CD08A9546B00998B17 /* Release */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ 				GCC_WARN_UNUSED_VARIABLE = YES;
+ 				PREBINDING = NO;
+-				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ 			};
+ 			name = Release;
+ 		};
