components/python/python34/patches/14-ossaudiodev.patch
author John Beck <John.Beck@Oracle.COM>
Fri, 06 Feb 2015 16:50:21 -0800
branchs11-update
changeset 3796 82cd21906ac2
parent 3786 fa9d2da4d216
child 3869 eb4c6284602f
permissions -rw-r--r--
20494432 skip Python test_gdb for version 3.4

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.2/setup.py.~6~	2014-09-22 14:17:20.562920233 -0700
+++ Python-3.4.2/setup.py	2014-09-22 14:17:20.631967980 -0700
@@ -1569,7 +1569,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;
 }