--- /MacPorts/var/macports/sources/rsync.macports.org/release/ports/math/R/Portfile	2010-03-15 17:31:33.000000000 +0100
+++ Portfile	2010-04-22 11:18:16.000000000 +0200
@@ -3,8 +3,7 @@
 PortSystem 1.0
 
 name             R
-version          2.10.1
-revision        1
+version          2.11.0
 categories       math science
 maintainers      epfl.ch:kjell.konis
 platforms        darwin
@@ -25,9 +24,9 @@
                  http://cran.hu.r-project.org/src/base/R-2/ \
                  http://cran.r-project.org/src/base/R-2/
 
-checksums        md5     75f8b7e875b846ea96a4c6cc0abc00a4 \
-                 sha1    f5b1969fde3642c233f5198e44a7bf17a7b85ab6 \
-                 rmd160  7acf060192f205da4731d0ea3c2cc318b65b7e91
+checksums        md5     c6c1e866299f533617750889c729bfb3 \
+                 sha1    86af359879afaf18bf0cd9ca36f2957d7b146ba3 \
+                 rmd160  358d5ba19bd534e9f5be56f517bd217c235599dc
 
 depends_lib      port:gettext \
                  port:icu \
@@ -44,14 +43,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,15 +53,21 @@
     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
 }
 
 post-extract {
-  reinplace "s|R_HOME|\"${prefix}/lib/R\"|" ${worksrcpath}/src/unix/Rscript.c
+  reinplace "s|R_HOME|\"${prefix}/lib/R\"|" "${worksrcpath}/src/unix/Rscript.c"
 }
 
 configure.args   --mandir=\\\${prefix}/share/man \
+                 --enable-BLAS-shlib \
                  --enable-R-shlib \
                  --disable-nls \
                  --without-libintl-prefix \
@@ -88,50 +85,39 @@
 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}"
+  }
+
+  reinplace "s|-dylib_file libRblas\.dylib:\$\(R_HOME\)/lib\$\(R_ARCH\)/libRblas\.dylib| |" \
+            "${destroot}${prefix}/lib/R/etc/Makeconf"
 }
+
