# $Id: Portfile 39478 2008-08-21 19:46:13Z ryandesign@macports.org $

PortSystem      1.0

name            libsdl_mixer
set my_name     SDL_mixer
version         1.2.8
revision        1
categories      audio devel
platforms       macosx
maintainers     nomaintainer
use_parallel_build  yes
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 0b5b91015d0f3bd9597e094ba67c4d65 \
                sha1 7fa56d378f9ca53434f9470aeb2997ad84a348c6 \
                rmd160 f2188b907aa779bb81415ac6726ad7f496357b85

depends_lib     port:libsdl \
                port:smpeg \
                port:libvorbis \
                port:libogg

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

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.check regex
livecheck.url   ${homepage}
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
