# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.0
PortGroup           github 1.0
PortGroup           qt5 1.0
PortGroup           boost 1.0

github.setup        gerbilvis gerbil 5a7705fe1170f812a6cd0e79a1a853f4d8aec2cf
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             2020-05-06-5a7705f
revision            18
checksums           rmd160  9b3f9ac2589a4f3b2ae12db6b02fdcd924886ec4 \
                    sha256  1eb67522c0629a885f940ce333880982528c0ef23ee5a3b27aaddf9facf72d6f \
                    size    2301204

categories          science
license             GPL-3
maintainers         {cal @neverpanic} openmaintainer
description         Hyperspectral Image Visualization & Analysis Framework
long_description    \
    Gerbil is a generic framework for visualization and analysis of \
    multispectral and hyperspectral data that strives to both bring new \
    innovations in analysis capabilities and be of use in a wide range of \
    hyperspectral data applications.

homepage            http://gerbilvis.org/

depends_lib         path:lib/opencv4/libopencv_core.dylib:opencv4 \
                    port:gdal \
                    port:tbb

boost.version       1.71

cmake.out_of_source yes
configure.args-append \
                    -DOpenCV_DIR="${prefix}/libexec/opencv4/cmake" \
                    -DTBB_ROOT_DIR=${prefix}/libexec/tbb \
                    -DCMAKE_BUILD_TYPE=Release

# the gerbil makefiles do not provide an install target
destroot {
    # install binaries
    xinstall -m 755 "${build.dir}/bin/gerbil" "${destroot}${prefix}/bin/"
    xinstall -m 755 "${build.dir}/bin/qgerbil" "${destroot}${prefix}/bin/"

    # create directories for shared files
    xinstall -d -m 755 "${destroot}${prefix}/share/doc/${name}"

    # install shared files
    set sharefiles [list "AUTHORS" "LICENSE" "README.md"]
    foreach file $sharefiles {
        xinstall -m 644 "${worksrcpath}/${file}" "${destroot}${prefix}/share/doc/${name}/${file}"
    }
}
