--- /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/science/root/Portfile	2011-09-28 20:30:22.000000000 +0100
+++ ./Portfile	2011-09-30 18:04:15.000000000 +0100
@@ -5,7 +5,7 @@
 
 name                root
 version             5.30.02
-revision            0
+revision            1
 categories          science
 maintainers         gmail.com:mattiafrancescomoro hep.phy.cam.ac.uk:jonesc
 license             LGPL-2.1+
@@ -31,11 +31,12 @@
                     port:xorg-libX11 \
                     port:xpm \
                     port:zlib \
-                    port:gsl \
                     path:bin/dot:graphviz \
                     port:jpeg \
                     port:libpng \
-                    port:tiff
+                    port:giflib \
+                    port:tiff \
+                    port:gmp
 
 patchfiles          patch-configure.diff
 
@@ -53,7 +54,6 @@
                     --with-cxx=${configure.cxx} \
                     --with-ld=${configure.cxx} \
                     --with-f77=${configure.f77}
-
     # the build type (32 or 64 bit) -must- be for first argument
     if {${build_arch} == "i386" || ${build_arch} == "ppc"} {
        configure.pre_args macosx --prefix=${prefix}
@@ -67,12 +67,11 @@
                     --testdir=${prefix}/share/root/test \
                     --tutdir=${prefix}/share/root/tutorials \
                     --etcdir=${prefix}/etc/root \
-                    --disable-builtin-afterimage \
                     --disable-builtin-freetype \
                     --disable-builtin-glew \
-                    --disable-builtin-ftgl \
                     --disable-builtin-pcre \
                     --disable-builtin-zlib \
+                    --disable-builtin-lzma \
                     --disable-fftw3 \
                     --disable-krb5 \
                     --disable-ldap \
@@ -86,8 +85,17 @@
                     --disable-ssl \
                     --disable-xml \
                     --disable-python \
+                    --disable-fitsio \
+                    --disable-gsl-shared \
+                    --disable-clarens \
+                    --disable-pgsql \
+                    --disable-dcache \
+                    --disable-chirp \
+                    --disable-hdfs \
+                    --disable-ruby \
                     --with-x11-libdir=${prefix}/lib \
-                    --with-xpm-libdir=${prefix}/lib
+                    --with-xpm-libdir=${prefix}/lib \
+                    --enable-builtin-ftgl
 
 pre-build {
     build.args      CC=${configure.cc} \
@@ -97,7 +105,7 @@
 
 universal_variant   no
 
-default_variants    +ssl +builtin_ftgl +roofit +xml +opengl
+default_variants    +ssl +roofit +xml +opengl +gsl
 
 variant fftw3 description {Builds port with fftw3 support} {
     configure.args-delete   --disable-fftw3
@@ -107,26 +115,39 @@
     depends_lib-append      port:fftw-3
 }
 
-# Build issues. Under discussion with ROOT team.
-# variant kerberos5 description {Builds port with kerberos5 support} {
-#     configure.args-delete   --disable-krb5
-#     configure.args-append   --enable-krb5 \
-#                             --with-krb5-incdir="${prefix}/include" \
-#                             --with-krb5-libdir="${prefix}/lib"
-#      depends_lib-append      port:kerberos5
-# }
+variant clarens description {Builds port with clarens support} {
+    configure.args-delete   --disable-clarens
+    configure.args-append   --enable-clarens
+    depends_lib-append      port:xmlrpc-c
+}
+
+variant gsl description {Builds port with gsl support} {
+    configure.args-delete   --disable-gsl-shared
+    configure.args-append   --enable-gsl-shared \
+                            --with-gsl-incdir="${prefix}/include" \
+                            --with-gsl-libdir="${prefix}/lib"
+    depends_lib-append      port:gsl
+}
+
+variant fitsio description {Builds port with fitsio support} {
+    configure.args-delete   --disable-fitsio
+    configure.args-append   --enable-fitsio \
+                            --with-cfitsio-incdir="${prefix}/include" \
+                            --with-cfitsio-libdir="${prefix}/lib"
+    depends_lib-append      port:cfitsio
+}
 
 variant odbc description {Builds port with odbc support} {
     configure.args-delete   --disable-odbc
-    configure.args-append   --enable-odbc\
+    configure.args-append   --enable-odbc \
                             --with-odbc-incdir="${prefix}/include" \
                             --with-odbc-libdir="${prefix}/lib"
-    depends_lib-append      port:unixODBC
+    depends_lib-append      port:libiodbc
 }
 
 variant ldap description {Builds port with ldap support} {
     configure.args-delete   --disable-ldap
-    configure.args-append   --enable-ldap\
+    configure.args-append   --enable-ldap \
                             --with-ldap-incdir="${prefix}/include" \
                             --with-ldap-libdir="${prefix}/lib"
     depends_lib-append      port:openldap
@@ -144,7 +165,7 @@
                             --with-opengl-libdir="${prefix}/lib" \
                             --with-glew-incdir="${prefix}/include" \
                             --with-glew-libdir="${prefix}/lib"
-    depends_lib-append      port:glew
+    depends_lib-append      port:glew port:mesa
 }
 
 variant python26 conflicts python31 python27 description {Builds port with python 2.6 support} {
@@ -195,17 +216,6 @@
     depends_lib-append      port:openssl
 }
 
-variant builtin_ftgl description {Builds port with builtin-ftgl support} {
-    configure.args-delete   --disable-builtin-ftgl
-    configure.args-append   --enable-builtin-ftgl
-}
-
-variant ftgl description {Builds port with ftgl support} {
-    configure.args-append   --with-ftgl-incdir="${prefix}/include" \
-                            --with-ftgl-libdir="${prefix}/lib"
-    depends_lib-append      port:ftgl
-}
-
 variant xml description {Builds port with xml support} {
     configure.args-delete   --disable-xml
     configure.args-append   --enable-xml \
@@ -264,12 +274,20 @@
 variant mysql description {Builds port with mysql support} {
     configure.args-delete   --disable-mysql
     configure.args-append   --enable-mysql \
-                            --with-mysql-incdir="${prefix}/include/" \
+                            --with-mysql-incdir="${prefix}/include" \
                             --with-mysql-libdir="${prefix}/lib"
     depends_lib-append      port:mysql5
 }
 
-variant pythia description {Pythia support for root} {
+variant pgsql description {Builds port with PostgreSQL support} {
+    configure.args-delete   --disable-pgsql
+    configure.args-append   --enable-pgsql \
+                            --with-pgsql-incdir="${prefix}/include/postgresql90" \
+                            --with-pgsql-libdir="${prefix}/lib/postgresql90"
+    depends_lib-append      port:libpqxx port:postgresql90
+}
+
+variant pythia description {Pythia 8 support for root} {
     configure.args-delete   --disable-pythia8
     configure.args-append   --enable-pythia8 \
                             --with-pythia8-incdir=${prefix}/include \
@@ -287,11 +305,30 @@
     depends_lib-append      port:gcc45
 }
 
+# Build issues
 #variant gcc46 conflicts gcc44 gcc45 description {Compile using MacPorts gcc 4.6} {
 #    configure.compiler      macports-gcc-4.6
 #    depends_lib-append      port:gcc46
 #}
 
+# Build issues. 
+# variant kerberos5 description {Builds port with kerberos5 support} {
+#     configure.args-delete   --disable-krb5
+#     configure.args-append   --enable-krb5 \
+#                             --with-krb5-incdir="${prefix}/include" \
+#                             --with-krb5-libdir="${prefix}/lib"
+#      depends_lib-append      port:kerberos5
+# }
+
+# Build issues.
+# variant ftgl description {Builds port with ftgl support} {
+#     configure.args-delete   --enable-builtin-ftgl
+#     configure.args-append   --disable-builtin-ftgl \
+#     configure.args-append   --with-ftgl-incdir="${prefix}/include" \
+#                             --with-ftgl-libdir="${prefix}/lib"
+#     depends_lib-append      port:ftgl
+# }
+
 livecheck.type              regex
 livecheck.url               [lindex ${master_sites} 0]
 livecheck.regex             ${name}_v(\[0-9a-z.\]+)\\.source
