# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           conflicts_build 1.0
PortGroup           github 1.0

github.setup        FFMS ffms2 5.0
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            2
categories          multimedia
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             GPL-2

description         An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
long_description    FFmpegSource (usually known as FFMS or FFMS2) is a cross-platform wrapper library around FFmpeg. \
                    It gives you an easy, convenient way to say "open and decompress this media file for me, I don't \
                    care how you do it" and get frame- and sample-accurate access (usually), without having to bother \
                    with the sometimes less than straightforward and less than perfectly documented FFmpeg API.

checksums           rmd160  f18dbf0bddb1e77534dde194e939662a4c155e80 \
                    sha256  ac13adae3a41d8d25b917423068c4a4e234031f4ee53dccdb10f55f4fa489973 \
                    size    168012

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

set ffmpeg_ver      7
depends_lib-append  port:ffmpeg${ffmpeg_ver} \
                    port:zlib

# cc1plus: error: unrecognized command line option "-std=c++11"
compiler.cxx_standard \
                    2011

post-extract {
    file mkdir ${worksrcpath}/src/config
}

use_autoreconf      yes

configure.pkg_config_path-prepend \
                    ${prefix}/libexec/ffmpeg${ffmpeg_ver}/lib/pkgconfig

# Build process links old ffmpeg if installed unless this is present
configure.ldflags-prepend \
                    -L${prefix}/libexec/ffmpeg${ffmpeg_ver}/lib

configure.args-append \
                    --disable-debug \
                    --disable-dependency-tracking \
                    --disable-silent-rules
