# -*- 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.3.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  d63aa27c2f39310e683714152a1294eef6b691e2 \
                    sha256  75f1167f5153c659cdd58f2b432d2592bf0477abe0087e195bc621b5594ef10a \
                    size    5336504

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.]+)}
