# -*- 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

name                libraw
version             0.20.0
revision            0

description         Library for RAW image manipulation
long_description    A library for reading RAW files obtained from digital photo \
                    cameras (CRW/CR2, NEF, RAF, DNG, and others).

categories          graphics
platforms           darwin
license             {LGPL-2.1 CDDL}
maintainers         nomaintainer

homepage            https://www.libraw.org
master_sites        ${homepage}/data/
distname            LibRaw-${version}

checksums           rmd160  ef4c7ee87f133efd87ec9e0c770841588cc19e7a \
                    sha256  1f0a383da2ce9f409087facd28261decbf6be72cc90c78cd003b0766e4d694a3 \
                    size    1431412

depends_build       port:pkgconfig

depends_lib         port:jasper \
                    port:jpeg \
                    port:lcms2

# uses std::move which is c++11
compiler.cxx_standard 2011

# disable openmp as it is not consistently applicable in MacPorts at present
configure.args-append --disable-openmp

# don't hardcode a link against libstc++
patchfiles-append   patch-libraw-no-libstdcxx.diff

post-destroot {
    set htmlDir ${destroot}${prefix}/share/doc/${name}/html
    xinstall -d -m 0755 ${htmlDir}
    xinstall -m 644 {*}[glob -directory ${worksrcpath}/doc/ *.html] ${htmlDir}
}

livecheck.type      regex
livecheck.url       ${homepage}/download/
livecheck.regex     "LibRaw-(\\d+(?:\\.\\d+)*)${extract.suffix}"
