# $Id: Portfile 61758 2009-12-21 03:00:08Z blb@macports.org $

PortSystem      1.0

name            libsdl_mixer
set my_name     SDL_mixer
version         1.2.11
categories      audio devel
platforms       macosx
maintainers     nomaintainer
description     Audio mixer library for SDL

long_description \
    A sample multi-channel audio mixer library. It supports any number of \
    simultaneously playing channels of 16 bit stereo audio, plus a single \
    channel of music.

homepage        http://www.libsdl.org/projects/${my_name}/
master_sites    ${homepage}release/
distname        ${my_name}-${version}

checksums       md5     65ada3d997fe85109191a5fb083f248c \
                sha1    ef5d45160babeb51eafa7e4019cec38324ee1a5d \
                rmd160  559355116a1c380edf71879da0dbcf5359f05476

depends_lib     path:lib/pkgconfig/sdl.pc:libsdl \
                port:smpeg \
                port:libvorbis \
                port:libogg

configure.args  --with-sdl-prefix=${prefix} \
                --disable-sdltest \
                --with-smpeg-prefix=${prefix} \
                --disable-smpegtest

post-patch {
    reinplace "s|`find_lib\\(.*\\.dylib\\)|${prefix}/lib/`find_lib\\1|g" ${worksrcpath}/configure
}

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} CHANGES COPYING README \
        ${destroot}${docdir}
}

variant mikmod description {Enable use of external libmikmod} {
    configure.args-append   --enable-music-libmikmod
    depends_lib-append      port:libmikmod
}

livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
