diff options
author | ben <ben@pkgsrc.org> | 2004-04-20 17:52:48 +0000 |
---|---|---|
committer | ben <ben@pkgsrc.org> | 2004-04-20 17:52:48 +0000 |
commit | 0f60134da544894203ebd08ae2f23d41d8c3f21e (patch) | |
tree | 31f28619bf3960f7370ec949267085e2a299dcaf | |
parent | 750b807fa06798674a6d45a9b93f17adecbb45c5 (diff) | |
download | pkgsrc-0f60134da544894203ebd08ae2f23d41d8c3f21e.tar.gz |
Initial import of portaudio-18.1, a portable cross-platform audio API.
Package provided by dotz@irc.pl.
PortAudio is a free, cross platform, open-source, audio I/O library. It
lets you write simple audio programs in 'C' that will compile and run on
many platforms including Windows, Macintosh (8,9,X), Unix (OSS), SGI, and
BeOS. PortAudio is intended to promote the exchange of audio synthesis
software between developers on different platforms, and was recently
selected as the audio component of a larger PortMusic project that includes
MIDI and sound file support.
PortAudio provides a very simple API for recording and/or playing sound
using a simple callback function. Example programs are included that
synthesize sine waves and pink noise, perform fuzz distortion on a guitar,
list available audio devices, etc.
-rw-r--r-- | audio/portaudio/DESCR | 12 | ||||
-rw-r--r-- | audio/portaudio/Makefile | 26 | ||||
-rw-r--r-- | audio/portaudio/PLIST | 5 | ||||
-rw-r--r-- | audio/portaudio/buildlink2.mk | 19 | ||||
-rw-r--r-- | audio/portaudio/buildlink3.mk | 23 | ||||
-rw-r--r-- | audio/portaudio/distinfo | 9 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-aa | 99 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-ac | 19 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-ad | 20 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-ae | 15 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-af | 27 |
11 files changed, 274 insertions, 0 deletions
diff --git a/audio/portaudio/DESCR b/audio/portaudio/DESCR new file mode 100644 index 00000000000..3efe5ca83f9 --- /dev/null +++ b/audio/portaudio/DESCR @@ -0,0 +1,12 @@ +PortAudio is a free, cross platform, open-source, audio I/O library. It +lets you write simple audio programs in 'C' that will compile and run on +many platforms including Windows, Macintosh (8,9,X), Unix (OSS), SGI, and +BeOS. PortAudio is intended to promote the exchange of audio synthesis +software between developers on different platforms, and was recently +selected as the audio component of a larger PortMusic project that includes +MIDI and sound file support. + +PortAudio provides a very simple API for recording and/or playing sound +using a simple callback function. Example programs are included that +synthesize sine waves and pink noise, perform fuzz distortion on a guitar, +list available audio devices, etc. diff --git a/audio/portaudio/Makefile b/audio/portaudio/Makefile new file mode 100644 index 00000000000..5332d46edc5 --- /dev/null +++ b/audio/portaudio/Makefile @@ -0,0 +1,26 @@ +# $NetBSD: Makefile,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ +# + +DISTNAME= portaudio_v18_1 +PKGNAME= portaudio-18.1 +CATEGORIES= audio +MASTER_SITES= http://www.portaudio.com/archives/ +EXTRACT_SUFX= .zip + +MAINTAINER= dotz@irc.pl +HOMEPAGE= http://www.portaudio.com/archives/ +COMMENT= Portable cross-platform Audio API + +HAS_CONFIGURE= YES +USE_GNU_TOOLS+= make +USE_BUILDLINK3= YES + +CONFIGURE_ARGS= --prefix=${PREFIX} +EXTRACT_CMD_OPTS.zip= -aqo + +pre-configure: + ${CHMOD} 755 ${WRKSRC}/configure + +.include "../../mk/pthread.buildlink3.mk" +.include "../../mk/ossaudio.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/audio/portaudio/PLIST b/audio/portaudio/PLIST new file mode 100644 index 00000000000..1c9ad7243a0 --- /dev/null +++ b/audio/portaudio/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ +include/portaudio.h +lib/libportaudio.a +lib/libportaudio.so.0.0.18 +lib/libportaudio.so diff --git a/audio/portaudio/buildlink2.mk b/audio/portaudio/buildlink2.mk new file mode 100644 index 00000000000..85656abc1d5 --- /dev/null +++ b/audio/portaudio/buildlink2.mk @@ -0,0 +1,19 @@ +# $NetBSD: buildlink2.mk,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ + +.if !defined(PORTAUDIO_BUILDLINK2_MK) +PORTAUDIO_BUILDLINK2_MK= # defined + +BUILDLINK_PACKAGES+= portaudio +BUILDLINK_DEPENDS.portaudio?= portaudio>=18.1 +BUILDLINK_PKGSRCDIR.portaudio?= ../../wip/portaudio + +EVAL_PREFIX+= BUILDLINK_PREFIX.portaudio=portaudio +BUILDLINK_PREFIX.portaudio_DEFAULT= ${LOCALBASE} +BUILDLINK_FILES.portaudio= include/portaudio.h +BUILDLINK_FILES.portaudio+= lib/libportaudio.* + +BUILDLINK_TARGETS+= portaudio-buildlink + +portaudio-buildlink: _BUILDLINK_USE + +.endif # PORTAUDIO_BUILDLINK2_MK diff --git a/audio/portaudio/buildlink3.mk b/audio/portaudio/buildlink3.mk new file mode 100644 index 00000000000..27a86afbf75 --- /dev/null +++ b/audio/portaudio/buildlink3.mk @@ -0,0 +1,23 @@ +# $NetBSD: buildlink3.mk,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ +# XXX +# XXX This file was created automatically using createbuildlink-3.3. +# XXX After this file as been verified as correct, the comment lines +# XXX beginning with "XXX" should be removed. Please do not commit +# XXX unverified buildlink[23].mk files. + +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ +PORTAUDIO_BUILDLINK3_MK:= ${PORTAUDIO_BUILDLINK3_MK}+ + +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= portaudio +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nportaudio} +BUILDLINK_PACKAGES+= portaudio + +.if !empty(PORTAUDIO_BUILDLINK3_MK:M+) +BUILDLINK_DEPENDS.portaudio+= portaudio>=18.1 +BUILDLINK_PKGSRCDIR.portaudio?= ../../wip/portaudio +.endif # PORTAUDIO_BUILDLINK3_MK + +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/audio/portaudio/distinfo b/audio/portaudio/distinfo new file mode 100644 index 00000000000..1d463e8af7b --- /dev/null +++ b/audio/portaudio/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ + +SHA1 (portaudio_v18_1.zip) = a460ac5484137d77df17a95ce844ff7f178305b1 +Size (portaudio_v18_1.zip) = 550130 bytes +SHA1 (patch-aa) = e522bfbf7f69d6f15fd0a32e01a480db922acc56 +SHA1 (patch-ac) = de0d99b71e09f9bbcd5d838188e5dc8d68d09a46 +SHA1 (patch-ad) = 5a343e721ae183facc58195026c7e5c49536632a +SHA1 (patch-ae) = c2744f10d80a478ad571fcce82bf301d6c50cb59 +SHA1 (patch-af) = da42578e66137f95edbbb86bde724af32e398d57 diff --git a/audio/portaudio/patches/patch-aa b/audio/portaudio/patches/patch-aa new file mode 100644 index 00000000000..a123a0da2f6 --- /dev/null +++ b/audio/portaudio/patches/patch-aa @@ -0,0 +1,99 @@ +$NetBSD: patch-aa,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ + +--- pa_unix_oss/pa_unix.c.orig Sat Nov 22 17:06:46 2003 ++++ pa_unix_oss/pa_unix.c Sat Nov 22 17:13:50 2003 +@@ -375,7 +375,11 @@ + * and the watchdog will detect it. + */ + +-#define SCHEDULER_POLICY SCHED_RR ++#ifndef _POSIX_THREAD_IS_GNU_PTH ++# define SCHEDULER_POLICY SCHED_RR ++#else ++# define SCHEDULER_POLICY 0 ++#endif + #define WATCHDOG_MAX_SECONDS (3) + #define WATCHDOG_INTERVAL_USEC (1000000) + +@@ -411,13 +415,16 @@ + + static PaError PaHost_WatchDogProc( PaHostSoundControl *pahsc ) + { ++#ifndef _POSIX_THREAD_IS_GNU_PTH + struct sched_param schp = { 0 }; ++#endif + int maxPri; + + #ifdef GNUSTEP + GSRegisterCurrentThread(); /* SB20010904 */ + #endif + ++#ifndef _POSIX_THREAD_IS_GNU_PTH + /* Run at a priority level above audio thread so we can still run if it hangs. */ + /* Rise more than 1 because of rumored off-by-one scheduler bugs. */ + schp.sched_priority = pahsc->pahsc_AudioPriority + 4; +@@ -429,7 +436,7 @@ + ERR_RPT(("PaHost_WatchDogProc: cannot set watch dog priority!\n")); + goto killAudio; + } +- ++#endif + /* Compare watchdog time with audio and canary thread times. */ + /* Sleep for a while or until thread cancelled. */ + while( pahsc->pahsc_WatchDogRun ) +@@ -465,7 +472,8 @@ + return 0; + + lowerAudio: +- { ++#ifndef _POSIX_THREAD_IS_GNU_PTH ++ { + struct sched_param schat = { 0 }; + if( sched_setscheduler(pahsc->pahsc_AudioThreadPID, SCHED_OTHER, &schat) != 0) + { +@@ -478,7 +486,9 @@ + goto cleanup; + } + } +- ++#else ++ goto cleanup; ++#endif + killAudio: + ERR_RPT(("PaHost_WatchDogProc: killing hung audio thread!\n")); + pthread_kill( pahsc->pahsc_AudioThread, SIGKILL ); +@@ -574,18 +584,19 @@ + { + PaHostSoundControl *pahsc; + PaError result = paNoError; ++#ifndef _POSIX_THREAD_IS_GNU_PTH + struct sched_param schp = { 0 }; +- ++#endif + pahsc = (PaHostSoundControl *) past->past_DeviceData; + if( pahsc == NULL ) return paInternalError; + + pahsc->pahsc_AudioThreadPID = getpid(); + DBUG(("PaHost_BoostPriority: audio PID = %d\n", pahsc->pahsc_AudioThreadPID )); +- ++#ifndef _POSIX_THREAD_IS_GNU_PTH + /* Choose a priority in the middle of the range. */ + pahsc->pahsc_AudioPriority = (sched_get_priority_max(SCHEDULER_POLICY) - + sched_get_priority_min(SCHEDULER_POLICY)) / 2; +- schp.sched_priority = pahsc->pahsc_AudioPriority; ++ schp.sched_priority = pahsc->pahsc_AudioPriority; + + if (sched_setscheduler(0, SCHEDULER_POLICY, &schp) != 0) + { +@@ -597,7 +608,10 @@ + /* We are running at high priority so we should have a watchdog in case audio goes wild. */ + result = PaHost_StartWatchDog( pahsc ); + } +- ++#else ++ DBUG(("PortAudio: audio callback priority set to level %d - call ignored with GNU Pth\n", schp.sched_priority)); ++ result = PaHost_StartWatchDog( pahsc ); ++#endif + return result; + } + diff --git a/audio/portaudio/patches/patch-ac b/audio/portaudio/patches/patch-ac new file mode 100644 index 00000000000..b23e93cb226 --- /dev/null +++ b/audio/portaudio/patches/patch-ac @@ -0,0 +1,19 @@ +$NetBSD: patch-ac,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ + +--- Makefile.in.orig Tue Feb 11 23:24:56 2003 ++++ Makefile.in +@@ -7,12 +7,12 @@ + PREFIX = @prefix@ + CC = @CC@ + CFLAGS = @CFLAGS@ -Ipa_common +-LIBS = @LIBS@ ++LIBS = ${LIBOSSAUDIO} -L@prefix@/lib -Wl,${RPATH_FLAG} @prefix@/lib @LIBS@ + AR = @AR@ + RANLIB = @RANLIB@ + INSTALL = @INSTALL@ + SHARED_FLAGS = @SHARED_FLAGS@ +-DLL_LIBS = @DLL_LIBS@ ++DLL_LIBS = @DLL_LIBS@ ${LIBOSSAUDIO} + + OTHER_OBJS = @OTHER_OBJS@ + diff --git a/audio/portaudio/patches/patch-ad b/audio/portaudio/patches/patch-ad new file mode 100644 index 00000000000..5c79ebe52b1 --- /dev/null +++ b/audio/portaudio/patches/patch-ad @@ -0,0 +1,20 @@ +$NetBSD: patch-ad,v 1.1.1.1 2004/04/20 17:52:48 ben Exp $ + +--- pa_tests/patest_record.c.orig Sat Nov 22 17:26:48 2003 ++++ pa_tests/patest_record.c Sat Nov 22 17:27:12 2003 +@@ -133,6 +133,7 @@ + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) + { ++ int framesToPlay, samplesToPlay, samplesPerBuffer; + paTestData *data = (paTestData*)userData; + SAMPLE *rptr = &data->recordedSamples[data->frameIndex * NUM_CHANNELS]; + SAMPLE *wptr = (SAMPLE*)outputBuffer; +@@ -141,7 +142,6 @@ + unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; + (void) inputBuffer; /* Prevent unused variable warnings. */ + (void) outTime; +- int framesToPlay, samplesToPlay, samplesPerBuffer; + + if( framesLeft < framesPerBuffer ) + { diff --git a/audio/portaudio/patches/patch-ae b/audio/portaudio/patches/patch-ae new file mode 100644 index 00000000000..94259bbded4 --- /dev/null +++ b/audio/portaudio/patches/patch-ae @@ -0,0 +1,15 @@ +$NetBSD: patch-ae,v 1.1.1.1 2004/04/20 17:52:49 ben Exp $ + +--- pa_tests/patest_wire.c.orig Sat Nov 22 17:27:23 2003 ++++ pa_tests/patest_wire.c Sat Nov 22 17:27:54 2003 +@@ -74,9 +74,9 @@ + SAMPLE *out = (SAMPLE*)outputBuffer; + SAMPLE *in = (SAMPLE*)inputBuffer; + unsigned int i; +- (void) outTime; + int samplesPerFrame; + int numSamples; ++ (void) outTime; + + samplesPerFrame = (int) userData; + numSamples = framesPerBuffer * samplesPerFrame; diff --git a/audio/portaudio/patches/patch-af b/audio/portaudio/patches/patch-af new file mode 100644 index 00000000000..285ca1fd79e --- /dev/null +++ b/audio/portaudio/patches/patch-af @@ -0,0 +1,27 @@ +$NetBSD: patch-af,v 1.1.1.1 2004/04/20 17:52:49 ben Exp $ + +--- pa_unix_oss/pa_unix_oss.c~ Mon Jun 30 11:05:50 2003 ++++ pa_unix_oss/pa_unix_oss.c Wed Nov 26 02:40:25 2003 +@@ -47,6 +47,9 @@ + #include <machine/soundcard.h> /* JH20010905 */ + #endif + ++#ifdef __NetBSD__ ++#include <sys/audioio.h> ++#endif + + #ifndef AFMT_S16_NE + #define AFMT_S16_NE Get_AFMT_S16_NE() +@@ -236,7 +239,11 @@ + ERR_RPT(("Pa_SetupDeviceFormat: HW does not support AFMT_S16_NE\n" )); + return paHostError; + } +- ++#ifdef __NetBSD__ ++ tmp = 1; ++ ioctl(devHandle, AUDIO_SETFD, &tmp); /* set full-duplex operations, ++ * ignore the output on non-fd cards */ ++#endif + + /* Set number of channels. */ + tmp = numChannels; |