# -*- 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 115619 2014-01-07 01:58:04Z larryv@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           github 1.0

github.setup        cvxopt cvxopt 1.1.6
name                py-cvxopt
categories-append   math
platforms           darwin
license             GPL-3+
maintainers         gmail.com:jjstickel openmaintainer

description         Python module for convex optimization
long_description    CVXOPT is a free software package for convex \
                    optimization based on the Python programming \
                    language. It can be used with the interactive \
                    Python interpreter, on the command line by \
                    executing Python scripts, or integrated in other \
                    software via Python extension modules. Its main \
                    purpose is to make the development of software for \
                    convex optimization applications straightforward \
                    by building on Python's extensive standard library \
                    and on the strengths of Python as a high-level \
                    programming language.
homepage            http://cvxopt.org/

checksums           rmd160  45556fb2c1620cf0c4d44c234f9c10d59fb1d81c \
                    sha256  831fa9f242f3f092523ecb4471325715453e8995260715da6da88e1dd0a204ac

python.versions     27 31 32 33

if {${subport} ne ${name}} {
    patchfiles      patch-setup.py.diff
    patch.pre_args  -p1
    post-patch {
        reinplace "s|__PREFIX__|${prefix}|g" setup.py
    }

    variant atlas description {Use ATLAS for BLAS and LAPACK} {
        depends_lib-append  port:atlas
        patchfiles-append   atlas.patch
    }

    variant gsl description {Build GSL module} {
        depends_lib-append  port:gsl
        post-patch {
            reinplace {s/BUILD_GSL = 0/BUILD_GSL = 1/} setup.py
        }
    }

    variant fftw description {Build FFTW module} {
        depends_lib-append  port:fftw-3
        post-patch {
            reinplace {s/BUILD_FFTW = 0/BUILD_FFTW = 1/} setup.py
        }
    }

    variant glpk description {Build GLPK module} {
        depends_lib-append  port:glpk
        post-patch {
            reinplace {s/BUILD_GLPK = 0/BUILD_GLPK = 1/} setup.py
        }
    }

    variant dsdp description {Build DSDP module} {
        depends_lib-append  port:DSDP
        post-patch {
            reinplace {s/BUILD_DSDP = 0/BUILD_DSDP = 1/} setup.py
        }
    }

    default_variants +gsl +glpk +fftw +dsdp

    livecheck.type 	none
}
