# -*- 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 78725 2011-05-19 15:33:29Z rmstonecipher@macports.org $

PortSystem          1.0

name		        gst-plugins-bad
version		        0.10.22
description         A set of plug-ins for GStreamer that need more quality.
long_description    \
    GStreamer Bad Plug-ins is a set of plug-ins that aren't up to par compared \
    to the rest. They might be close to being good quality, but they're missing \
    something - be it a good code review, some documentation, a set of tests, a \
    real live maintainer, or some actual wide use.
license             GPL LGPL
maintainers         rmstonecipher openmaintainer
categories          gnome
platforms           darwin
homepage            http://gstreamer.freedesktop.org/modules/${name}.html
master_sites        http://gstreamer.freedesktop.org/src/${name}/
use_bzip2           yes

checksums           md5     9a2acee1f386f71247003d0d7090fb1c \
                    sha1    66f4b9c40eb2ea43f093802e673effabee600a9b \
                    rmd160  a3cf707a42d49b4285a57adaa07dc87591f18403

depends_lib port:gst-plugins-base \
            port:XviD \
            port:dirac \
            port:exempi \
            port:faac \
            port:faad2 \
            port:jasper \
            port:libdc1394 \
            port:libdca \
            port:libexif \
            port:libglade2 \
            port:libmms \
            port:libmodplug \
            port:libmpcdec \
            port:libmusicbrainz2 \
            port:libvpx \
            port:soundtouch \
            port:neon \
            port:schroedinger

#
# could depend on tons for multimedia stuff +variants
# the following ports are available but don't configure
# and/or build correctly
#
# port:mjpegtools (mpeg2enc mplex build fails) need to disable mpeg2enc mplex explicitly in case mjpegtools is installed
# path:lib/pkgconfig/sdl.pc:libsdl (builds but sdlvideosink is broken)
# port:slv2 (builds but lv2 plugin fails to load and slv2 is not universal) disable lv2 explicitly in case slv2 is installed
# port:swfdec (configure wants pkg-config swfdec-0.3, we have swfdec-0.8)
#

configure.args              --disable-apple_media \
                            --disable-silent-rules \
                            --disable-quicktime \
                            --disable-mpeg2enc \
                            --disable-mplex \
                            --disable-lv2 \
                            --disable-jack \
                            --enable-experimental \
                            --enable-static

#
# port:soundtouch (fails on autoreconf on darwin 8 & 9, see #27533) disable soundtouch on these platforms
#

if { ${os.major} < 10 } {
        depends_lib-delete port:soundtouch
        configure.args-append --disable-soundtouch
}
        
configure.cppflags-append   "-L${prefix}/lib"
configure.cflags-append     -funroll-loops -fstrict-aliasing
configure.env-append        "HAVE_CXX=yes"

patchfiles  modplug.patch

post-patch {
    reinplace "s|-flat_namespace -undefined suppress|-undefined define_a_way|g" \
        ${worksrcpath}/configure
    reinplace "s|libSoundTouch|soundtouch-1.0|g" \
        ${worksrcpath}/configure
}

variant no_x11 {
        configure.args-append --disable-examples
}

variant jack description {enable use of jack backend } {
    depends.lib-append      port:jack
    configure.args-delete   --disable-jack
}

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
