[88692] trunk/dports/audio/portaudio

hum at macports.org hum at macports.org
Sat Jan 7 22:32:34 PST 2012


Revision: 88692
          http://trac.macports.org/changeset/88692
Author:   hum at macports.org
Date:     2012-01-07 22:32:30 -0800 (Sat, 07 Jan 2012)
Log Message:
-----------
portaudio: restore configure.args and patchfiles that were deleted in r88231; update patchfiles; add -DNDEBUG; install pa_mac_core.h for PyAudio; add darwin to platforms; see #32801.

Revision Links:
--------------
    http://trac.macports.org/changeset/88231

Modified Paths:
--------------
    trunk/dports/audio/portaudio/Portfile

Added Paths:
-----------
    trunk/dports/audio/portaudio/files/patch-configure
    trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff
    trunk/dports/audio/portaudio/files/patch-src__common__pa_types.h
    trunk/dports/audio/portaudio/files/patch-src__hostapi__coreaudio__pa_mac_core.c

Modified: trunk/dports/audio/portaudio/Portfile
===================================================================
--- trunk/dports/audio/portaudio/Portfile	2012-01-08 04:27:17 UTC (rev 88691)
+++ trunk/dports/audio/portaudio/Portfile	2012-01-08 06:32:30 UTC (rev 88692)
@@ -5,8 +5,9 @@
 
 name                portaudio
 version             19.20111121
+revision            1
 categories          audio devel
-platforms           macosx
+platforms           darwin macosx
 maintainers         hum openmaintainer
 license             MIT
 
@@ -36,16 +37,40 @@
 
 worksrcdir          ${name}
 
+# By default, PortAudio is built as a universal binary. 
+# To build a non-universal library for the host architecture,
+# simply use the --disable-mac-universal option with configure.
+# http://www.portaudio.com/trac/wiki/TutorialDir/Compile/MacintoshCoreAudio
+configure.args      --disable-mac-universal
+
+# patch-configure removes -Werror, and adds -DNDEBUG.
+patchfiles          patch-configure \
+                    patch-src__common__pa_types.h
+
+# patch-clang.diff is for clang compiler; see #32720.
 if {${configure.compiler} == "clang"} {
     patchfiles-append   patch-clang.diff
 }
 
+platform darwin 10 {
+    patchfiles-append patch-src__hostapi__coreaudio__pa_mac_core.c
+}
+
+# patch-include__pa_mac_core.h.diff is for Lion (10.7); see #30251.
+platform darwin 11 {
+    patchfiles-append patch-src__hostapi__coreaudio__pa_mac_core.c \
+                      patch-include__pa_mac_core.h.diff
+}
+
 post-destroot {
     xinstall -d ${destroot}${prefix}/share/doc/${name}
     xinstall -m 644 -W ${worksrcpath} \
         README.txt \
         LICENSE.txt \
         ${destroot}${prefix}/share/doc/${name}
+    # The build of PyAudio requires pa_mac_core.h.
+    xinstall -m 644 ${worksrcpath}/include/pa_mac_core.h \
+        ${destroot}${prefix}/include
 }
 
 livecheck.type      regex

