# -*- 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
# $Id$

PortSystem          1.0
PortGroup           qt4 1.0

name                mlt
epoch               3
version             0.8.8
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           sha1    519dafb7d28f2e8cb8c9224696638f4256755be2 \
                    rmd160  df4ee8a938cc972b5adb1adf7aa9f595906bf737

# frei0r-plugins is not universal
universal_variant   no

depends_build-append port:git-core \
                    port:doxygen

depends_lib-append  port:atk \
                    port:frei0r-plugins \
                    path:lib/libavcodec.dylib:ffmpeg \
                    port:gtk2 \
                    port:libdv \
                    port:libsamplerate \
                    path:lib/pkgconfig/sdl.pc:libsdl \
                    port:libvorbis \
                    port:sox

configure.args      --enable-gpl \
                    --qimage-libdir=${qt_libs_dir} \
                    --qimage-includedir=${qt_includes_dir}/Qt \
                    --disable-jackrack \
                    --disable-mmx

platform darwin 10 {
    if { ${build_arch} == "x86_64" } {
        configure.args-delete --disable-mmx
    }
}

platform darwin {
    patch.pre_args  -p1
    patchfiles      patch-src-modules-qimage-configure.diff
}

configure.cflags-append     "-I${prefix}/include"
configure.cflags-append     "-I${qt_includes_dir}"
configure.ldflags-delete    "-L${prefix}/lib"
configure.ldflags-append    "-L${worksrcpath}/src/framework"
configure.ldflags-append    "-L${prefix}/lib"
build.env-append            CFLAGS="${configure.cflags}" LDFLAGS="${configure.ldflags}"
build.args-append           CC="${configure.cc}" CXX="${configure.cxx}" CPP="${configure.cpp}"

variant no_x11 description {exclude the gtk2 module to prevent pulling in X11 dependencies} {
    configure.args-append   --disable-gtk2
    depends_lib-delete      port:gtk2
}

livecheck.type      regex
livecheck.url       http://sourceforge.net/projects/${name}/files/
livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}