# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 105825 2013-05-07 07:28:35Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-scikits-bvp_solver
version                 1.1

categories-append       science
platforms               darwin
license                 BSD

maintainers             macsforever2000 openmaintainer

description             bvp_solver is a Python package for solving two-point boundary value problems.

long_description        scikits.bvp_solver is a python package for solving two point boundary value \
                        problems which is based on a modified version of the BVP_SOLVER Fortran package.

homepage                http://packages.python.org/scikits.bvp_solver/
master_sites            http://pypi.python.org/packages/source/s/scikits.bvp_solver/

distname                scikits.bvp_solver-${version}

# md5 checksum comes from the source site
checksums               md5     894a566a3080ea6fe0e0b0c17fc628a7 \
                        rmd160  903e53a0b4bf40d864abbdb83dc5d008a3e1c874 \
                        sha256  3de71a39d97cdd61fea5693f7dd01b3820310d755f8e6669a3694b01eb787f1d

# Only tested on python 2.7.
python.versions         27

if {$subport != $name} {
	patchfiles			patch-setup_py.diff

    depends_lib-append  port:py${python.version}-numpy

	post-patch {
		set pyver [join [split ${python.version} {}] {.}]
		set pyfwk ${frameworks_dir}/Python.framework/Versions/

        reinplace -E "s|XXX|-L${pyfwk}${pyver}/lib -lpython${pyver} -Xlinker -dylib|g" \
					 ${worksrcpath}/setup.py
	}
    
    variant gcc47 conflicts gcc48 gcc49 description {Use the gcc47 compiler (enables fortran code)} {
        depends_lib-append  port:gcc47
        configure.compiler  macports-gcc-4.7
    }
    
    variant gcc48 conflicts gcc47 gcc49 description {Use the gcc48 compiler (enables fortran code)} {
        depends_lib-append  port:gcc48
        configure.compiler  macports-gcc-4.8
    }
    
    variant gcc49 conflicts gcc47 gcc48 description {Use the gcc49 compiler (enables fortran code)} {
        depends_lib-append  port:gcc49
        configure.compiler  macports-gcc-4.9
    }
    
    if {![variant_isset gcc48] && ![variant_isset gcc49]} {
        default_variants +gcc47
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     "bvp_solver-(\\d+(?:\\.\\d+)*)${extract.suffix}"
}
