components/python/python34/patches/14-ossaudiodev.patch
author John Beck <John.Beck@Oracle.COM>
Thu, 19 Jun 2014 13:53:07 -0700
branchs11-update
changeset 3779 d01825f968e9
parent 3778 35735ffdda43
child 2183 5d00686e81da
permissions -rw-r--r--
19004593 update Python to 3.4.1

This patch is needed to make Python understand it can build the OSS plugin.  
Some OSS ioctls are not supported on Solaris, so they are ifdef'd out.  As
the patch is Solaris-specific, it is not suitable for upstream.

--- Python-3.4.1/setup.py.~6~	2014-05-27 11:05:28.340471151 -0700
+++ Python-3.4.1/setup.py	2014-05-27 11:05:28.416962700 -0700
@@ -1561,7 +1561,7 @@
         # End multiprocessing
 
         # Platform-specific libraries
-        if host_platform.startswith(('linux', 'freebsd', 'gnukfreebsd')):
+        if host_platform.startswith(('sunos5', 'linux', 'freebsd', 'gnukfreebsd')):
             exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
         else:
             missing.append('ossaudiodev')
--- Python-3.4.0/Modules/ossaudiodev.c.~1~	2014-03-16 19:31:31.000000000 -0700
+++ Python-3.4.0/Modules/ossaudiodev.c	2014-03-17 13:48:16.395254733 -0700
@@ -1211,6 +1211,7 @@
     _EXPORT_INT(m, SOUND_MIXER_MONITOR);
 #endif
 
+#ifndef __sun
     /* Expose all the ioctl numbers for masochists who like to do this
        stuff directly. */
     _EXPORT_INT(m, SNDCTL_COPR_HALT);
@@ -1223,6 +1224,7 @@
     _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
     _EXPORT_INT(m, SNDCTL_COPR_WCODE);
     _EXPORT_INT(m, SNDCTL_COPR_WDATA);
+#endif
 #ifdef SNDCTL_DSP_BIND_CHANNEL
     _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
 #endif
@@ -1244,8 +1246,12 @@
     _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
 #endif
     _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
+#ifdef SNDCTL_DSP_MAPINBUF
     _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
+#endif
+#ifdef SNDCTL_DSP_MAPOUTBUF
     _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
+#endif
     _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
     _EXPORT_INT(m, SNDCTL_DSP_POST);
 #ifdef SNDCTL_DSP_PROFILE
@@ -1265,6 +1271,7 @@
     _EXPORT_INT(m, SNDCTL_DSP_STEREO);
     _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
     _EXPORT_INT(m, SNDCTL_DSP_SYNC);
+#ifndef __sun
     _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
     _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
     _EXPORT_INT(m, SNDCTL_MIDI_INFO);
@@ -1306,5 +1313,6 @@
     _EXPORT_INT(m, SNDCTL_TMR_STOP);
     _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
     _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
+#endif
     return m;
 }