# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 87361 2011-11-18 08:19:37Z jmr@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-gsl
version                 0.9.5
categories              python science
platforms               darwin
maintainers             nomaintainer
description             Python interface to the GNU Scientific Library
long_description        Python interface to the GSL, the GNU Scientfic \
                        Library. Variants for the use of different \
                        array-objects supported by pygsl are provided.

homepage                http://pygsl.sourceforge.net/
master_sites            sourceforge:pygsl
distname                pygsl-${version}
checksums               md5 fca5cbda1380218a28f2ebdc15a224fb \
                        sha1 718064cd6c9d50cae5048c920ab7ab2324d27c88 \
                        rmd160 0b9d2654bc1cfb84649603b2680932c4ce47a849

python.versions         24 25 26 27

if {$subport != $name} {
    build.env-append        CPPFLAGS="-I${prefix}/include/gsl -I${python.include} ${configure.cppflags}"

    depends_build           port:swig-python
    depends_lib-append      port:gsl

    if {${python.version} < 27} {
        variant numarray conflicts numpy Numeric description "Use numarray as array-object" {
            if {${python.version} == 24} {
                depends_lib-append  port:py-numarray
            } else {
                depends_lib-append  port:py${python.version}-numarray
            }
            build.args              --array-object=numarray
        }
    }
    variant Numeric conflicts numpy description "Use Numeric as array-object" {
        depends_lib-append      port:py${python.version}-numeric
        build.args              --array-object=Numeric
    }
    variant numpy conflicts Numeric description "Use numpy as array-object" {
        depends_lib-append      port:py${python.version}-numpy
        build.args              --array-object=numpy
    }
    if {(![variant_isset numarray] || ![variant_exists numarray]) && ![variant_isset Numeric] } {
        default_variants        +numpy
    }

    post-destroot {
        xinstall -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${subport}
    }
}
