components/python/python26/patches/Python26-29-ossaudiodev.patch
changeset 1246 164605dfef4e
equal deleted inserted replaced
1245:b95e96615c0c 1246:164605dfef4e
       
     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 commented out.
       
     3 
       
     4 --- Python-2.6.8/Modules/ossaudiodev.c-orig	2012-12-20 12:18:06.404742520 -0600
       
     5 +++ Python-2.6.8/Modules/ossaudiodev.c	2012-12-20 12:21:01.352610160 -0600
       
     6 @@ -1038,6 +1038,7 @@ initossaudiodev(void)
       
     7      _EXPORT_INT(m, SOUND_MIXER_MONITOR);
       
     8  #endif
       
     9  
       
    10 +#ifndef __sun
       
    11      /* Expose all the ioctl numbers for masochists who like to do this
       
    12         stuff directly. */
       
    13      _EXPORT_INT(m, SNDCTL_COPR_HALT);
       
    14 @@ -1050,6 +1051,7 @@ initossaudiodev(void)
       
    15      _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
       
    16      _EXPORT_INT(m, SNDCTL_COPR_WCODE);
       
    17      _EXPORT_INT(m, SNDCTL_COPR_WDATA);
       
    18 +#endif
       
    19  #ifdef SNDCTL_DSP_BIND_CHANNEL
       
    20      _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
       
    21  #endif
       
    22 @@ -1071,8 +1073,12 @@ initossaudiodev(void)
       
    23      _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
       
    24  #endif
       
    25      _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
       
    26 +#ifdef SNDCTL_DSP_MAPINBUF
       
    27      _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
       
    28 +#endif
       
    29 +#ifdef SNDCTL_DSP_MAPOUTBUF
       
    30      _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
       
    31 +#endif
       
    32      _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
       
    33      _EXPORT_INT(m, SNDCTL_DSP_POST);
       
    34  #ifdef SNDCTL_DSP_PROFILE
       
    35 @@ -1092,6 +1098,7 @@ initossaudiodev(void)
       
    36      _EXPORT_INT(m, SNDCTL_DSP_STEREO);
       
    37      _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
       
    38      _EXPORT_INT(m, SNDCTL_DSP_SYNC);
       
    39 +#ifndef __sun
       
    40      _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
       
    41      _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
       
    42      _EXPORT_INT(m, SNDCTL_MIDI_INFO);
       
    43 @@ -1133,4 +1140,5 @@ initossaudiodev(void)
       
    44      _EXPORT_INT(m, SNDCTL_TMR_STOP);
       
    45      _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
       
    46      _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
       
    47 +#endif
       
    48  }
       
    49 --- Python-2.6.8/setup.py-orig	2012-12-20 12:18:00.466612795 -0600
       
    50 +++ Python-2.6.8/setup.py	2012-12-20 12:18:54.828151818 -0600
       
    51 @@ -1518,7 +1518,7 @@ class PyBuildExt(build_ext):
       
    52          else:
       
    53              missing.append('linuxaudiodev')
       
    54  
       
    55 -        if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
       
    56 +        if platform in ('sunos5', 'linux2', 'freebsd4', 'freebsd5', 'freebsd6',
       
    57                          'freebsd7', 'freebsd8'):
       
    58              exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
       
    59          else: