Index: files/patch-configure-change_install_names.diff
===================================================================
--- files/patch-configure-change_install_names.diff	(revision 0)
+++ files/patch-configure-change_install_names.diff	(revision 0)
@@ -0,0 +1,56 @@
+--- configure.orig	2011-01-13 02:34:25.000000000 -0800
++++ configure	2011-01-13 02:33:45.000000000 -0800
+@@ -34968,16 +34968,18 @@
+             DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
+             cat <<EOF >change-install-names
+ #!/bin/sh
+-libnames=\`cd \${1} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\`
+-for i in \${libnames} ; do
+-    ${HOST_PREFIX}install_name_tool -id \${1}/\${i} \${1}/\${i}
+-    for dep in \${libnames} ; do
+-        ${HOST_PREFIX}install_name_tool -change \${2}/\${dep} \${1}/\${dep} \${1}/\${i}
+-    done
++libnames=\`find -E \$4  -type f -a -regex '.*\.[0-9]+\.dylib' -exec basename '{}' \;\`
++changes=''
++for dep in \$libnames; do
++    changes="\$changes -change \$4/\$dep \$3/\$dep"
+ done
++for i in \$libnames; do
++    ${HOST_PREFIX}install_name_tool \$changes -id \$3/\$i \$1/\$i
++done
++${HOST_PREFIX}install_name_tool \$changes \$2/wxrc-2.9
+ EOF
+             chmod +x change-install-names
+-            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${libdir} \$(wx_top_builddir)/lib"
++            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib"
+         fi
+ 
+                                         HEADER_PAD_OPTION="-headerpad_max_install_names"
+--- configure.in.orig	2011-01-13 02:34:15.000000000 -0800
++++ configure.in	2011-01-13 02:32:44.000000000 -0800
+@@ -3989,16 +3989,18 @@
+             DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
+             cat <<EOF >change-install-names
+ #!/bin/sh
+-libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
+-for i in \${libnames} ; do
+-    ${HOST_PREFIX}install_name_tool -id \${1}/\${i} \${1}/\${i}
+-    for dep in \${libnames} ; do
+-        ${HOST_PREFIX}install_name_tool -change \${2}/\${dep} \${1}/\${dep} \${1}/\${i}
+-    done
++libnames=\`find \$4  -type f -a -regex '.*\.[0-9]+\.dylib' -exec basename '{}' \;\`
++changes=''
++for dep in \$libnames; do
++    changes="\$changes -change \$4/\$dep \$3/\$dep"
+ done
++for i in \$libnames; do
++    ${HOST_PREFIX}install_name_tool \$changes -id \$3/\$i \$1/\$i
++done
++${HOST_PREFIX}install_name_tool \$changes \$2/wxrc-2.9
+ EOF
+             chmod +x change-install-names
+-            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${libdir} \$(wx_top_builddir)/lib"
++            DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib"
+         fi
+ 
+         dnl the HEADER_PAD_OPTION is required by some wx samples to avoid the error:
Index: Portfile
===================================================================
--- Portfile	(revision 79292)
+++ Portfile	(working copy)
@@ -1,10 +1,12 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup               archcheck 1.0
 
 name			wxWidgets-devel
+conflicts		wxgtk wxWidgets
 version			2.9.1
-revision                1
+revision        2
 categories		graphics devel
 platforms		darwin
 maintainers		jwa
@@ -18,90 +20,66 @@
 
 homepage		http://www.wxwidgets.org/
 distname		wxWidgets
-master_sites		http://biolpc22.york.ac.uk/pub/CVS_HEAD/v2/files/ \
-    http://biolpc22.york.ac.uk/pub/${version}/ \
-    ftp://ftp.wxwidgets.org/pub/${version}
+master_sites	sourceforge:wxwindows \
+			    http://biolpc22.york.ac.uk/pub/${version}/
+
 use_bzip2		yes
 
 distfiles		${distname}-${version}${extract.suffix}
 dist_subdir		${distname}/${version}
+checksums           md5     81c20d7b2ba31becb18e467dbe09be8f \
+                    sha1    3ffe0614acce46448f5c14942176fb2daa6efd00 \
+                    rmd160  106f5b0238e31e12bbede7f1c2cf0e0134076e29
+                    
+depends_lib		port:jpeg \
+			    port:tiff \
+			    port:libpng \
+			    port:zlib \
+			    port:libiconv \
+			    port:expat \
+			    path:lib/pkgconfig/sdl.pc:libsdl \
+			    port:libsdl_mixer
 
-checksums		${distname}-${version}${extract.suffix} \
-    md5     81c20d7b2ba31becb18e467dbe09be8f \
-    ${distname}-${version}${extract.suffix} \
-    sha1    3ffe0614acce46448f5c14942176fb2daa6efd00 \
-    ${distname}-${version}${extract.suffix} \
-    rmd160  106f5b0238e31e12bbede7f1c2cf0e0134076e29
 
-depends_lib		port:jpeg \
-    port:tiff \
-    port:libpng \
-    port:zlib \
-    port:libiconv \
-    port:expat \
-    path:lib/pkgconfig/sdl.pc:libsdl \
-    port:libsdl_mixer
+archcheck.files lib/libjpeg.dylib \
+                lib/libtiff.dylib \
+                lib/libpng.dylib \
+                lib/libz.dylib \
+                lib/libiconv.dylib \
+                lib/libexpat.dylib
 
-#set worksrcdir	build
-set worksrcdir		${distname}-${version}/build
+set worksrcdir	${distname}-${version}/build
 
-extract.only		${distname}-${version}${extract.suffix}
+extract.only	${distname}-${version}${extract.suffix}
 
-set sub			wx-devel
-configure.cmd		../configure
+patch.dir	${worksrcpath}/..
+patchfiles	patch-configure-change_install_names.diff
+configure.cmd	../configure
 configure.ldflags	-L${build.dir}/lib -L${prefix}/lib
-configure.args		--mandir=${prefix}/share/man \
-    --libdir=${prefix}/lib/${sub} \
-    --bindir=${prefix}/lib/${sub}/bin \
-    --includedir=${prefix}/include/${sub} \
-    --datadir=${prefix}/share/${sub} \
-    --with-libiconv-prefix=${prefix} \
-    --with-libjpeg \
-    --with-libtiff \
-    --with-libpng \
-    --with-zlib \
-    --with-sdl \
-    --with-opengl \
-    --with-mac \
-    --disable-sdltest \
-    --enable-unicode \
-    --enable-display \
-    --enable-monolithic \
-    --with-macosx-version-min=${macosx_deployment_target}
-if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
-    # default carbon won't work on 64-bit
-    configure.args-delete --with-mac
-    configure.args-append --with-osx_cocoa
-#    patchfiles-append     patch-textctrl.diff
-}
+configure.args	--mandir=${prefix}/share/man \
+			    --with-libiconv-prefix=${prefix} \
+			    --with-libjpeg \
+			    --with-libtiff \
+			    --with-libpng \
+			    --with-zlib \
+			    --with-opengl \
+			    --with-cocoa \
+			    --enable-unicode \
+			    --enable-display \
+			    --enable-monolithic
 
-set installtype		release
-#set contrib		"gizmos stc ogl"
-
 build.target
 
-#post-build {
-#    foreach c { ${contrib} } {
-#	system "cd ${build.dir} && make -C contrib/src/${c}"
-#    }
-#}
+universal_variant	no
+use_parallel_build	yes
 
+supported_archs	x86_64 ppc64 i386 ppc
+configure.ccache = no
+configure.cppflags-append -arch ${configure.build_arch}
+
 post-destroot {
-#    foreach c { ${contrib} } {
-#	system "cd ${destroot.dir} && make -C contrib/src/${c} install ${destroot.destdir}"
-#    }
-    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
-#    xinstall -m 644 -W ${workpath}/${distname}-${version} \
-#	install-mac.txt install-mgl.txt install-motif.txt \
-#	INSTALL-OS2.txt install-x11.txt readme-cocoa.txt \
-#	readme-gtk.txt readme-mac.txt \
-#	readme-mgl.txt readme-motif.txt readme-x11.txt \
-#	${destroot}${prefix}/share/doc/${name}
-#    if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
-#        reinplace "s|-L${build.dir}/lib||" ${destroot}${prefix}/lib/${sub}/wx/config/osx_cocoa-unicode-${installtype}-2.9
-#    } else {
-#        reinplace "s|-L${build.dir}/lib||" ${destroot}${prefix}/lib/${sub}/wx/config/osx_carbon-unicode-${installtype}-2.9
-#    }
+    set confscript ${prefix}/lib/wx/config/osx_cocoa-unicode-2.9
+    ln -sf ${confscript} ${destroot}${prefix}/bin/wx-config
 }
 
 variant nonmonolithic description {build libraries separately} {
@@ -110,9 +88,8 @@
 
 variant debug description {add debug info to libraries} {
     configure.args-append	--enable-debug
-    set installtype debug
 }
 
 livecheck.type		regex
-livecheck.url		http://biolpc22.york.ac.uk/pub/
-livecheck.regex		(2.\[0-9\]+.\[0-9a-z.-\]+)/
+livecheck.url		${homepage}/downloads/
+livecheck.regex		Current Stable Release.*(2\\.\[0-9\]\\.\[0-9\]+)