Added: trunk/dports/audio/portaudio/files/patch-configure
===================================================================
--- trunk/dports/audio/portaudio/files/patch-configure	                        (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-configure	2012-01-08 06:32:30 UTC (rev 88692)
@@ -0,0 +1,19 @@
+--- configure.orig	2011-11-12 03:27:15.000000000 +0900
++++ configure	2012-01-07 20:21:31.000000000 +0900
+@@ -15654,7 +15654,6 @@
+ 
+ 
+ cat >>confdefs.h <<_ACEOF
+-#define SIZEOF_LONG $ac_cv_sizeof_long
+ _ACEOF
+ 
+ 
+@@ -15765,7 +15764,7 @@
+         $as_echo "#define PA_USE_COREAUDIO 1" >>confdefs.h
+ 
+ 
+-        CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix -Werror"
++        CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix -DNDEBUG"
+         LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"
+ 
+         if test "x$enable_mac_universal" = "xyes" ; then

Added: trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff
===================================================================
--- trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff	                        (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff	2012-01-08 06:32:30 UTC (rev 88692)
@@ -0,0 +1,11 @@
+--- include/pa_mac_core.h.orig	2011-07-10 00:01:52.000000000 +0900
++++ include/pa_mac_core.h	2012-01-07 20:24:12.000000000 +0900
+@@ -46,7 +46,7 @@
+ #include "portaudio.h"
+ 
+ #include <AudioUnit/AudioUnit.h>
+-//#include <AudioToolbox/AudioToolbox.h>
++#include <AudioToolbox/AudioToolbox.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {

Added: trunk/dports/audio/portaudio/files/patch-src__common__pa_types.h
===================================================================
--- trunk/dports/audio/portaudio/files/patch-src__common__pa_types.h	                        (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-src__common__pa_types.h	2012-01-08 06:32:30 UTC (rev 88692)
@@ -0,0 +1,14 @@
+--- src/common/pa_types.h.orig	2006-08-26 17:27:53.000000000 +0900
++++ src/common/pa_types.h	2012-01-07 20:26:17.000000000 +0900
+@@ -62,7 +62,11 @@
+ #endif
+ 
+ #ifndef SIZEOF_LONG
++#ifdef __LP64__
++#define SIZEOF_LONG 8
++#else
+ #define SIZEOF_LONG 4
++#endif /* __LP64__ */
+ #endif
+ 
+ 

Added: trunk/dports/audio/portaudio/files/patch-src__hostapi__coreaudio__pa_mac_core.c
===================================================================
--- trunk/dports/audio/portaudio/files/patch-src__hostapi__coreaudio__pa_mac_core.c	                        (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-src__hostapi__coreaudio__pa_mac_core.c	2012-01-08 06:32:30 UTC (rev 88692)
@@ -0,0 +1,71 @@
+--- src/hostapi/coreaudio/pa_mac_core.c.orig	2011-10-20 18:40:12.000000000 +0900
++++ src/hostapi/coreaudio/pa_mac_core.c	2012-01-07 20:30:48.000000000 +0900
+@@ -1128,8 +1128,8 @@
+                                    const double sampleRate,
+                                    void *refCon )
+ {
+-    ComponentDescription desc;
+-    Component comp;
++    AudioComponentDescription desc;
++    AudioComponent comp;
+     /*An Apple TN suggests using CAStreamBasicDescription, but that is C++*/
+     AudioStreamBasicDescription desiredFormat;
+     OSStatus result = noErr;
+@@ -1200,7 +1200,7 @@
+     desc.componentFlags        = 0;
+     desc.componentFlagsMask    = 0;
+     /* -- find the component -- */
+-    comp = FindNextComponent( NULL, &desc );
++    comp = AudioComponentFindNext( NULL, &desc );
+     if( !comp )
+     {
+        DBUG( ( "AUHAL component not found." ) );
+@@ -1209,7 +1209,7 @@
+        return paUnanticipatedHostError;
+     }
+     /* -- open it -- */
+-    result = OpenAComponent( comp, audioUnit );
++    result = AudioComponentInstanceNew( comp, audioUnit );
+     if( result )
+     {
+        DBUG( ( "Failed to open AUHAL component." ) );
+@@ -1562,7 +1562,7 @@
+ #undef ERR_WRAP
+ 
+     error:
+-       CloseComponent( *audioUnit );
++       AudioComponentInstanceDispose( *audioUnit );
+        *audioUnit = NULL;
+        if( result )
+           return PaMacCore_SetError( result, line, 1 );
+@@ -2575,13 +2575,13 @@
+        }
+        if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) {
+           AudioUnitUninitialize( stream->outputUnit );
+-          CloseComponent( stream->outputUnit );
++          AudioComponentInstanceDispose( stream->outputUnit );
+        }
+        stream->outputUnit = NULL;
+        if( stream->inputUnit )
+        {
+           AudioUnitUninitialize( stream->inputUnit );
+-          CloseComponent( stream->inputUnit );
++          AudioComponentInstanceDispose( stream->inputUnit );
+           stream->inputUnit = NULL;
+        }
+        if( stream->inputRingBuffer.buffer )
+@@ -2641,12 +2641,12 @@
+ 
+ // it's not clear from appl's docs that this really waits
+ // until all data is flushed.
+-static ComponentResult BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioUnitElement element )
++static OSStatus BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioUnitElement element )
+ {
+     Boolean isRunning = 1;
+     while( isRunning ) {
+        UInt32 s = sizeof( isRunning );
+-       ComponentResult err = AudioUnitGetProperty( audioUnit, kAudioOutputUnitProperty_IsRunning, kAudioUnitScope_Global, element,  &isRunning, &s );
++       OSStatus err = AudioUnitGetProperty( audioUnit, kAudioOutputUnitProperty_IsRunning, kAudioUnitScope_Global, element,  &isRunning, &s );
+        if( err )
+           return err;
+        Pa_Sleep( 100 );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120107/278aaf78/attachment-0001.html>


More information about the macports-changes mailing list