Index: /trunk/dports/graphics/graphviz-devel/Portfile
===================================================================
--- /trunk/dports/graphics/graphviz-devel/Portfile	(revision 99115)
+++ /trunk/dports/graphics/graphviz-devel/Portfile	(revision 99116)
@@ -6,10 +6,11 @@
 PortGroup                       xcodeversion 1.0
 
-# Keep relevant lines in sync between graphviz-devel, graphviz-gui-devel and gvedit-devel.
+# Please keep the graphviz and graphviz-devel ports as similar as possible.
 
 name                            graphviz-devel
-conflicts                       graphviz
 set my_name                     graphviz
 version                         2.29.20121022.0445
+set thisbranch                  [strsed ${name} "g/^${my_name}//"]
+set otherbranch                 [expr {${thisbranch} == {} ? {-devel} : {}}]
 categories                      graphics
 maintainers                     ryandesign
@@ -41,4 +42,9 @@
 # graphviz-gui needs Xcode 3.1.2+; see #18811
 minimum_xcodeversions           {9 3.1.2}
+
+if {${name} == ${subport}} {
+conflicts                       graphviz${otherbranch}
+
+depends_build                   port:pkgconfig
 
 depends_lib                     port:xorg-libXaw \
@@ -57,6 +63,4 @@
                                 port:zlib \
                                 port:gettext
-
-depends_build                   port:pkgconfig
 
 depends_run                     port:urw-fonts
@@ -293,2 +297,85 @@
 livecheck.url                   ${homepage}Download_source.php
 livecheck.regex                 ${my_name}-(\[0-9\]+\\.\[0-9\]*\[13579\](\\.\[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                   app 1.0
+    PortGroup                   qt4 1.0
+    
+    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}
+    
+    post-extract {
+        if {[get_short_version_string] == ""} {
+            return -code error "cannot find ${app.name} short version string"
+        }
+    }
+    
+    patchfiles                  patch-cmd-gvedit-Makefile.in.diff
+    
+    # nawk: illegal jump type 339
+    conflicts_build             nawk
+    
+    configure.args              --disable-silent-rules \
+                                --with-qt
+    
+    build.dir                   ${worksrcpath}/cmd/gvedit
+    
+    app.name                    GVEdit
+    app.executable              gvedit
+    app.icon                    ${build.dir}/images/icon.png
+    
+    pre-destroot {
+        app.short_version_string [get_short_version_string]
+    }
+    
+    proc get_short_version_string {} {
+        global build.dir
+        return [exec /usr/bin/sed -E -n s/^\[\[:space:\]\]*"Version:\[\[:space:\]\]*(.+)".*/\\1/p ${build.dir}/mainwindow.cpp]
+    }
+}
Index: /trunk/dports/graphics/graphviz-devel/files/patch-cmd-gvedit-Makefile.in.diff
===================================================================
--- /trunk/dports/graphics/graphviz-devel/files/patch-cmd-gvedit-Makefile.in.diff	(revision 99116)
+++ /trunk/dports/graphics/graphviz-devel/files/patch-cmd-gvedit-Makefile.in.diff	(revision 99116)
@@ -0,0 +1,21 @@
+--- cmd/gvedit/Makefile.in.orig	2012-08-13 23:46:56.000000000 -0500
++++ cmd/gvedit/Makefile.in	2012-08-14 13:57:37.000000000 -0500
+@@ -67,8 +67,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))
+@@ -535,7 +534,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-devel/files/patch-project.pbxproj.diff
===================================================================
--- /trunk/dports/graphics/graphviz-devel/files/patch-project.pbxproj.diff	(revision 99116)
+++ /trunk/dports/graphics/graphviz-devel/files/patch-project.pbxproj.diff	(revision 99116)
@@ -0,0 +1,55 @@
+--- macosx/graphviz.xcodeproj/project.pbxproj.orig	2012-08-13 15:14:54.000000000 -0500
++++ macosx/graphviz.xcodeproj/project.pbxproj	2012-08-14 13:59:30.000000000 -0500
+@@ -380,12 +380,10 @@
+ 				INFOPLIST_FILE = Info.plist;
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				LIBRARY_SEARCH_PATHS = (
+-					../lib/cdt/.libs,
+-					../lib/cgraph/.libs,
+-					../lib/gvc/.libs,
++					"$(PREFIX)/lib",
+ 				);
+ 				PRODUCT_NAME = Graphviz;
+-				USER_HEADER_SEARCH_PATHS = "../lib/common ../lib/cdt ../lib/pathplan ../lib/cgraph ../lib/gvc";
++				USER_HEADER_SEARCH_PATHS = "$(PREFIX)/include/graphviz";
+ 				WRAPPER_EXTENSION = app;
+ 				ZERO_LINK = YES;
+ 			};
+@@ -403,13 +401,10 @@
+ 				INFOPLIST_FILE = Info.plist;
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				LIBRARY_SEARCH_PATHS = (
+-					../lib/cdt/.libs,
+-					../lib/cgraph/.libs,
+-					../lib/gvc/.libs,
++					"$(PREFIX)/lib",
+ 				);
+ 				PRODUCT_NAME = Graphviz;
+-				USER_HEADER_SEARCH_PATHS = "../lib/common ../lib/cdt ../lib/pathplan ../lib/cgraph ../lib/gvc";
+-				VALID_ARCHS = "i386 x86_64";
++				USER_HEADER_SEARCH_PATHS = "$(PREFIX)/include/graphviz";
+ 				WRAPPER_EXTENSION = app;
+ 			};
+ 			name = Release;
+@@ -420,21 +415,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;
+ 		};
