# -*- 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           github 1.0
PortGroup           meson 1.0
PortGroup           muniversal 1.1

github.setup        openslide openslide 4.0.1 v
revision            0
categories          graphics
license             LGPL-2.1
maintainers         {bgilbert @bgilbert}

description         A C library for reading virtual slides.

long_description    OpenSlide is a C library that provides a simple \
                    interface for reading whole-slide images, also known as \
                    virtual slides, which are high-resolution images used in \
                    digital pathology.  These images can occupy tens of \
                    gigabytes when uncompressed, and so cannot be easily \
                    read using standard tools or libraries, which are \
                    designed for images that can be comfortably uncompressed \
                    into RAM.  Whole-slide images are typically \
                    multi-resolution\; OpenSlide allows reading a small \
                    amount of image data at the resolution closest to a \
                    desired zoom level.  OpenSlide can read slides in the \
                    Aperio (.svs), \
                    ARGOS (.avs), \
                    DICOM (.dcm), \
                    Hamamatsu (.ndpi, .vms, or .vmu), \
                    Huron (.tif), \
                    Leica (.scn), \
                    MIRAX (.mrxs), \
                    Philips (.tiff), \
                    Sakura (.svslide), \
                    Trestle (.tif), \
                    Ventana (.bif or .tif), \
                    Zeiss (.czi), \
                    and generic tiled TIFF (.tif) formats.

homepage            https://openslide.org/
github.tarball_from releases
use_xz              yes

checksums           rmd160  68ccea763bd0979ad428772d6ec0f8de531e693d \
                    sha256  df82f6b264f98d11eeb80d85bbb10c7935fcd69c7abae1d610ce49b9a0437faf \
                    size    269592

depends_build       port:pkgconfig

depends_lib         port:libpng \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:tiff \
                    port:openjpeg \
                    port:libdicom \
                    port:libxml2 \
                    port:sqlite3 \
                    port:zlib \
                    port:zstd \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    path:lib/pkgconfig/glib-2.0.pc:glib2

meson.wrap_mode     nofallback

# dicom.h: error: wrong number of arguments specified for ‘deprecated’ attribute
compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2

test.run            yes

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        CHANGELOG.md \
        COPYING.LESSER \
        README.md \
        ${destroot}${docdir}
    file copy doc/html ${destroot}${docdir}
}
