diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2020-05-14 17:49:29 -0400 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2020-05-14 17:49:29 -0400 |
commit | 895ad0652005fceb921eb0672bd0023702a9b070 (patch) | |
tree | 5decd94346bd47dc387d6be5521241d490b4e657 | |
download | mingw-portaudio-master.tar.gz mingw-portaudio-master.tar.xz mingw-portaudio-master.zip |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | mingw-portaudio.spec | 106 | ||||
-rw-r--r-- | portaudio-audacity.patch | 188 | ||||
-rw-r--r-- | portaudio-mingw64.patch | 102 | ||||
-rw-r--r-- | portaudio-win-headers.patch | 53 | ||||
-rw-r--r-- | sources | 1 |
6 files changed, 451 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3ae995e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pa_stable_v190600_20161030.tgz diff --git a/mingw-portaudio.spec b/mingw-portaudio.spec new file mode 100644 index 0000000..93fd276 --- /dev/null +++ b/mingw-portaudio.spec @@ -0,0 +1,106 @@ +%{?mingw_package_header} +%global datetag 20161030 + +Name: mingw-portaudio +Version: 19 +Release: 3.%{datetag}%{?dist} +Summary: Free, cross platform, open-source, audio I/O library + +License: LGPLv2+ +URL: http://www.portaudio.com/ +Source0: http://www.portaudio.com/archives/pa_stable_v%{version}0600_%{datetag}.tgz + +# from main portaudio package +Patch3: portaudio-audacity.patch +# MinGW-specific patches +Patch100: portaudio-mingw64.patch +Patch101: portaudio-win-headers.patch + +BuildArch: noarch + +BuildRequires: autoconf automake libtool + +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-gettext +BuildRequires: mingw32-win-iconv +BuildRequires: mingw32-zlib + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc +BuildRequires: mingw64-binutils +BuildRequires: mingw64-gettext +BuildRequires: mingw64-win-iconv +BuildRequires: mingw64-zlib + + +%description +PortAudio is a portable audio I/O library designed for cross-platform support of +audio. It uses a callback mechanism to request audio processing. Audio can be +generated in various formats, including 32 bit floating point, and will be +converted to the native format internally. + +%package -n mingw32-portaudio +Summary: %{summary} + +%description -n mingw32-portaudio +PortAudio is a portable audio I/O library designed for cross-platform support of +audio. It uses a callback mechanism to request audio processing. Audio can be +generated in various formats, including 32 bit floating point, and will be +converted to the native format internally. + +# Win64 +%package -n mingw64-portaudio +Summary: MinGW compiled portaudio for the Win64 target + +%description -n mingw64-portaudio +MinGW compiled portaudio for the Win64 target. + + +%{?mingw_debug_package} + + +%prep +%autosetup -n portaudio -p1 +autoreconf -fiv + + +%build +%mingw_configure \ + --enable-shared --disable-static \ + --with-winapi=directx,wdmks,wmme,wasapi +%mingw_make + + +%install +%mingw_make_install DESTDIR=%{buildroot} + +# Libtool files don't need to be bundled +find $RPM_BUILD_ROOT -name "*.la" -delete + + +%files -n mingw32-portaudio +%{mingw32_bindir}/libportaudio-2.dll +%{mingw32_includedir}/portaudio.h +%{mingw32_includedir}/pa_win_*.h +%{mingw32_libdir}/libportaudio.dll.a +%{mingw32_libdir}/pkgconfig/portaudio-2.0.pc + +%files -n mingw64-portaudio +%{mingw64_bindir}/libportaudio-2.dll +%{mingw64_includedir}/portaudio.h +%{mingw64_includedir}/pa_win_*.h +%{mingw64_libdir}/libportaudio.dll.a +%{mingw64_libdir}/pkgconfig/portaudio-2.0.pc + + +%changelog +* Wed May 13 2020 Richard Shaw <hobbes1069@gmail.com> - 19-3.20161030 +- Fix library install location again the right way. + +* Wed May 13 2020 Richard Shaw <hobbes1069@gmail.com> - 19-2.20161030 +- Give up on making portaudio use the right directories for mingw. + +* Sun May 13 2018 Richard Shaw <hobbes1069@gmail.com> - 19-1 +- Initial packaging. diff --git a/portaudio-audacity.patch b/portaudio-audacity.patch new file mode 100644 index 0000000..9535f96 --- /dev/null +++ b/portaudio-audacity.patch @@ -0,0 +1,188 @@ +diff -wruN portaudio/include/pa_unix_oss.h portaudio-v19/include/pa_unix_oss.h +--- portaudio/include/pa_unix_oss.h 1969-12-31 18:00:00.000000000 -0600 ++++ portaudio-v19/include/pa_unix_oss.h 2012-12-14 22:34:14.290247100 -0600 +@@ -0,0 +1,52 @@ ++#ifndef PA_UNIX_OSS_H ++#define PA_UNIX_OSS_H ++ ++/* ++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ ++ * PortAudio Portable Real-Time Audio Library ++ * OSS-specific extensions ++ * ++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files ++ * (the "Software"), to deal in the Software without restriction, ++ * including without limitation the rights to use, copy, modify, merge, ++ * publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * Any person wishing to distribute modifications to the Software is ++ * requested to send the modifications to the original developer so that ++ * they can be incorporated into the canonical version. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++/** @file ++ * OSS-specific PortAudio API extension header file. ++ */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++const char *PaOSS_GetStreamInputDevice( PaStream *s ); ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -wruN portaudio/include/portaudio.h portaudio-v19/include/portaudio.h +--- portaudio/include/portaudio.h 2012-08-31 19:10:13.000000000 -0500 ++++ portaudio-v19/include/portaudio.h 2012-12-14 22:34:14.368247200 -0600 +@@ -1146,6 +1146,15 @@ + signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + ++/** Retrieve the host type handling an open stream. ++ ++ @return Returns a non-negative value representing the host API type ++ handling an open stream or, a PaErrorCode (which are always negative) ++ if PortAudio is not initialized or an error is encountered. ++*/ ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ); ++ ++ + /* Miscellaneous utilities */ + + +diff -wruN portaudio/src/common/pa_front.c portaudio-v19/src/common/pa_front.c +--- portaudio/src/common/pa_front.c 2012-12-04 12:39:48.000000000 -0600 ++++ portaudio-v19/src/common/pa_front.c 2012-12-14 09:44:34.604344800 -0600 +@@ -1216,8 +1216,10 @@ + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); + +- if( result == paNoError ) ++ if( result == paNoError ) { + AddOpenStream( *stream ); ++ PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type; ++ } + + + PA_LOGAPI(("Pa_OpenStream returned:\n" )); +@@ -1729,6 +1731,32 @@ + return result; + } + ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ) ++{ ++ PaError error = PaUtil_ValidateStreamPointer( stream ); ++ PaHostApiTypeId result; ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" ); ++ PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); ++#endif ++ ++ if( error == paNoError ) ++ { ++ result = PA_STREAM_REP(stream)->hostApiType; ++ } ++ else ++ { ++ result = (PaHostApiTypeId) error; ++ } ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" ); ++ PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); ++#endif ++ ++ return result; ++} + + PaError Pa_GetSampleSize( PaSampleFormat format ) + { +diff -wruN portaudio/src/common/pa_stream.c portaudio-v19/src/common/pa_stream.c +--- portaudio/src/common/pa_stream.c 2008-02-15 01:50:33.000000000 -0600 ++++ portaudio-v19/src/common/pa_stream.c 2012-12-14 09:44:34.607345000 -0600 +@@ -93,6 +93,8 @@ + streamRepresentation->streamInfo.inputLatency = 0.; + streamRepresentation->streamInfo.outputLatency = 0.; + streamRepresentation->streamInfo.sampleRate = 0.; ++ ++ streamRepresentation->hostApiType = 0; + } + + +diff -wruN portaudio/src/common/pa_stream.h portaudio-v19/src/common/pa_stream.h +--- portaudio/src/common/pa_stream.h 2008-02-15 01:50:33.000000000 -0600 ++++ portaudio-v19/src/common/pa_stream.h 2012-12-14 09:44:34.610345200 -0600 +@@ -152,6 +152,7 @@ + PaStreamFinishedCallback *streamFinishedCallback; + void *userData; + PaStreamInfo streamInfo; ++ PaHostApiTypeId hostApiType; + } PaUtilStreamRepresentation; + + +diff -wruN portaudio/src/hostapi/oss/pa_unix_oss.c portaudio-v19/src/hostapi/oss/pa_unix_oss.c +--- portaudio/src/hostapi/oss/pa_unix_oss.c 2011-05-02 12:07:11.000000000 -0500 ++++ portaudio-v19/src/hostapi/oss/pa_unix_oss.c 2012-12-14 09:44:34.625346000 -0600 +@@ -2028,3 +2028,26 @@ + #endif + } + ++const char *PaOSS_GetStreamInputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->capture ) ++ { ++ return stream->capture->devName; ++ } ++ ++ return NULL; ++} ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->playback ) ++ { ++ return stream->playback->devName; ++ } ++ ++ return NULL; ++} +diff -up portaudio/configure.in~ portaudio/configure.in +--- portaudio/configure.in~ 2013-04-07 12:20:18.000000000 +0200 ++++ portaudio/configure.in 2013-05-04 15:14:14.356191153 +0200 +@@ -387,7 +387,7 @@ case "${host_os}" in + DLL_LIBS="$DLL_LIBS -lasound" + LIBS="$LIBS -lasound" + OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" +- INCLUDES="$INCLUDES pa_linux_alsa.h" ++ INCLUDES="$INCLUDES pa_linux_alsa.h pa_unix_oss.h" + AC_DEFINE(PA_USE_ALSA,1) + fi + diff --git a/portaudio-mingw64.patch b/portaudio-mingw64.patch new file mode 100644 index 0000000..8754c43 --- /dev/null +++ b/portaudio-mingw64.patch @@ -0,0 +1,102 @@ +--- portaudio/bindings/cpp/example/devs.cxx 2006-05-25 04:34:26.000000000 -0500 ++++ portaudio/bindings/cpp/example/devs.cxx 2014-03-31 21:51:17.916789100 -0500 +@@ -1,7 +1,7 @@ + #include <iostream> + #include "portaudiocpp/PortAudioCpp.hxx" + +-#ifdef WIN32 ++#if PA_USE_ASIO + #include "portaudiocpp/AsioDeviceAdapter.hxx" + #endif + +@@ -109,7 +109,7 @@ int main(int, char*[]) + std::cout << "Default high input latency = " << (*i).defaultHighInputLatency() << std::endl; // 8.3 + std::cout << "Default high output latency = " << (*i).defaultHighOutputLatency() << std::endl; // 8.3 + +-#ifdef WIN32 ++#if PA_USE_ASIO + // ASIO specific latency information: + if ((*i).hostApi().typeId() == paASIO) + { +@@ -124,7 +124,7 @@ int main(int, char*[]) + else + std::cout << "ASIO buffer granularity = " << asioDevice.granularity() << std::endl; + } +-#endif // WIN32 ++#endif // PA_USE_ASIO + + std::cout << "Default sample rate = " << (*i).defaultSampleRate() << std::endl; // 8.2 + +--- portaudio/configure.in 2014-01-16 11:49:33.000000000 -0600 ++++ portaudio/configure.in 2014-03-31 22:16:22.682370000 -0500 +@@ -98,14 +98,12 @@ dnl Checks for programs. + + AC_PROG_CC + dnl ASIO and CXX bindings need a C++ compiler +-if [[ "$with_asio" = "yes" ] || [ "$enable_cxx" = "yes" ]] ; then + AC_PROG_CXX +-fi + AC_LIBTOOL_WIN32_DLL + AC_PROG_LIBTOOL + AC_PROG_INSTALL + AC_PROG_LN_S +-AC_PATH_PROG(AR, ar, no) ++AC_PATH_TOOL(AR, ar, no) + if [[ $AR = "no" ]] ; then + AC_MSG_ERROR("Could not find ar - needed to create a library") + fi +@@ -287,7 +285,6 @@ case "${host_os}" in + + PADLL="portaudio.dll" + THREAD_CFLAGS="-mthreads" +- SHARED_FLAGS="-shared" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0" + + if [[ "x$with_directx" = "xyes" ]]; then +@@ -313,7 +310,7 @@ case "${host_os}" in + ASIODIR="$with_asiodir" + add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o + LIBS="${LIBS} -lwinmm -lm -lole32 -luuid" +- DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid" ++ DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -Wl,-luuid" + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_USE_ASIO -DPA_USE_ASIO=1 -DWINDOWS" + + dnl Setting the windows version flags below resolves a conflict between Interlocked* +@@ -329,7 +326,7 @@ case "${host_os}" in + DXDIR="$with_dxdir" + add_objects src/hostapi/wdmks/pa_win_wdmks.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_wdmks_utils.o src/os/win/pa_win_waveformat.o + LIBS="${LIBS} -lwinmm -lm -luuid -lsetupapi -lole32" +- DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32" ++ DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -Wl,-luuid -lsetupapi -lole32" + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" + CFLAGS="$CFLAGS -I$DXDIR/include -UPA_USE_WDMKS -DPA_USE_WDMKS=1" +@@ -349,7 +346,7 @@ case "${host_os}" in + add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o + LIBS="${LIBS} -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lole32" +- CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1" ++ CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1" + fi + ;; + +--- portaudio/src/hostapi/wasapi/pa_win_wasapi.c 2016-10-29 21:23:04.000000000 -0400 ++++ portaudio/src/hostapi/wasapi/pa_win_wasapi.c 2020-05-14 17:11:27.444566200 -0400 +@@ -55,13 +55,14 @@ + + // WASAPI + #include <mmreg.h> // must be before other Wasapi headers +-#if defined(_MSC_VER) && (_MSC_VER >= 1400) +- #include <Avrt.h> ++#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW32__) ++ #include <avrt.h> + #define COBJMACROS +- #include <Audioclient.h> ++ #include <audioclient.h> + #include <endpointvolume.h> + #define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler + #include <mmdeviceapi.h> ++ #include <functiondiscoverykeys_devpkey.h> + #include <functiondiscoverykeys.h> + #include <devicetopology.h> // Used to get IKsJackDescription interface + #undef INITGUID diff --git a/portaudio-win-headers.patch b/portaudio-win-headers.patch new file mode 100644 index 0000000..4e38265 --- /dev/null +++ b/portaudio-win-headers.patch @@ -0,0 +1,53 @@ +--- portaudio/Makefile.in 2017-07-20 04:36:34.627993700 -0500 ++++ portaudio/Makefile.in 2017-07-20 16:16:43.363854500 -0500 +@@ -44,7 +44,7 @@ PALIB = libportaudio.la + PAINC = include/portaudio.h + + PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \ +- -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \ ++ -export-symbols-regex "(Pa_|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS|PaUtil_GetTime|PaWasapi|PaWinDS|PaWinMME).*" \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + + COMMON_OBJS = \ +--- portaudio/configure.in 2017-07-20 04:36:34.441475500 -0500 ++++ portaudio/configure.in 2017-07-20 16:27:08.844127900 -0500 +@@ -288,6 +288,7 @@ case "${host_os}" in + PADLL="portaudio.dll" + THREAD_CFLAGS="-mthreads" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -DPA_USE_WMME=0 -DPA_USE_ASIO=0 -DPA_USE_WDMKS=0 -DPA_USE_DS=0 -DPA_USE_WASAPI=0" ++ INCLUDES="$INCLUDES pa_win_waveformat.h" + + if [[ "x$with_directx" = "xyes" ]]; then + DXDIR="$with_dxdir" +@@ -297,6 +298,7 @@ case "${host_os}" in + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" + CFLAGS="$CFLAGS -I$DXDIR/include -UPA_USE_DS -DPA_USE_DS=1" ++ INCLUDES="$INCLUDES pa_win_ds.h" + fi + + if [[ "x$with_asio" = "xyes" ]]; then +@@ -323,6 +325,7 @@ case "${host_os}" in + #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" + #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" + CFLAGS="$CFLAGS -I$DXDIR/include -UPA_USE_WDMKS -DPA_USE_WDMKS=1" ++ INCLUDES="$INCLUDES pa_win_wdmks.h" + fi + + if [[ "x$with_wmme" = "xyes" ]]; then +@@ -330,6 +333,7 @@ case "${host_os}" in + LIBS="${LIBS} -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm" + CFLAGS="$CFLAGS -UPA_USE_WMME -DPA_USE_WMME=1" ++ INCLUDES="$INCLUDES pa_win_wmme.h" + fi + + if [[ "x$with_wasapi" = "xyes" ]]; then +@@ -337,6 +341,7 @@ case "${host_os}" in + LIBS="${LIBS} -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lole32" + CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1" ++ INCLUDES="$INCLUDES pa_win_wasapi.h" + fi + ;; + @@ -0,0 +1 @@ +4df8224e047529ca9ad42f0521bf81a8 pa_stable_v190600_20161030.tgz |