Index: Portfile
===================================================================
--- Portfile	(revision 141375)
+++ Portfile	(working copy)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup compilers 1.0
 PortGroup active_variants 1.1
 
 name                        R
@@ -35,6 +36,9 @@
 checksums                   rmd160  0e8bf2ecca48f0f2433f6b07f422b7730a76fbb4 \
                             sha256  9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d
 
+compilers.choose            fc f77
+compilers.setup             require_fortran
+
 depends_build               port:pkgconfig
 
 depends_lib                 port:readline \
@@ -50,6 +54,19 @@
     reinplace "s|R_HOME|\"${resources}\"|" "${worksrcpath}/src/unix/Rscript.c"
 }
 
+# Note: gcc cannot be used for the C compiler. It will give:
+#:info:build In file included from /usr/include/dispatch/dispatch.h:51:0,
+#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
+#:info:build                  from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
+#:info:build                  from langprefs.c:30:
+#:info:build /usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
+#:info:build  typedef void (^dispatch_block_t)(void);
+#:info:build                ^
+#:info:build /usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
+#:info:build    dispatch_block_t notification_block);
+#:info:build    ^
+# However, use of compiler.blacklist *gcc* would remove the GCC Fortran compilers too.
+
 configure.pre_args          --prefix=${frameworks_dir}
 
 configure.args              --enable-memory-profiling \
@@ -62,7 +79,8 @@
                             --without-recommended-packages \
                             --without-x \
                             --with-included-gettext \
-                            --without-system-xz #bug introduced in R-3.2.0, doesn't link to system copy, put port:xz back too
+                            --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
@@ -104,50 +122,6 @@
     configure.optflags-append -g
 }
 
-set gcc_versions {4.5 4.6 4.7 4.8 4.9}
-set default_fortran_variant +gfortran48
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    set variant_line {variant gfortran${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}"}
-
-    foreach over ${gcc_versions} {
-        if {${ver} == ${over}} {
-            continue
-        }
-
-        set over_no_dot [join [split ${over} "."] ""]
-        append variant_line " conflicts gfortran${over_no_dot}"
-    }
-    append variant_line { {}}
-
-    eval $variant_line
-
-    if {[variant_isset gfortran${ver_no_dot}]} {
-        if {${default_fortran_variant} != "+gfortran${ver_no_dot}"} {
-            set default_fortran_variant ""
-        }
-    }
-}
-
-if {${default_fortran_variant} != ""} {
-    default_variants-append "${default_fortran_variant}"
-}
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    if {[variant_isset gfortran${ver_no_dot}]} {
-        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
-        depends_build-append port:gcc${ver_no_dot}
-
-        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
-        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
-        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
-    }
-}
-
 variant recommended description {install recommended R packages} {
     configure.args-delete   --without-recommended-packages
     configure.args-append   --with-recommended-packages
@@ -158,7 +132,7 @@
                             port:tk \
                             port:xorg-libXScrnSaver \
                             port:xorg-libXext
-    require_active_variants path:lib/pkgconfig/tk.pc:tk x11
+    require_active_variants tk x11
     configure.args-delete   --without-tcltk
     configure.args-append   --with-tcltk \
                             --with-tcl-config=${prefix}/lib/tclConfig.sh \
