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

name            libtheora
epoch           1
version         1.2.0
revision        0
checksums       rmd160  cc16202316db077064aa2ae317663bed20d16ccb \
                sha256  ebdf77a8f5c0a8f7a9e42323844fa09502b34eb1d1fece7b5f54da41fe2122ec \
                size     1803124

categories      multimedia
license         BSD
maintainers     {@Dave-Allured noaa.gov:dave.allured} \
                openmaintainer
description     Xiph.org Foundation's open video codec

long_description \
    Theora is an open video codec being developed by the \
    Xiph.org Foundation as part of their Ogg project (It is \
    a project that aims to integrate On2's VP3 video codec, \
    Ogg Vorbis audio codec and Ogg multimedia container \
    formats into a multimedia solution that can compete \
    with MPEG-4 format).

homepage        https://www.theora.org/
master_sites    https://ftp.osuosl.org/pub/xiph/releases/theora/
use_xz          yes

depends_lib     port:libogg

configure.env   SDL_CONFIG=/usr/bin/false \
                HAVE_PDFLATEX=no          \
                HAVE_DOXYGEN=no           \
                HAVE_BIBTEX=no            \
                HAVE_TRANSFIG=no

configure.args  --disable-asm \
                --disable-examples \
                --disable-oggtest \
                --disable-vorbistest

minimum_xcodeversions   {8 2.5}

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS CHANGES COPYING LICENSE README.md ${destroot}${docdir}
}

test.run        yes
test.target     check

platform darwin powerpc {
    # http://trac.macports.org/ticket/13033
    # http://trac.macports.org/ticket/20141
    configure.args-delete   --disable-asm
    # https://trac.macports.org/ticket/64607
    configure.args-append   --build=powerpc-apple-darwin${os.major}
}

livecheck.type  regex
livecheck.url   [lindex ${master_sites} 0]
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
