# $Id: Portfile,v 1.16 2005/01/22 15:40:51 toby Exp $

PortSystem 1.0
name             libao
version          0.8.6
revision         1
categories       audio
maintainers      toby@opendarwin.org
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
master_sites     http://downloads.xiph.org/releases/ao/
checksums        md5 12e136a4c0995068ff134997c84421ed

patchfiles       patch-configure patch-src__plugins__macosx__ao_macosx.c
post-patch {
	reinplace "s|/etc/libao.conf|${prefix}/etc/libao.conf|" \
		${worksrcpath}/CHANGES \
		${worksrcpath}/doc/config.html \
		${worksrcpath}/libao.conf.5 \
		${worksrcpath}/src/ao_private.h \
}

configure.env    CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
configure.args   --disable-arts --disable-esd \
                 --disable-oss --disable-X

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

platform darwin 6 {
	depends_lib-append lib:libdl:dlcompat
}

variant darwin {
}

variant esd {
    depends_lib-append    lib:libesd.0:esound
    configure.args-delete --disable-esd
    configure.args-append --enable-esd
}
