--- /MacPorts/var/macports/sources/rsync.macports.org/release/tarballs/ports/math/R/Portfile	2014-11-30 16:30:15.000000000 -0800
+++ Portfile	2015-04-16 11:51:36.000000000 -0700
@@ -7,8 +7,8 @@
 name                        R
 
 set major 3
-set minor 1
-set point 2
+set minor 2
+set point 0
 
 #Remember to remove revision line when bumping version
 version                     ${major}.${minor}.${point}
@@ -32,14 +32,15 @@
 master_sites                http://cran.rstudio.com/src/base/R-3/ \
                             http://cran.r-project.org/src/base/R-3/
 
-checksums                   rmd160  b2aaa42daac1ae5d114995de514d211d78a4e0a6 \
-                            sha256  bcd150afcae0e02f6efb5f35a6ab72432be82e849ec52ce0bb89d8c342a8fa7a
+checksums                   rmd160  a67e255e77baf7db164ee8a869c03137a33a6571 \
+                            sha256  f5ae953f18ba6f3d55b46556bbbf73441350f9fd22625402b723a2b81ff64f35
 
 depends_build               port:pkgconfig
 
 depends_lib                 port:readline \
                             port:icu \
-                            port:libiconv
+                            port:libiconv \
+                            port:zlib
 
 universal_variant           no
 
@@ -51,29 +52,28 @@
 
 configure.pre_args          --prefix=${frameworks_dir}
 
-configure.args              --enable-R-framework \
+configure.args              --enable-memory-profiling \
                             --enable-R-shlib \
                             --enable-BLAS-shlib \
-                            --disable-openmp \
-                            --with-readline \
-                            --with-aqua \
                             --without-tcltk \
                             --without-cairo \
-                            --with-libpng \
-                            --without-jpeglib \
+                            --with-system-zlib \
+                            --without-internal-tzcode \
                             --without-recommended-packages \
-                            --with-ICU \
                             --without-x \
                             --with-included-gettext \
-                            --without-internal-tzcode
+                            --without-system-xz #bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
+
+if {${os.major} < 13} {
+    configure.args-append --disable-openmp
+}
 
 platform darwin 13 {
     configure.cflags-append -flax-vector-conversions
 }
 
-variant accelerate conflicts builtin_lapack description {build using the BLAS and Lapack in Apple's Accelerate framework} {
-    configure.args-append   --with-blas="-framework Accelerate" \
-                            --with-lapack="-framework Accelerate"
+variant accelerate conflicts atlas builtin_lapack description {build using the BLAS and Lapack in Apple's Accelerate framework} {
+    configure.args-append   --with-blas="-framework Accelerate" --with-lapack
 }
 
 variant atlas conflicts accelerate builtin_lapack description {build using the BLAS in the atlas port} {
@@ -82,7 +82,7 @@
     #See A.3.2 in R Installation and Administration for why atlas LAPACK not used
 }
 
-variant builtin_lapack conflicts accelerate description {build using reference BLAS and Lapack} {
+variant builtin_lapack conflicts accelerate atlas description {build using reference BLAS and Lapack} {
     configure.args-append   --without-blas --without-lapack
 }
 
@@ -92,7 +92,10 @@
                             path:lib/pkgconfig/glib-2.0.pc:glib2 \
                             port:freetype \
                             port:fontconfig \
-                            port:gettext 
+                            port:gettext \
+                            port:libpng \
+                            port:tiff \
+                            port:jpeg
     configure.args-delete   --without-cairo
     configure.args-append   --with-cairo
 }
@@ -173,8 +176,7 @@
                             port:xorg-libXt \
                             port:tiff \
                             port:jpeg \
-                            port:libpng \
-                            port:zlib
+                            port:libpng
     configure.args-delete   --without-x \
                             --without-jpeglib
     configure.args-append   --with-x \
@@ -191,7 +193,7 @@
 }
 
 if {![variant_isset accelerate] && ![variant_isset atlas] && ![variant_isset builtin_lapack]} {
-    default_variants-append +accelerate
+    default_variants-append +builtin_lapack
 }
 
 test.run                    yes
@@ -248,3 +250,6 @@
 livecheck.type      regex
 livecheck.url       [lindex ${master_sites} 0]
 livecheck.regex     >${name}-(\[0-9.\]+)${extract.suffix}<
+
+
+
