# $Id: Portfile,v 1.16 2006/03/08 20:31:58 markd Exp $

PortSystem 1.0
name		mpg123
version		pre0.59s
revision	1
categories	audio
maintainers	darwinports@opendarwin.org
description	fast mp3 player for linux and unix systems
long_description	\
	Mpg123 is a fast, free and portable MPEG audio player for Unix. It \
	supports MPEG 1.0/2.0 layers 1, 2 and 3. For full CD quality \
	playback (44 kHz, 16 bit, stereo) a Pentium, SPARCstation10, DEC \
	Alpha or similar CPU is required. Mono and/or reduced quality \
	playback (22 kHz or 11 kHz) is even possible on 486 CPUs. \
	\
	This version uses EsounD on a pure Darwin install and CoreAudio \
	on Mac OS X.

homepage	http://www.mpg123.de/
platforms	darwin
master_sites	http://www.mpg123.de/mpg123/
checksums	md5 a63675b0ea7990d4a7d7e7e14f23a3e4
worksrcdir	${name}
depends_lib	lib:libaudiofile.0:audiofile
post-patch {
	reinplace "s|PREFIX=/usr/local|PREFIX=${prefix}|g" "${worksrcpath}/Makefile"	
}
configure	{}
build.args	LDFLAGS=-L${prefix}/lib \
	CPPFLAGS=-I${prefix}/include
destroot.destdir	PREFIX=${destroot}/${prefix}

variant puredarwin { }

variant darwin {
	if { ! [variant_isset puredarwin] } {
		depends_lib-append \
				lib:/Library/Frameworks/CoreAudio.framework:XXX
		patchfiles	patch-audio_macosx.diff patch-makefile.diff
		build.target	macosx
	} else {
	       depends_lib-append lib:libesd.0:esound
	       patchfiles	patch-Makefile
	       build.target	darwin-esd
	}
}
