--- science/root/Portfile-original	2014-03-15 17:18:32.000000000 +0000
+++ science/root/Portfile	2014-03-15 19:48:46.000000000 +0000
@@ -4,7 +4,7 @@
 PortSystem          1.0
 
 name                root
-version             5.34.17
+version             5.34.18
 
 categories          science
 maintainers         gmail.com:mattiafrancescomoro hep.phy.cam.ac.uk:jonesc
@@ -19,8 +19,8 @@
 master_sites        http://root.cern.ch/download/ \
                     ftp://root.cern.ch/root/
 
-checksums           rmd160  0770aeb370699162c0f02c561060ee5388dd5ddb \
-                    sha256  8e7e13d41e13b6837a3bc784f86e491bed2ee37c157a3be8c74ead9b33c2be8a
+checksums           rmd160  2fbaff8f831611779b42480fcb86cbde34ef72bd \
+                    sha256  9196dce7d76b31e5bcabd985bd31bc4d9b7c8c4d0c7ce84f730efa4ef82a3567
 
 worksrcdir          root
 
@@ -389,8 +389,8 @@
 variant cocoa conflicts x11 description {Enables native OSX graphical backend} {
     # Force a compatible clang compiler
     PortGroup compiler_blacklist_versions 1.0
-    compiler.blacklist-append {clang < 425} *gcc* macports-clang-3.3 macports-clang-2.9 macports-clang-3.0
-    compiler.fallback-append macports-clang-3.2 macports-clang-3.1
+    compiler.blacklist-append {clang < 425} *gcc* macports-clang-3.2 macports-clang-3.1 macports-clang-3.0 macports-clang-2.9
+    compiler.fallback-append macports-clang-3.4 macports-clang-3.3 
     # Enable cocoa support in configure
     configure.args-delete --disable-cocoa
     configure.args-append --enable-cocoa
@@ -410,34 +410,44 @@
     default_variants-append ${default_gui_variant}
 }
 
-variant clang31 conflicts clang32 clang33 description {Compile using MacPorts clang 3.1} {
-    configure.compiler      macports-clang-3.1
-}
-if {[string match macports-clang-3.1 ${configure.compiler}]} {
-    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.1"
-    depends_run-append      port:clang-3.1
-}
+# ========================================================================================
+# Setup various clang variants, to provide alternative C++ compilers that support cocoa
+# ========================================================================================
 
-variant clang32 conflicts clang31 clang33 description {Compile using MacPorts clang 3.2} {
-    configure.compiler      macports-clang-3.2
-}
-if {[string match macports-clang-3.2 ${configure.compiler}]} {
-    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.2"
-    depends_run-append      port:clang-3.2
-}
+# List of possible clang versions that work
+set clang_versions { 3.3 3.4 3.5 }
 
-variant clang33 conflicts clang31 clang32 description {Compile using MacPorts clang 3.3} {
-    configure.compiler      macports-clang-3.3
+# Define the available variants
+foreach ver ${clang_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
+    set variant_line {variant clang${ver_no_dot} description "Compile using MacPorts clang ${ver}"}
+    foreach over ${clang_versions} {
+        if { ${ver} == ${over} } { continue }
+        set over_no_dot [join [split ${over} "."] ""]
+        append variant_line " conflicts clang${over_no_dot}"
+    }
+    append variant_line { { } }
+    eval $variant_line
 }
-if {[string match macports-clang-3.3 ${configure.compiler}]} {
-    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-3.3"
-    depends_run-append      port:clang-3.3
+
+# Is a variant active ?
+set active_clang_variant ""
+foreach ver ${clang_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
+    if {[variant_isset clang${ver_no_dot}]} {
+        set active_clang_variant ${ver}
+    }
 }
 
-if {[variant_isset qt_mac]} {
-    PortGroup qt4 1.0
+# If so, set it up.
+if { ${active_clang_variant} != "" } {
+    configure.compiler      macports-clang-${active_clang_variant}
+    configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config-mp-"${active_clang_variant}
+    depends_run-append      port:clang-${active_clang_variant}
 }
 
+# ========================================================================================
+
 variant qt_mac description {Build with Qt support via Mac UI} {
     post-patch {
         # fix where "qglobal.h" is found in all files that use or reference it
@@ -469,6 +479,10 @@
     }
 }
 
+if {[variant_isset qt_mac]} {
+    PortGroup qt4 1.0
+}
+
 # ========================================================================================
 # Following is for fortran support
 # Might eventually move to a portgroup, or similar, so could be simplified.
