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

name                py-pyproj
version             1.9.5.1
revision            4
categories-append   devel
platforms           darwin
license             MIT

python.versions     27 34 35 36

maintainers         {stromnov @stromnov} openmaintainer

description         Python interfaces to PROJ.4 functions.
long_description    Pyrex wrapper to provide python interfaces to PROJ.4 \
                    (http://proj.maptools.org) functions.  Performs \
                    cartographic transformations and geodetic computations.

homepage            https://github.com/jswhit/pyproj
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}

distname            ${python.rootname}-${version}

checksums           rmd160  f1f3008fb452ac106310f8d4c73d7143f25690a3 \
                    sha256  53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8

if {${name} ne ${subport}} {
    variant proj4 description {Uses proj4 4.9} {
        depends_lib-append      port:proj4
        configure.env-append    PROJ_DIR=${prefix}/lib/proj49
        build.env-append        PROJ_DIR=${prefix}/lib/proj49
        destroot.env-append     PROJ_DIR=${prefix}/lib/proj49
    }
    if {![variant_isset proj4]} {
        depends_lib-append      port:proj
        configure.env-append    PROJ_DIR=${prefix}/lib/proj5
        build.env-append        PROJ_DIR=${prefix}/lib/proj5
        destroot.env-append     PROJ_DIR=${prefix}/lib/proj5
    }

    depends_build-append \
                        port:py${python.version}-setuptools

    post-destroot {
        xinstall -m 644 -W ${worksrcpath} \
            README.md PKG-INFO \
            ${destroot}${prefix}/share/doc/${subport}
    }

    livecheck.type      none
}