# $Id: Portfile,v 1.9 2006/06/30 04:08:09 ben Exp $
PortSystem		1.0
name			libsdl_sound
version			1.0.1
revision		3
categories		audio devel
maintainers		darwinports@opendarwin.org
description		handles decoding of several popular sound file formats
long_description	SDL_sound is a library that handles the decoding of \
					several popular sound file formats, such as .WAV and \
					.MP3. It is meant to make the programmer's sound \
					playback tasks simpler.
platforms		macosx
homepage		http://icculus.org/SDL_sound/
master_sites	http://icculus.org/SDL_sound/downloads/
distname		SDL_sound-${version}
checksums		md5 49e197ef7c8ab623d0640dc74be43160
depends_lib		bin:sdl-config:libsdl \
				bin:smpeg-config:smpeg \
				bin:libmikmod-config:libmikmod \
				lib:libvorbis.0:libvorbis

depends_build	bin:glibtoolize:libtool \
				bin:automake:automake \
				bin:autoconf:autoconf

patchfiles		patch-acinclude.m4

pre-configure {
	ui_info "Initial preparation...this can take awhile, so sit tight..."
	system "cd ${worksrcpath} && aclocal"
	system "cd ${worksrcpath} && glibtoolize --automake --copy --force"
	system "cd ${worksrcpath} && autoheader"
	system "cd ${worksrcpath} && automake --foreign --add-missing --copy"
	system "cd ${worksrcpath} && autoconf"
	ui_info "Ready to run ./configure ..."
}
configure.env	LDFLAGS=-L${prefix}/lib
configure.args	--disable-sdltest \
				--disable-smpegtest

post-destroot	{
	xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 0644 -W ${worksrcpath} CHANGELOG COPYING CREDITS README TODO \
		${destroot}${prefix}/share/doc/${name}
}

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

platform darwin 8 {
  if { ${xcodeversion} == "2.1"} {
     patchfiles patch-acinclude.m4.xcode21 patch-aclocal.m4.xcode21 patch-configure.xcode21
  }
}
