components/python/python27/patches/16-ossaudiodev.patch
branchs11u2-sru
changeset 3379 e99da14b537a
child 3565 2d729d36ded7
equal deleted inserted replaced
3375:3724eda7445e 3379:e99da14b537a
       
     1 This patch is needed to make Python understand it can build the OSS plugin.  
       
     2 Some OSS ioctls are not supported on Solaris, so they are ifdef'f out.  As
       
     3 the patch is Solaris-specific, it is not suitable for upstream.
       
     4 
       
     5 --- Python-2.7.7/Modules/ossaudiodev.c.~1~	2014-05-31 11:58:40.000000000 -0700
       
     6 +++ Python-2.7.7/Modules/ossaudiodev.c	2014-06-02 10:58:12.132478970 -0700
       
     7 @@ -1037,6 +1037,7 @@
       
     8      _EXPORT_INT(m, SOUND_MIXER_MONITOR);
       
     9  #endif
       
    10  
       
    11 +#ifndef __sun
       
    12      /* Expose all the ioctl numbers for masochists who like to do this
       
    13         stuff directly. */
       
    14      _EXPORT_INT(m, SNDCTL_COPR_HALT);
       
    15 @@ -1049,6 +1050,7 @@
       
    16      _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
       
    17      _EXPORT_INT(m, SNDCTL_COPR_WCODE);
       
    18      _EXPORT_INT(m, SNDCTL_COPR_WDATA);
       
    19 +#endif
       
    20  #ifdef SNDCTL_DSP_BIND_CHANNEL
       
    21      _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
       
    22  #endif
       
    23 @@ -1070,8 +1072,12 @@
       
    24      _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
       
    25  #endif
       
    26      _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
       
    27 +#ifdef SNDCTL_DSP_MAPINBUF
       
    28      _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
       
    29 +#endif
       
    30 +#ifdef SNDCTL_DSP_MAPOUTBUF
       
    31      _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
       
    32 +#endif
       
    33      _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
       
    34      _EXPORT_INT(m, SNDCTL_DSP_POST);
       
    35  #ifdef SNDCTL_DSP_PROFILE
       
    36 @@ -1091,6 +1097,7 @@
       
    37      _EXPORT_INT(m, SNDCTL_DSP_STEREO);
       
    38      _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
       
    39      _EXPORT_INT(m, SNDCTL_DSP_SYNC);
       
    40 +#ifndef __sun
       
    41      _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
       
    42      _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
       
    43      _EXPORT_INT(m, SNDCTL_MIDI_INFO);
       
    44 @@ -1132,4 +1139,5 @@
       
    45      _EXPORT_INT(m, SNDCTL_TMR_STOP);
       
    46      _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
       
    47      _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
       
    48 +#endif
       
    49  }
       
    50 --- Python-2.7.8/setup.py.~5~	2014-07-17 20:47:50.251398063 -0700
       
    51 +++ Python-2.7.8/setup.py	2014-07-17 20:47:50.359537973 -0700
       
    52 @@ -1638,8 +1638,8 @@
       
    53          else:
       
    54              missing.append('linuxaudiodev')
       
    55  
       
    56 -        if (host_platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
       
    57 -                        'freebsd7', 'freebsd8')
       
    58 +        if (host_platform in ('sunos5', 'linux2', 'freebsd4', 'freebsd5',
       
    59 +                        'freebsd6', 'freebsd7', 'freebsd8')
       
    60              or host_platform.startswith("gnukfreebsd")):
       
    61              exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
       
    62          else: