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'd out. As
3 the patch is Solaris-specific, it is not suitable for upstream.
4 --- Python-3.7.4/setup.py
5 +++ Python-3.7.4/setup.py
6 @@ -1713,7 +1713,7 @@ class PyBuildExt(build_ext):
9 # Platform-specific libraries
10 - if host_platform.startswith(('linux', 'freebsd', 'gnukfreebsd')):
11 + if host_platform.startswith(('sunos5', 'linux', 'freebsd', 'gnukfreebsd')):
12 exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
14 missing.append('ossaudiodev')
15 --- Python-3.7.4/Modules/ossaudiodev.c
16 +++ Python-3.7.4/Modules/ossaudiodev.c
17 @@ -1213,6 +1213,7 @@ PyInit_ossaudiodev(void)
18 _EXPORT_INT(m, SOUND_MIXER_MONITOR);
22 /* Expose all the ioctl numbers for masochists who like to do this
24 _EXPORT_INT(m, SNDCTL_COPR_HALT);
25 @@ -1225,6 +1226,7 @@ PyInit_ossaudiodev(void)
26 _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
27 _EXPORT_INT(m, SNDCTL_COPR_WCODE);
28 _EXPORT_INT(m, SNDCTL_COPR_WDATA);
30 #ifdef SNDCTL_DSP_BIND_CHANNEL
31 _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
33 @@ -1246,8 +1248,12 @@ PyInit_ossaudiodev(void)
34 _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF);
36 _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER);
37 +#ifdef SNDCTL_DSP_MAPINBUF
38 _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF);
40 +#ifdef SNDCTL_DSP_MAPOUTBUF
41 _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF);
43 _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK);
44 _EXPORT_INT(m, SNDCTL_DSP_POST);
45 #ifdef SNDCTL_DSP_PROFILE
46 @@ -1267,6 +1273,7 @@ PyInit_ossaudiodev(void)
47 _EXPORT_INT(m, SNDCTL_DSP_STEREO);
48 _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
49 _EXPORT_INT(m, SNDCTL_DSP_SYNC);
51 _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
52 _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
53 _EXPORT_INT(m, SNDCTL_MIDI_INFO);
54 @@ -1308,5 +1315,6 @@ PyInit_ossaudiodev(void)
55 _EXPORT_INT(m, SNDCTL_TMR_STOP);
56 _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
57 _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);