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

categories          science
license             MIT
maintainers         {bgilbert @bgilbert}

description         C library and tools for reading DICOM data sets
long_description    ${name} 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.

checksums           rmd160  0b058c1837f1928a9d4340142d92caa7f43e6de4 \
                    sha256  3b8c05ceb6bf667fed997f23b476dd32c3dc6380eee1998185c211d86a7b4918 \
                    size    5161096

meson.wrap_mode     nofallback

depends_build       port:uthash

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

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

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}
}

github.livecheck.regex  {([0-9.]+)}
