aboutsummaryrefslogtreecommitdiff
path: root/audio/rezound
diff options
context:
space:
mode:
Diffstat (limited to 'audio/rezound')
-rw-r--r--audio/rezound/Makefile15
-rw-r--r--audio/rezound/files/050_all_portaudio19.patch196
2 files changed, 209 insertions, 2 deletions
diff --git a/audio/rezound/Makefile b/audio/rezound/Makefile
index 3e69d354458e..bea1298b1460 100644
--- a/audio/rezound/Makefile
+++ b/audio/rezound/Makefile
@@ -3,7 +3,7 @@
PORTNAME= rezound
DISTVERSION= 0.12.3beta
-PORTREVISION= 21
+PORTREVISION= 22
CATEGORIES= audio
MASTER_SITES= SF/${PORTNAME}/ReZound/${DISTVERSION}
@@ -36,7 +36,7 @@ BROKEN_NLS_DESC= ${NLS_DESC} (broken!)
LARGEFILE_CONFIGURE_ON= --enable-largefile
JACK_LIB_DEPENDS= libjack.so:${PORTSDIR}/audio/jack
AUDIOFILE_LIB_DEPENDS= libaudiofile.so:${PORTSDIR}/audio/libaudiofile
-PORTAUDIO_LIB_DEPENDS= libportaudio.so.0:${PORTSDIR}/audio/portaudio
+PORTAUDIO_LIB_DEPENDS= libportaudio.so:${PORTSDIR}/audio/portaudio
OGG_LIB_DEPENDS= libogg.so:${PORTSDIR}/audio/libogg
VORBIS_LIB_DEPENDS= libvorbis.so:${PORTSDIR}/audio/libvorbis
FLAC_LIB_DEPENDS= libFLAC.so:${PORTSDIR}/audio/flac
@@ -47,6 +47,8 @@ LADSPA_CONFIGURE_OFF= --disable-ladspa
LAME_RUN_DEPENDS= lame:${PORTSDIR}/audio/lame
CDRDAO_RUN_DEPENDS= cdrdao:${PORTSDIR}/sysutils/cdrdao
+EXTRA_PATCHES= ${FILESDIR}/050_all_portaudio19.patch:-p1
+
.include <bsd.port.options.mk>
# NLS support is broken as of recent versions of libstdc++; rezound dies at
@@ -59,6 +61,10 @@ CONFIGURE_ARGS+= --disable-nls
PLIST_SUB+= NLS="@comment "
.endif
+.if ${PORT_OPTIONS:MPORTAUDIO}
+LIBS+= -lportaudio
+.endif
+
post-patch: .SILENT
${REINPLACE_CMD} -E '/atoll|round|nearbyint/d' \
${WRKSRC}/config/platform/bsd.h
@@ -99,4 +105,9 @@ post-patch: .SILENT
${REINPLACE_CMD} -e 's/ install-pkgdocDATA$$//' ${WRKSRC}/Makefile.in
.endif
+.if ${PORT_OPTIONS:MPORTAUDIO}
+post-configure:
+ ${ECHO_CMD} "#define ENABLE_PORTAUDIO_V19 1" >> ${WRKSRC}/config/config.h
+.endif
+
.include <bsd.port.mk>
diff --git a/audio/rezound/files/050_all_portaudio19.patch b/audio/rezound/files/050_all_portaudio19.patch
new file mode 100644
index 000000000000..3757e915c1c9
--- /dev/null
+++ b/audio/rezound/files/050_all_portaudio19.patch
@@ -0,0 +1,196 @@
+Index: rezound-0.12.3beta/configure.ac
+===================================================================
+--- rezound-0.12.3beta.orig/configure.ac
++++ rezound-0.12.3beta/configure.ac
+@@ -372,13 +372,22 @@ AC_ARG_ENABLE(
+
+ # handle the --enable-portaudio flag
+ AH_TEMPLATE(ENABLE_PORTAUDIO)
++AH_TEMPLATE(ENABLE_PORTAUDIO_V19)
+ if test -z "$enable_standalone"; then
+ AC_ARG_ENABLE(
+ portaudio,
+ AC_HELP_STRING([--enable/disable-portaudio],[enable/disable ReZound to use PortAudio for audio I/O]),
+ [
+ if [[ "$enableval" = "yes" ]]
+- then
++ then
++ PKG_CHECK_MODULES(PORTAUDIO_19,portaudio-2.0 >= 0.21 ,[portaudio_v19=yes],:)
++ if test "x$portaudio_v19" = "xyes"; then
++ AC_DEFINE(ENABLE_PORTAUDIO)
++ AC_DEFINE(ENABLE_PORTAUDIO_V19)
++ LIBS="$LIBS $PORTAUDIO_19_LIBS"
++ AC_MSG_RESULT([*** enabling libportaudio v19 for audio I/O])
++ using_portaudio=1
++ else
+ # --enable-portaudio was given
+ # Require that the portaudio library can be found
+ AC_CHECK_LIB(
+@@ -404,12 +413,21 @@ if test -z "$enable_standalone"; then
+
+ AC_MSG_ERROR([***** libportaudio.a not found (http://www.portaudio.com) *****])
+ )
++ fi
+ else
+ AC_MSG_RESULT([*** disabling libportaudio for audio I/O])
+ fi
+ ],
+ [ # action if neither enable or disable flag was given
+ # if libportaudio and portaudio.h are found, then enable it
++ PKG_CHECK_MODULES(PORTAUDIO_19,portaudio-2.0 >= 0.21 ,[portaudio_v19=yes],:)
++ if test "x$portaudio_v19" = "xyes"; then
++ AC_DEFINE(ENABLE_PORTAUDIO)
++ AC_DEFINE(ENABLE_PORTAUDIO_V19)
++ LIBS="$LIBS $PORTAUDIO_19_LIBS"
++ AC_MSG_RESULT([*** enabling libportaudio v19 for audio I/O])
++ using_portaudio=1
++ else
+ AC_CHECK_LIB(
+ portaudio,
+ Pa_Initialize,
+@@ -430,6 +448,7 @@ if test -z "$enable_standalone"; then
+ ]
+ )]
+ )
++ fi
+ ]
+ )
+ else
+Index: rezound-0.12.3beta/src/backend/CPortAudioSoundPlayer.cpp
+===================================================================
+--- rezound-0.12.3beta.orig/src/backend/CPortAudioSoundPlayer.cpp
++++ rezound-0.12.3beta/src/backend/CPortAudioSoundPlayer.cpp
+@@ -70,6 +70,24 @@ void CPortAudioSoundPlayer::initialize()
+
+
+ // open a PortAudio stream
++#ifdef ENABLE_PORTAUDIO_V19
++ PaStreamParameters output = { gPortAudioOutputDevice,
++ gDesiredOutputChannelCount,
++ sampleFormat,
++ Pa_GetDeviceInfo(gPortAudioOutputDevice)->defaultLowOutputLatency ,
++ NULL};
++
++ err = Pa_OpenStream(
++ &stream,
++ NULL,
++ &output,
++ gDesiredOutputSampleRate,
++ gDesiredOutputBufferSize * gDesiredOutputBufferCount,
++ paClipOff|paDitherOff,
++ CPortAudioSoundPlayer::PortAudioCallback,
++ this);
++
++#else
+ err = Pa_OpenStream(
+ &stream,
+ paNoDevice, /* recording parameter, we're not recording */
+@@ -86,6 +104,7 @@ void CPortAudioSoundPlayer::initialize()
+ paClipOff|paDitherOff,
+ CPortAudioSoundPlayer::PortAudioCallback,
+ this);
++#endif
+
+ if(err!=paNoError)
+ throw runtime_error(string(__func__)+" -- error opening PortAudio stream -- "+Pa_GetErrorText(err));
+@@ -156,7 +175,11 @@ void CPortAudioSoundPlayer::doneRecordin
+ }
+
+
++#ifdef ENABLE_PORTAUDIO_V19
++int CPortAudioSoundPlayer::PortAudioCallback(const void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,const PaStreamCallbackTimeInfo* outTime, PaStreamCallbackFlags statusFlags, void *userData)
++#else
+ int CPortAudioSoundPlayer::PortAudioCallback(void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,PaTimestamp outTime,void *userData)
++#endif
+ {
+ try
+ {
+Index: rezound-0.12.3beta/src/backend/CPortAudioSoundPlayer.h
+===================================================================
+--- rezound-0.12.3beta.orig/src/backend/CPortAudioSoundPlayer.h
++++ rezound-0.12.3beta/src/backend/CPortAudioSoundPlayer.h
+@@ -45,10 +45,14 @@ public:
+
+ private:
+ bool initialized;
+- PortAudioStream *stream;
++ PaStream *stream;
+ bool supportsFullDuplex;
+
++#ifdef ENABLE_PORTAUDIO_V19
++ static int PortAudioCallback(const void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,const PaStreamCallbackTimeInfo* outTime, PaStreamCallbackFlags statusFlags, void *userData);
++#else
+ static int PortAudioCallback(void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,PaTimestamp outTime,void *userData);
++#endif
+
+ };
+
+Index: rezound-0.12.3beta/src/backend/CPortAudioSoundRecorder.cpp
+===================================================================
+--- rezound-0.12.3beta.orig/src/backend/CPortAudioSoundRecorder.cpp
++++ rezound-0.12.3beta/src/backend/CPortAudioSoundRecorder.cpp
+@@ -65,6 +65,24 @@ void CPortAudioSoundRecorder::initialize
+ ASoundRecorder::initialize(sound);
+
+ // open a PortAudio stream
++#ifdef ENABLE_PORTAUDIO_V19
++ PaStreamParameters input = {
++ gPortAudioOutputDevice,
++ sound->getChannelCount(),
++ sampleFormat,
++ Pa_GetDeviceInfo(gPortAudioOutputDevice)->defaultLowInputLatency ,
++ NULL};
++ err = Pa_OpenStream(
++ &stream,
++ &input,
++ NULL,
++ sound->getSampleRate(),
++ BUFFER_SIZE_FRAMES*12,
++ paClipOff|paDitherOff,
++ CPortAudioSoundRecorder::PortAudioCallback,
++ this);
++
++#else
+ err = Pa_OpenStream(
+ &stream,
+ gPortAudioOutputDevice,
+@@ -81,6 +99,7 @@ void CPortAudioSoundRecorder::initialize
+ paClipOff|paDitherOff,
+ CPortAudioSoundRecorder::PortAudioCallback,
+ this);
++#endif
+
+ if(err!=paNoError)
+ throw runtime_error(string(__func__)+" -- error opening PortAudio stream -- "+Pa_GetErrorText(err));
+@@ -131,7 +150,11 @@ void CPortAudioSoundRecorder::redo()
+ Pa_StartStream(stream);
+ }
+
++#ifdef ENABLE_PORTAUDIO_V19
++int CPortAudioSoundRecorder::PortAudioCallback(const void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,const PaStreamCallbackTimeInfo* outTime, PaStreamCallbackFlags statusFlags, void *userData)
++#else
+ int CPortAudioSoundRecorder::PortAudioCallback(void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,PaTimestamp outTime,void *userData)
++#endif
+ {
+ try
+ {
+Index: rezound-0.12.3beta/src/backend/CPortAudioSoundRecorder.h
+===================================================================
+--- rezound-0.12.3beta.orig/src/backend/CPortAudioSoundRecorder.h
++++ rezound-0.12.3beta/src/backend/CPortAudioSoundRecorder.h
+@@ -42,10 +42,14 @@ public:
+ void redo();
+
+ private:
+- PortAudioStream *stream;
++ PaStream *stream;
+ bool initialized;
+
++#ifdef ENABLE_PORTAUDIO_V19
++ static int PortAudioCallback(const void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,const PaStreamCallbackTimeInfo* outTime, PaStreamCallbackFlags statusFlags, void *userData);
++#else
+ static int PortAudioCallback(void *inputBuffer,void *outputBuffer,unsigned long framesPerBuffer,PaTimestamp outTime,void *userData);
++#endif
+ };
+
+ #endif // ENABLE_PORTAUDIO