--- /MacPorts/var/macports/sources/rsync.macports.org/release/ports/math/R/Portfile	2010-03-15 17:31:33.000000000 +0100
+++ Portfile	2010-04-11 12:51:48.000000000 +0200
@@ -4,7 +4,7 @@
 
 name             R
 version          2.10.1
-revision        1
+revision         2
 categories       math science
 maintainers      epfl.ch:kjell.konis
 platforms        darwin
@@ -44,14 +44,6 @@
 
 universal_variant no
 
-platform darwin 9 {
-    patchfiles       patch-configure.diff
-}
-
-platform darwin 10 {
-    patchfiles       patch-configure.diff
-}
-
 variant gcc42 description {Build with gcc42} {
     configure.compiler macports-gcc-4.2
     depends_lib-append port:gcc42
@@ -62,7 +54,12 @@
     depends_lib-append port:gcc43
 }
 
-if {![variant_isset gcc42] && ![variant_isset gcc43]} {
+variant gcc44 description {Build with gcc44} {
+    configure.compiler macports-gcc-4.4
+    depends_lib-append port:gcc44
+}
+
+if {![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44]} {
     default_variants +gcc43
 }
 
@@ -71,6 +68,7 @@
 }
 
 configure.args   --mandir=\\\${prefix}/share/man \
+                 --enable-BLAS-shlib \
                  --enable-R-shlib \
                  --disable-nls \
                  --without-libintl-prefix \
@@ -88,50 +86,36 @@
 post-destroot {
   foreach r { "/bin/R" "/lib/R/bin/R" } {
     foreach dir { "R_HOME_DIR" "R_SHARE_DIR" "R_INCLUDE_DIR" "R_DOC_DIR" } {
-      reinplace "s|${dir}=${destroot}|${dir}=|" \
-        "${destroot}${prefix}${r}"
+      reinplace "s|${dir}=${destroot}|${dir}=|" "${destroot}${prefix}${r}"
     }
   }
 
-  foreach v { "rhome" "rincludedir"} {
+  foreach v { "rhome" "rincludedir" } {
     reinplace "s|${v}=${destroot}|${v}=|" "${destroot}${prefix}/lib/pkgconfig/libR.pc"
   }
-}
 
-platform darwin 8 {
-    post-destroot {
-	  foreach r { "/bin/R" "/lib/R/bin/R" } {
-	    foreach dir { "R_HOME_DIR" "R_SHARE_DIR" "R_INCLUDE_DIR" "R_DOC_DIR" } {
-	      reinplace "s|${dir}=${destroot}|${dir}=|" \
-	        "${destroot}${prefix}${r}"
-	    }
-	  }
-
-	  foreach v { "rhome" "rincludedir"} {
-	    reinplace "s|${v}=${destroot}|${v}=|" "${destroot}${prefix}/lib/pkgconfig/libR.pc"
-	  }
-
-        system "install_name_tool -id ${prefix}/lib/R/lib/libR.dylib \
-            ${destroot}${prefix}/lib/R/lib/libR.dylib"
-        system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
-            ${destroot}${prefix}/lib/R/lib/libR.dylib"
-
-        system "install_name_tool -id ${prefix}/lib/R/lib/libRblas.dylib \
-            ${destroot}${prefix}/lib/R/lib/libRblas.dylib"
-
-        system "install_name_tool -id ${prefix}/lib/R/lib/libRlapack.dylib \
-            ${destroot}${prefix}/lib/R/lib/libRlapack.dylib"
-        system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
-            ${destroot}${prefix}/lib/R/lib/libRlapack.dylib"
-        system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
-            ${destroot}${prefix}/lib/R/lib/libRlapack.dylib"
-
-        foreach so [ exec find ${destroot}${prefix}/lib/R -name "\*.so" ] {
-            regsub ":$" ${so} "" destroot_so_path
-            regsub ${destroot} ${destroot_so_path} "" so_path
-            system "install_name_tool -id ${so_path} ${destroot_so_path}"
-            system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
-                ${destroot_so_path}"
-        }
-    }
+  foreach dylib [ exec find ${destroot}${prefix}/lib/R/lib -name "\*.dylib" ] {
+    regsub ":$" ${dylib} "" destroot_dylib_path
+    regsub ${destroot} ${destroot_dylib_path} "" dylib_path
+    system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}"
+    system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
+      ${destroot_dylib_path}"
+    system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
+      ${destroot_dylib_path}"
+    system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/libRlapack.dylib \
+      ${destroot_dylib_path}"
+  }
+
+  foreach so [ exec find ${destroot}${prefix}/lib/R -name "\*.so" ] {
+    regsub ":$" ${so} "" destroot_so_path
+    regsub ${destroot} ${destroot_so_path} "" so_path
+    system "install_name_tool -id ${so_path} ${destroot_so_path}"
+    system "install_name_tool -change libR.dylib ${prefix}/lib/R/lib/libR.dylib \
+      ${destroot_so_path}"
+    system "install_name_tool -change libRblas.dylib ${prefix}/lib/R/lib/libRblas.dylib \
+      ${destroot_so_path}"
+    system "install_name_tool -change libRlapack.dylib ${prefix}/lib/R/lib/libRlapack.dylib \
+      ${destroot_so_path}"
+  }
 }
+
