# -*- 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            dirac
version         1.0.2
revision        4
categories      multimedia
license         {MPL-1.1 GPL-2 LGPL-2.1}
maintainers     nomaintainer
platforms       darwin
#homepage        http://diracvideo.org/
homepage        https://sourceforge.net/projects/dirac
master_sites    sourceforge:project/dirac/dirac-codec/Dirac-${version}

description \
    Dirac is a general-purpose video codec aimed at resolutions from \
    QCIF (176x144) to HDTV (1920x1080) progressive or interlaced.

long_description \
    Dirac is a general-purpose video codec aimed at resolutions from \
    QCIF (176x144) to HDTV (1920x1080) progressive or interlaced. It uses \
    wavelets, motion compensation and arithmetic coding and aims to be \
    competitive with other state of the art codecs.

checksums       md5     a57c2c5e58062d437d9ab13dffb28f0f \
                sha1    895aaad832a54b754e58f77c87d38c0c37752b0b \
                rmd160  0af65c4216230b5418667081cecb7bdcdc853d2e

patchfiles      patch-Makefile.am.diff  patch-doc-Makefile.am.diff nolibstdc++.patch

if { ![variant_isset tests] } {
    patchfiles-append patch-no_cppunit.diff
}

use_autoreconf  yes
autoreconf.args -fvi -I m4

test.run        yes

variant doc description {Build Dirac reference documentation} {
    patchfiles-delete patch-Makefile.am.diff
    depends_build-append \
                path:bin/doxygen:doxygen \
                path:bin/dot:graphviz \
                path:bin/latex:texlive
}

variant tests description {Build unit tests} {
    # see https://github.com/macports/macports-ports/commit/ff3d49ef9854c92efdbf46f8791cba6f0511d368#diff-78659008428062a5a45adf6f07052d03
    compiler.cxx_standard   2011
    configure.cxxflags-append \
        -std=c++11 \
        -Wno-c++11-narrowing

    depends_lib-append port:cppunit
}

livecheck.type  regex
livecheck.url   http://sourceforge.net/projects/dirac/files/dirac-codec
livecheck.regex "Dirac-(\\d+(?:\\.\\d+)*)"
