# -*- 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-gdal
python.rootname     GDAL
# keep version in sync with gdal; rebuilt after gdal update
version             3.2.1
revision            0

categories-append   gis
platforms           darwin
license             MIT
maintainers         {petr @petrrr} openmaintainer

description         GDAL: Geospatial Data Abstraction Library
long_description    This Python package and extensions are a number of tools for programming \
                    and manipulating the GDAL Geospatial Data Abstraction Library.

homepage            https://www.gdal.org

checksums           rmd160  5b7a2df1517cba4b4bd1a22164271fba6ccd8e25 \
                    sha256  41e928fbe6880a7b38124b8dff9efe82f3d4e1bc17f771fda46bf222289ab9a4 \
                    size    604248

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {
    compiler.cxx_standard   2011

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

    post-patch {
        reinplace "s|../../apps/|${prefix}/bin/|" ${worksrcpath}/setup.cfg
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.rst ${destroot}${docdir}
    }

    livecheck.type  none
}
