# $Id: Portfile 84597 2011-09-28 19:24:05Z dports@macports.org $

PortSystem 1.0

name             libao
version          1.1.0
categories       audio
maintainers      nomaintainer
description      A Cross-platform Audio Library
long_description \
    libao is a way to easily add cross-platform audio output to your \
    program. Output devices are implemented as dynamic plugins, and \
    support for OSS, ESD, ALSA, aRTs, Solaris, and Irix outputs are \
    currently supported.
homepage         http://www.xiph.org/ao/
platforms        darwin
license          GPL-2+
master_sites     http://downloads.xiph.org/releases/ao/

checksums        sha1    9301bc4886f170c7122ab62677fb71cf001c04fd \
                 rmd160  374078af926bb0744fb2301e128a1c5276fdf4ee

post-patch {
	reinplace "s|/etc/libao.conf|${prefix}/etc/libao.conf|" \
		${worksrcpath}/CHANGES \
		${worksrcpath}/doc/config.html \
		${worksrcpath}/libao.conf.5 \
		${worksrcpath}/include/ao/ao_private.h \
}

configure.args   --disable-arts --disable-esd \
                 --disable-oss --disable-X

platform darwin {
    post-destroot {
        system "echo default_driver=macosx >> ${destroot}${prefix}/etc/libao.conf"
    }
}

variant esd description {Enable Enlightened Sound Daemon support} {
    depends_lib-append    port:esound
    configure.args-delete --disable-esd
    configure.args-append --enable-esd
}

livecheck.type   regex
livecheck.url    ${master_sites}?C=M&O=D
livecheck.regex  ${name}-(\\d+(?:\\.\\d+)*)
