summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2017-11-17 12:49:22 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2017-11-17 13:06:32 +0100
commit2f8bc04032a355f04488f5c9e91f80f073564a40 (patch)
tree9af89074d3a11d374e6b7b663c3d7071c46f4c19
parente25524cd32c4205c7cf86a967c9f63b332c9f3bb (diff)
Move portaudio-binaries submodule
... in order to be able to properly import _sounddevice_data, even on Python 2.x
-rw-r--r--.gitmodules4
-rw-r--r--_sounddevice_data/__init__.py0
m---------_sounddevice_data/portaudio-binaries (renamed from _sounddevice_data)0
-rw-r--r--setup.py5
-rw-r--r--src/sounddevice.py4
5 files changed, 7 insertions, 6 deletions
diff --git a/.gitmodules b/.gitmodules
index 9010351..40506c1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "_sounddevice_data"]
- path = _sounddevice_data
+[submodule "portaudio-binaries"]
+ path = _sounddevice_data/portaudio-binaries
url = https://github.com/spatialaudio/portaudio-binaries.git
diff --git a/_sounddevice_data/__init__.py b/_sounddevice_data/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/_sounddevice_data/__init__.py
diff --git a/_sounddevice_data b/_sounddevice_data/portaudio-binaries
-Subproject bab7ef6a62415c2c83bdb632585fa439d3edc48
+Subproject bab7ef6a62415c2c83bdb632585fa439d3edc48
diff --git a/setup.py b/setup.py
index 7af08ee..37d645a 100644
--- a/setup.py
+++ b/setup.py
@@ -33,9 +33,10 @@ elif system == 'Windows':
else:
libname = None
-if libname and os.path.isdir('_sounddevice_data'):
+if libname and os.path.isdir('_sounddevice_data/portaudio-binaries'):
packages = ['_sounddevice_data']
- package_data = {'_sounddevice_data': [libname, 'README.md']}
+ package_data = {'_sounddevice_data': ['portaudio-binaries/' + libname,
+ 'portaudio-binaries/README.md']}
package_dir['_sounddevice_data'] = '_sounddevice_data'
zip_safe = False
else:
diff --git a/src/sounddevice.py b/src/sounddevice.py
index 7ca9d43..3cf4d52 100644
--- a/src/sounddevice.py
+++ b/src/sounddevice.py
@@ -68,8 +68,8 @@ except OSError:
else:
raise
import _sounddevice_data
- _lib = _ffi.dlopen(
- _os.path.join(next(iter(_sounddevice_data.__path__)), _libname))
+ _lib = _ffi.dlopen(_os.path.join(next(iter(_sounddevice_data.__path__)),
+ 'portaudio-binaries', _libname))
_sampleformats = {
'float32': _lib.paFloat32,