# -*- 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           active_variants 1.1
PortGroup           cmake 1.1
PortGroup           github 1.0

github.setup        ubarsc kealib 1.6.2 kealib-
github.tarball_from releases
revision            0

categories          gis
license             MIT
maintainers         {vince @Veence}
description         KEAlib - An HDF5 Based Raster File Format
long_description    KEALib provides an implementation of the GDAL data model.  \
                    The format supports raster attribute tables, image         \
                    pyramids, meta-data and in-built statistics while also     \
                    handling very large files and compression throughout.

homepage            http://www.kealib.org

checksums           rmd160  13b358af0647b8115a95cad61aa1ebf09485db63 \
                    sha256  815b8d335b8d4b9048baf863cdd3959d12210f158a86f6a0d1954c7d39ce6db0 \
                    size    189932

depends_lib-append  port:hdf5

compiler.cxx_standard  2011
cmake.set_cxx_standard yes

configure.args-append \
                    -DHDF5_INCLUDE_DIR=${prefix}

# Find out path to "mpi.h" (if) used by HDF5
set mpl_include_dir ""
if {![catch {set result [active_variants hdf5 openmpi]}]} {
    if {$result} {
        set mpl_include_dir "-I${prefix}/include/openmpi-mp"
    }
}
if {![catch {set result [active_variants hdf5 mpich]}]} {
    if {$result} {
        set mpl_include_dir "-I${prefix}/include/mpich-mp"
    }
}
if {$mpl_include_dir ne ""} {
    configure.cxxflags-append ${mpl_include_dir}
}

notes "Enable the GDAL driver for KEA files by installing 'gdal-kea'"
