# -*- 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: Portfile 87932 2011-12-13 09:14:19Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0

name                mlt
epoch               3
version             0.7.6
categories          multimedia
maintainers         dennedy.org:dan
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    f23c8bddb9b1f406c3cfcd155e74f8d9d37b5120 \
                    rmd160  898256dfbbda158f51796a7d4468a6a54b9b246d

# 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

if {${configure.compiler} == "clang"} {
    configure.compiler llvm-gcc-4.2
}

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
    }
}

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 {
    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}
