# -*- 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 119475 2014-04-26 21:32:31Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-rpy2
version             2.3.10
revision            0
categories-append   science
platforms           darwin
license             {MPL-1.1 LGPL-2.1+}

python.versions     25 26 27 33 34

maintainers         stromnov openmaintainer

description         A simple and efficient access to R from Python
long_description    rpy2 is a redesign and rewrite of rpy. It is providing a \
                    low-level interface to R, a proposed high-level interface, \
                    including wrappers to graphical libraries, as well as R-like \
                    structures and functions.

homepage            http://rpy.sourceforge.net/rpy2.html
master_sites        http://pypi.python.org/packages/source/r/rpy2/

distname            rpy2-${version}

checksums           rmd160  07f91ea96304bd7efe9dade2e13b8f47efa83efd \
                    sha256  728326d6d13107f7156f1f3d6ad3a7d6a19ae4d6801e56708e794196d5b0a509

if {${name} ne ${subport} && [lsearch {25 26} ${python.version}] != -1} {
    version             2.2.1
    revision            0
    distname            rpy2-${version}
    checksums           sha1    ff22f43c25fa299343bc6c6c8cbb3cb43212dfa0 \
                        rmd160  f83207190e40cb9c1f56f3727ef8b26319a55598
}

if {${name} ne ${subport}} {
    # To continue using your custom R installation instead of MacPorts' R,
    # you have to remove this dependency line and make sure that your R
    # is in MacPorts' binpath, see your macports.conf for details.
    depends_lib-append  port:R

    patchfiles-append   patch-setup.py.diff

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     {rpy2-(\d+(?:\.\d+)*)\.[tz]}
}
