--- Portfile.orig	2014-02-17 14:54:22.000000000 +0100
+++ Portfile	2014-02-17 16:15:42.000000000 +0100
@@ -1,11 +1,10 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# $Id: Portfile 110143 2013-08-27 15:39:45Z jeremyhu@macports.org $
 
 PortSystem          1.0
 PortGroup           github 1.0
 
-github.setup        tschoonj xraylib 2.16.0 xraylib-
-revision            2
+github.setup        tschoonj xraylib 3.0.0 xraylib-
+revision            0
 categories          science
 platforms           darwin
 license             BSD
@@ -19,37 +18,61 @@
                     line energies, edge energies, fluorescence yields, \
                     scattering factors, refractive indices, Compton profiles \
                     etc. Bindings exist for Perl, Python, Java, Fortran, IDL, \
-                    Lua and .NET.
+                    Lua, Ruby, PHP and .NET.
 
 master_sites        http://lvserver.ugent.be/xraylib/ \
                     http://xraylib.s3.amazonaws.com/
 
-checksums           rmd160  3b9a0db5fe2ae285cd364478c9e8c3d76e855069 \
-                    sha256 91ccbd25338c00027d58ee13239375926a0e106d9b883d1c927e846e035e276c 
+checksums           rmd160 6c8c82c0afe3664adcd044a4371229a76bad5bf9 \
+                    sha256 0cc506e15f2f3563384dcb97cb4f9399b13d90f074b54c8d25cd59b7804d8636
 
-patchfiles          configure.ac.diff \
-                    python_xrlsetup.py.in.diff \
-                    xraylib.i.diff
-
-patch.pre_args      -p1
 
 configure.args      --disable-idl \
                     --disable-fortran2003 \
                     --disable-perl \
                     --disable-python \
                     --disable-java \
-                    --disable-lua
+                    --disable-lua \
+                    --disable-ruby
 
 # to be fixed in later versions of xraylib...
 use_parallel_build  no
 configure.ccache    no
 
-use_autoreconf      yes
 
-variant perl description {Perl bindings} {
-    configure.args-append --enable-perl
+variant perl510 description {Perl5.10 bindings} conflicts perl512 perl514 perl516 perl518 { 
+    configure.args-append --enable-perl --enable-perl-integration PERL=${prefix}/bin/perl5.10
+    configure.args-delete --disable-perl
+    depends_build-append port:swig-perl
+    depends_lib-append port:perl5.10
+}
+
+variant perl512 description {Perl5.12 bindings} conflicts perl510 perl514 perl516 perl518 { 
+    configure.args-append --enable-perl --enable-perl-integration PERL=${prefix}/bin/perl5.12
+    configure.args-delete --disable-perl
+    depends_build-append port:swig-perl
+    depends_lib-append port:perl5.12
+}
+
+variant perl514 description {Perl5.14 bindings} conflicts perl510 perl512 perl516 perl518 { 
+    configure.args-append --enable-perl --enable-perl-integration PERL=${prefix}/bin/perl5.14
     configure.args-delete --disable-perl
     depends_build-append port:swig-perl
+    depends_lib-append port:perl5.14
+}
+
+variant perl516 description {Perl5.16 bindings} conflicts perl510 perl512 perl514 perl518 { 
+    configure.args-append --enable-perl --enable-perl-integration PERL=${prefix}/bin/perl5.16
+    configure.args-delete --disable-perl
+    depends_build-append port:swig-perl
+    depends_lib-append port:perl5.16
+}
+
+variant perl518 description {Perl5.18 bindings} conflicts perl510 perl512 perl514 perl516 { 
+    configure.args-append --enable-perl --enable-perl-integration PERL=${prefix}/bin/perl5.18
+    configure.args-delete --disable-perl
+    depends_build-append port:swig-perl
+    depends_lib-append port:perl5.18
 }
 
 variant python26 description {Python2.6 bindings} conflicts python27 python31 python32 python33 {
@@ -87,6 +110,34 @@
     depends_lib-append port:python33
 }
 
+variant ruby18 description {Ruby1.8.7 bindings} conflicts ruby19 ruby20 ruby21 {
+    configure.args-append --enable-ruby --enable-ruby-integration RUBY=${prefix}/bin/ruby1.8
+    configure.args-delete --disable-ruby
+    depends_build-append port:swig-ruby
+    depends_lib-append port:ruby
+}
+
+variant ruby19 description {Ruby1.9 bindings} conflicts ruby18 ruby20 ruby21 {
+    configure.args-append --enable-ruby --enable-ruby-integration RUBY=${prefix}/bin/ruby1.9
+    configure.args-delete --disable-ruby
+    depends_build-append port:swig-ruby
+    depends_lib-append port:ruby19
+}
+
+variant ruby20 description {Ruby2.0 bindings} conflicts ruby18 ruby19 ruby21 {
+    configure.args-append --enable-ruby --enable-ruby-integration RUBY=${prefix}/bin/ruby2.0
+    configure.args-delete --disable-ruby
+    depends_build-append port:swig-ruby
+    depends_lib-append port:ruby20
+}
+
+variant ruby21 description {Ruby2.1 bindings} conflicts ruby18 ruby19 ruby20 {
+    configure.args-append --enable-ruby --enable-ruby-integration RUBY=${prefix}/bin/ruby2.1
+    configure.args-delete --disable-ruby
+    depends_build-append port:swig-ruby
+    depends_lib-append port:ruby21
+}
+
 variant java description {Java bindings} {
     configure.args-append --enable-java
     configure.args-delete --disable-java
