# -*- 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           qt4 1.0
name                mlt
epoch               3
version             0.9.6
revision            7
categories          multimedia
maintainers         dennedy.org:dan
license             GPL-2+
description         Open source multimedia framework - core libraries
long_description    MLT is an open source multimedia framework, designed and developed for \
                    television broadcasting. It provides a toolkit for broadcasters, video \
                    editors, media players, transcoders, web streamers and many more types of \
                    applications. The functionality of the system is provided via an assortment \
                    of ready to use tools, xml authoring components, and an extendible plug-in \
                    based API. \
                    \
                    This package contains the files necessary for running applications that use \
                    the MLT multimedia framework.
homepage            http://www.mltframework.org/
master_sites        sourceforge:project/mlt/mlt
platforms           darwin
checksums           rmd160  c678a40b0fa362043d2a867152702cd8375d7bc7 \
                    sha256  ab999992828a03dadbf62f6a131aada776cfd7afe63a94d994877fdba31a3000   
# frei0r-plugins is not universal
universal_variant   yes
depends_build-append port:git \
                    port:doxygen
depends_lib-append  port:atk \
                    path:lib/libavcodec.dylib:ffmpeg \
                    port:libdv \
                    port:libsamplerate \
                    port:libsdl \
                    port:libsdl_image \
                    port:libvorbis \
                    port:sox \
                    port:libxml2
configure.args      --enable-gpl \
                    --disable-jackrack \
                    --disable-mmx \
                    --disable-gtk2 \
                    --disable-dependency-tracking \
                    --disable-swfdec
platform darwin x86_64 {
    if {${build_arch} eq "x86_64"} {
        configure.args-delete --disable-mmx
    }
}

platform darwin {
     patch.pre_args  -p1
     patchfiles      cppflags.patch
}

configure.cflags-append     "-I${prefix}/include"
configure.ldflags-delete    "-L${prefix}/lib"
configure.ldflags-append    "-L${worksrcpath}/src/framework"
configure.ldflags-append    "-L${prefix}/lib"
if {[variant_isset universal]} {
build.env-append            CFLAGS="${configure.cflags} ${configure.universal_cflags}" CXXFLAGS="${configure.cxxflags} ${configure.universal_cxxflags}" LDFLAGS="${configure.ldflags} ${configure.universal_ldflags}"
} else {
build.env-append            CFLAGS="${configure.cflags}" LDFLAGS="${configure.ldflags}"
}
build.args-append           CC="${configure.cc}" CXX="${configure.cxx}" CPP="${configure.cpp}"
variant gtk2 description {include the gtk2 module (for additional image and text producers)} {
    configure.args-delete   --disable-gtk2
    depends_lib-append      port:gtk2
}
livecheck.type      regex
livecheck.url       http://sourceforge.net/projects/${name}/files/
livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
