# $Id: Portfile,v 1.30 2005/08/03 00:25:19 ben Exp $

PortSystem 1.0
name		arts
version		1.1.2
revision	5
categories	audio
maintainers	darwinports@opendarwin.org
description	analog realtime synthesizer

long_description aRts is a framework for developing modular multimedia applications. The \
sound server, artsd, allows multiple applications to cooperatively process \
and output sound and music. aRts is designed to provide its filter and \
synthesis capabilities to other applications using the multimedia \
communication protocol (MCOP). aRts is also capable of modular realtime \
synthesis. It can create sounds & music (realtime midi synthesis) using \
small modules like oscillators for creating waveforms, various filters, \
mixers, faders, etc.

platforms	darwin
master_sites	\
		kde:Attic/3.1.2/src \
		http://ranger.befunk.com/fink/:admin \
		http://ranger.befunk.com/darwin/:darwin
patch_sites	http://ranger.befunk.com/fink/
extract.suffix	.tar.bz2
use_bzip2	yes
distname	arts-${version}
distfiles	${distname}.tar.bz2 kde-admindir-20030601.tar.bz2:admin detect-autoconf.tar.bz2:darwin

depends_lib	lib:libaudiofile.0:audiofile lib:libesd:esound lib:libglib.2:glib2 \
		lib:libiconv:libiconv lib:libintl.3:gettext lib:libmad:libmad \
		lib:libogg:libogg lib:libpng.3:libpng lib:libqt-mt.3.1:qt3 \
		lib:libqui:qt3 lib:libvorbis.0:libvorbis lib:libX11.6:XFree86
depends_build	bin:pkg-config:pkgconfig

checksums	arts-${version}.tar.bz2 md5 5d5a1858f8dcf0d88600291899dff75b \
		kde-admindir-20030601.tar.bz2 md5 6135f81de4b1561942be8fd31ae21297 \
		detect-autoconf.tar.bz2 md5 1f511627496be40174169dbab4d6d78a

set env(PATH) "/usr/X11R6/bin:$env(PATH):${prefix}/bin"

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

platform darwin 7 {
		depends_lib-append	lib:libpoll:poll-emulator
}

platform darwin 8 {
		depends_lib-append	lib:libpoll:poll-emulator
		configure.env-append    CC=gcc-3.3 CXX=g++-3.3
}

variant darwin {
		patchfiles \
			stable/patch-arts-artsc-artsc-config.in.diff \
			stable/patch-arts-artsc-artsdsp.c.diff \
			stable/patch-arts-artsc-artsdsp.in.diff \
			stable/patch-arts-artsc-Makefile.am.diff \
			stable/patch-arts-configure.in.in.diff \
			stable/patch-arts-flow-audioiocoreaudio.cc.diff \
			stable/patch-arts-flow-audioioesd.cc.diff \
			stable/patch-arts-flow-audioiooss.cc.diff \
			stable/patch-arts-flow-gsl-gsldatahandle-mad.c.diff \
			stable/patch-arts-flow-gsl-gsldatahandle-vorbis.c.diff \
			stable/patch-arts-flow-Makefile.am.diff \
			stable/patch-arts-libltdl-ltdl.c.diff \
			stable/patch-arts-libltdl-ltdl.m4.diff \
			stable/patch-arts-soundserver-artsd.cc.diff \
			stable/patch-arts-soundserver-Makefile.am.diff \
			stable/patch-arts-soundserver-soundserverv2_impl.cc.diff
}

variant cvs {
		##### THIS IS UNSUPPORTED, DO NOT USE THIS IN YOUR PORTS! #####
		cvs.root :pserver:anonymous@anoncvs.kde.org:/home/kde
		cvs.module arts
		pre-extract cvsfetch
		##### I MEAN IT, LANDONF WILL KILL YOU IF YOU DO THIS! #####

		distname arts
		version 1.2.0
		distfiles kde-admindir-cvs-20030701.tar.bz2:admin
		checksums kde-admindir-cvs-20030701.tar.bz2 md5 b9bf2dc286d2e434c2cfdadc421c79b6
		patchfiles
}

variant aqua {
		configure.args-append --enable-mac
}

patch {
		foreach patch $patchfiles {
			system "cd '${workpath}/${distname}' && \
			sed -e 's#@PREFIX@#${prefix}#g' '${portpath}/${filesdir}/${patch}' | patch -p0"
		}
}
post-patch      {
		system "cd '${worksrcpath}' && if test -d ../admin;   then cp -Rf ../admin/ admin; fi"
		system "cd '${worksrcpath}' && if test -d ../libltdl; then cp -Rf ../libltdl/ libltdl; fi"
		system "cd '${worksrcpath}' && make -f admin/Makefile.common cvs"
}

configure.env	CPPFLAGS='-I/usr/X11R6/include -I${prefix}/include -I${prefix}/include/qt3 -no-cpp-precomp -fno-common' \
		LDFLAGS='-L/usr/X11R6/lib' LIBS='-L${prefix}/lib' DYLD_LIBRARY_PATH='/usr/X11R6/lib:${prefix}/lib' \
		LD_LIBRARY_PATH='/usr/X11R6/lib:${prefix}/lib' CFLAGS='-Os' CXXFLAGS='-Os'
configure.args	--prefix='${prefix}' --includedir='${prefix}/include' --libdir='${prefix}/lib' \
		--with-extra-includes='${prefix}/include' --with-extra-libs='${prefix}/lib' \
		--with-qt-dir='${prefix}' --with-qt-includes='${prefix}/include/qt3' \
		--enable-rpath --with-pic --enable-shared=yes --enable-static=no \
		--libexecdir='${prefix}/lib' --with-xinerama --with-pam --disable-final \
		--disable-dependency-tracking

build.env	${configure.env}
pre-build	{
			puts depends_lib
}
