diff --unidirectional-new-file -ru -x PortIndex ports.orig/devel/openssl/Portfile ports.test/devel/openssl/Portfile
--- ports.orig/devel/openssl/Portfile	2008-11-12 02:05:28.000000000 -0700
+++ ports.test/devel/openssl/Portfile	2009-01-06 16:05:13.000000000 -0700
@@ -68,7 +68,12 @@
 	}
 
 	configure {
+		# Save configure.universal_archs because we modify it before
+		# each invocation of Configure.
+		set tmp_universal_archs ${configure.universal_archs}
 		foreach arch ${universal_archs} {
+			# We configure for one arch at a time.
+			configure.universal_archs ${arch}
 			if { [string first 64 $arch] == -1 } {
 				set my_cc "darwin-${arch}-cc"
 			} else {
@@ -79,7 +84,14 @@
 				}
 			}
 			system "cd ${workpath}/${arch} && ./Configure ${my_cc} ${configure.pre_args} ${configure.args}"
+			reinplace "s|^\\(CFLAG=.*\\)|\\1 ${configure.cflags} ${configure.universal_cflags}|" \
+				${workpath}/${arch}/Makefile
+			reinplace "s|^\\(SHARED_LDFLAGS=.*\\)|\\1 ${configure.ldflags} ${configure.universal_ldflags}|" \
+				${workpath}/${arch}/Makefile \
+				${workpath}/${arch}/Makefile.shared
 		}
+		# Restore configure.universal_archs.
+		configure.universal_archs $tmp_universal_archs
 	}
 
 	build {
diff --unidirectional-new-file -ru -x PortIndex ports.orig/graphics/cairo/Portfile ports.test/graphics/cairo/Portfile
--- ports.orig/graphics/cairo/Portfile	2008-12-23 00:12:26.000000000 -0700
+++ ports.test/graphics/cairo/Portfile	2009-01-06 22:02:25.000000000 -0700
@@ -67,6 +67,24 @@
     --enable-xlib-xrender \
     --with-x
 
+# This block helps us link correctly and setup our pc files correctly when we are
+# +system_x11 and x11prefix is somewhere non-standard 
+if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
+    # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
+    # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
+    # and LDFLAGS without interference
+    configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
+    configure.cppflags-append -I${x11prefix}/include
+    configure.ldflags-append  -L${x11prefix}/lib
+    
+    # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
+    post-destroot {
+        foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
+            reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
+        }
+    }
+}
+
 variant glitz conflicts no_x11 description {Add glitz graphics interface} {
     depends_lib-append \
         port:glitz
@@ -149,12 +167,16 @@
     }
     
     configure {
+        # Save configure.universal_archs because we modify it before each
+        # invocation of Configure.
+        set tmp_universal_archs ${configure.universal_archs}
         foreach arch ${universal_archs} {
-            set my_arch_flag "-arch ${arch}"
-            set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag}"
-            set my_ldflags "${configure.ldflags} ${my_arch_flag}"
-            system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" ${configure.cmd} ${configure.pre_args} ${configure.args}"
+            # We configure for one arch at a time.
+            configure.universal_archs ${arch}
+            system "cd ${workpath}/${arch} && CPPFLAGS=\"${configure.cppflags} ${configure.universal_cppflags}\" CFLAGS=\"${configure.cflags} ${configure.universal_cflags}\" CXXFLAGS=\"${configure.cflags} ${configure.universal_cxxflags}\" LDFLAGS=\"${configure.ldflags} ${configure.universal_ldflags}\" ${configure.cmd} ${configure.pre_args} ${configure.args} ${configure.universal_args}"
         }
+        # Restore configure.universal_archs.
+        configure.universal_archs $tmp_universal_archs
     }
     
     build {
diff --unidirectional-new-file -ru -x PortIndex ports.orig/python/py25-py2app-devel/Portfile ports.test/python/py25-py2app-devel/Portfile
--- ports.orig/python/py25-py2app-devel/Portfile	2008-08-22 18:17:16.000000000 -0600
+++ ports.test/python/py25-py2app-devel/Portfile	2009-01-06 16:05:13.000000000 -0700
@@ -26,7 +26,7 @@
 
 depends_lib-append  port:py25-setuptools \
                     port:py25-altgraph \
-                    path:${prefix}${apymacholibfile}:py25-macholib \
+                    port:py25-macholib-devel \
                     port:py25-modulegraph-devel \
                     port:py25-bdist_mpkg
 
diff --unidirectional-new-file -ru -x PortIndex ports.orig/x11/gtk2/Portfile ports.test/x11/gtk2/Portfile
--- ports.orig/x11/gtk2/Portfile	2008-12-20 00:10:57.000000000 -0700
+++ ports.test/x11/gtk2/Portfile	2009-01-06 22:03:27.000000000 -0700
@@ -105,6 +105,24 @@
     system "${prefix}/bin/gdk-pixbuf-query-loaders >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
 }
 
+# This block helps us link correctly and setup our pc files correctly when we are
+# +system_x11 and x11prefix is somewhere non-standard 
+if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
+    # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
+    # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
+    # and LDFLAGS without interference
+    configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
+    configure.cppflags-append -I${x11prefix}/include
+    configure.ldflags-append  -L${x11prefix}/lib
+    
+    # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
+    post-destroot {
+        foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
+            reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
+        }
+    }
+}
+
 platform darwin 7 {
     depends_build-append    port:cups-headers
 }
diff --unidirectional-new-file -ru -x PortIndex ports.orig/x11/pango/Portfile ports.test/x11/pango/Portfile
--- ports.orig/x11/pango/Portfile	2008-12-22 01:04:33.000000000 -0700
+++ ports.test/x11/pango/Portfile	2009-01-06 22:02:52.000000000 -0700
@@ -58,11 +58,30 @@
 
 configure.ldflags-append \
     -no-undefined \
-    -bind_at_load
+    -bind_at_load \
+    "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
 
 configure.args \
     --enable-static
 
+# This block helps us link correctly and setup our pc files correctly when we are
+# +system_x11 and x11prefix is somewhere non-standard 
+if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
+    # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
+    # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
+    # and LDFLAGS without interference
+    configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
+    configure.cppflags-append -I${x11prefix}/include
+    configure.ldflags-append  -L${x11prefix}/lib
+    
+    # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
+    post-destroot {
+        foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
+            reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
+        }
+    }
+}
+
 variant no_x11 {
     depends_lib-delete \
         lib:libXft.2:Xft2

