# -*- 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               gitlab 1.0
PortGroup               cmake 1.1
PortGroup               compiler_blacklist_versions 1.0
PortGroup               legacysupport 1.1

gitlab.setup            AOMediaCodec SVT-AV1 2.1.1 v
name                    svt-av1
revision                0
categories              multimedia
license                 BSD
maintainers             {i0ntempest @i0ntempest} openmaintainer

description             Scalable Video Technology for AV1
long_description        The Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) is an \
                        AV1-compliant software encoder/decoder library. The work on the SVT-AV1 encoder \
                        targets the development of a production-quality AV1-encoder with performance \
                        levels applicable to a wide range of applications, from premium VOD to \
                        real-time and live encoding/transcoding. The SVT-AV1 decoder implementation \
                        targets future codec research activities.

checksums               rmd160  ab0be1bda0782c0f52f8341564a601ec233412ea \
                        sha256  ab6d95e66c9f8a1fdb70b7e67413d422803190b1ce20507df089c0937c4338c3 \
                        size    11772985

# error: unknown type name '__m256i'
compiler.blacklist-append \
                        *gcc-4.8* *gcc-4.9* {clang < 500}
compiler.cxx_standard   2011

# _posix_memalign
legacysupport.newest_darwin_requires_legacy \
                        9

if {${os.arch} ne "powerpc"} {
    depends_build-append \
                        port:yasm
}

patchfiles              patch-no-dispatch-on-old-OS.diff \
                        patch-fix-native.diff

post-destroot {
    ln -s SvtAv1EncApp ${destroot}${prefix}/bin/svtav1enc
    ln -s SvtAv1DecApp ${destroot}${prefix}/bin/svtav1dec
}

variant native description "Optimize for CPU" {
    configure.args-append \
                        -DNATIVE=ON
}

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