anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / sounddevice / fix-portaudio-library-path.patch
blob6ec399e25d5f3f3b5e37cd5cef83856f3c534157
1 diff --git a/sounddevice.py b/sounddevice.py
2 index 0974289..2d56c28 100644
3 --- a/sounddevice.py
4 +++ b/sounddevice.py
5 @@ -58,32 +58,7 @@ from ctypes.util import find_library as _find_library
6 from _sounddevice import ffi as _ffi
9 -try:
10 - for _libname in (
11 - 'portaudio', # Default name on POSIX systems
12 - 'bin\\libportaudio-2.dll', # DLL from conda-forge
13 - 'lib/libportaudio.dylib', # dylib from anaconda
14 - ):
15 - _libname = _find_library(_libname)
16 - if _libname is not None:
17 - break
18 - else:
19 - raise OSError('PortAudio library not found')
20 - _lib = _ffi.dlopen(_libname)
21 -except OSError:
22 - if _platform.system() == 'Darwin':
23 - _libname = 'libportaudio.dylib'
24 - elif _platform.system() == 'Windows':
25 - if 'SD_ENABLE_ASIO' in _os.environ:
26 - _libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
27 - else:
28 - _libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
29 - else:
30 - raise
31 - import _sounddevice_data
32 - _libname = _os.path.join(
33 - next(iter(_sounddevice_data.__path__)), 'portaudio-binaries', _libname)
34 - _lib = _ffi.dlopen(_libname)
35 +_lib = _ffi.dlopen('@portaudio@')
37 _sampleformats = {
38 'float32': _lib.paFloat32,