# -*- 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
github.setup        ImagingDataCommons libdicom 1.1.0 v
revision            0
github.tarball_from releases
use_xz              yes

PortGroup           meson 1.0
meson.wrap_mode     nofallback

categories          science
platforms           darwin
license             MIT
maintainers         {bgilbert @bgilbert}

description         C library and tools for reading DICOM data sets
long_description    libdicom is a C library and a set of tools for reading \
                    files that follow the DICOM medical imaging standard. \
                    It allows random access to individual frame items of \
                    Pixel Data elements, permitting efficient processing of \
                    large DICOM images.
homepage            https://github.com/ImagingDataCommons/libdicom

checksums           rmd160  02e713211232bada662e496bdc6327bda123c552 \
                    sha256  058bfaa7653c60a70798e021001d765e3f91ca4df5a8824b7604eaa57376449b \
                    size    2958208

depends_build       port:uthash

configure.args-append       -Dtests=false
configure.cppflags-append   -I${prefix}/include/uthash

variant tests description {Enable tests} {
    depends_build-append    port:check \
                            port:pkgconfig
    configure.args-delete   -Dtests=false
}

pre-test {
    if {![variant_isset tests]} {
        ui_error "'tests' variant must be activated to enable test support"
        error "Please enable the 'tests' variant and try again"
    }
}

test.run            yes
test.cmd            meson

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    file mkdir ${destroot}${docdir}
    file copy ${worksrcpath}/README.md ${destroot}${docdir}
    file copy ${worksrcpath}/doc/html ${destroot}${docdir}
}
