# -*- 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

PortSystem              1.0
PortGroup               python 1.0
PortGroup               compilers 1.0
PortGroup               deprecated 1.0

name                    py-scikits-bvp_solver
version                 1.1
revision                1

categories-append       science
platforms               darwin
license                 BSD

maintainers             nomaintainer

description             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                https://github.com/jsalvatier/scikits.bvp_solver
master_sites            pypi: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

python.add_archflags    no
universal_variant       no

deprecated.upstream_support no

if {${name} ne ${subport}} {
    compilers.choose    fc f90 f77
    compilers.setup     require_fortran

    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
    }

    livecheck.type      none
}
