[53938] trunk/dports/audio/portaudio

toby at macports.org toby at macports.org
Thu Jul 16 13:22:55 PDT 2009


Revision: 53938
          http://trac.macports.org/changeset/53938
Author:   toby at macports.org
Date:     2009-07-16 13:22:53 -0700 (Thu, 16 Jul 2009)
Log Message:
-----------
#20338 (portaudio fails to build on 10.6)

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

Added Paths:
-----------
    trunk/dports/audio/portaudio/files/
    trunk/dports/audio/portaudio/files/patch-configure
    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	2009-07-16 18:53:30 UTC (rev 53937)
+++ trunk/dports/audio/portaudio/Portfile	2009-07-16 20:22:53 UTC (rev 53938)
@@ -31,6 +31,11 @@
 # Universal building is on by default
 universal_variant   no
 
+platform darwin 10 {
+    universal_variant yes
+    patchfiles patch-configure patch-src__common__pa_types.h patch-src__hostapi__coreaudio__pa_mac_core.c
+}
+
 use_parallel_build  yes
 
 post-destroot {

Added: trunk/dports/audio/portaudio/files/patch-configure
===================================================================
--- trunk/dports/audio/portaudio/files/patch-configure	                        (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-configure	2009-07-16 20:22:53 UTC (rev 53938)
@@ -0,0 +1,26 @@
+--- configure.orig	2007-11-13 13:22:56.000000000 -0800
++++ configure	2009-07-16 12:34:11.000000000 -0700
+@@ -20452,7 +20452,6 @@
+ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+ echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+ cat >>confdefs.h <<_ACEOF
+-#define SIZEOF_LONG $ac_cv_sizeof_long
+ _ACEOF
+ 
+ 
+@@ -20665,13 +20664,8 @@
+ #define PA_USE_COREAUDIO 1
+ _ACEOF
+ 
+-	if [ -d /Developer/SDKs/MacOSX10.5.sdk ] ; then
+-		SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3";
+-		CFLAGS="-Werror $CFLAGS -arch x86_64 -arch ppc64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3";
+-	else
+-		SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib  -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3";
+-		CFLAGS="-Werror $CFLAGS -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.3";
+-	fi
++	SHARED_FLAGS="-Werror -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreFoundation -dynamiclib";
++	CFLAGS="-Werror -Wno-deprecated-declarations $CFLAGS";
+ 	OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o";
+ 	LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon";
+ 	PADLL="libportaudio.dylib";

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	2009-07-16 20:22:53 UTC (rev 53938)
@@ -0,0 +1,14 @@
+--- src/common/pa_types.h.orig	2009-07-16 12:37:32.000000000 -0700
++++ src/common/pa_types.h	2009-07-16 12:37:50.000000000 -0700
+@@ -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	2009-07-16 20:22:53 UTC (rev 53938)
@@ -0,0 +1,71 @@
+--- src/hostapi/coreaudio/pa_mac_core.c.orig	2007-11-13 13:22:56.000000000 -0800
++++ src/hostapi/coreaudio/pa_mac_core.c	2009-07-16 13:05:49.000000000 -0700
+@@ -801,8 +801,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;
+@@ -873,7 +873,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." ) );
+@@ -882,7 +882,7 @@
+        return paUnanticipatedHostError;
+     }
+     /* -- open it -- */
+-    result = OpenAComponent( comp, audioUnit );
++    result = AudioComponentInstanceNew( comp, audioUnit );
+     if( result )
+     {
+        DBUG( ( "Failed to open AUHAL component." ) );
+@@ -1224,7 +1224,7 @@
+ #undef ERR_WRAP
+ 
+     error:
+-       CloseComponent( *audioUnit );
++       AudioComponentInstanceDispose( *audioUnit );
+        *audioUnit = NULL;
+        if( result )
+           return PaMacCore_SetError( result, line, 1 );
+@@ -2146,13 +2146,13 @@
+                                              xrunCallback );
+        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 )
+@@ -2211,12 +2211,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/20090716/bafa2dc8/attachment.html>


More information about the macports-changes mailing list