Skip to content

Commit

Permalink
(py2app) explicitely include libportaudio.dylib outside of the python…
Browse files Browse the repository at this point in the history
…XXX.zip bundle
  • Loading branch information
tlecomte committed Jan 15, 2018
1 parent afaa17c commit 9d2f21b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os.path
import numpy
import friture # for the version number
import sounddevice # to find the libportaudio.dylib path

py2exe_build = False
py2app_build = False
Expand Down Expand Up @@ -127,10 +128,20 @@
)

elif py2app_build:
# by default libportaudio.dylib is copied inside the pythonXXX.zip bundle,
# but a library cannot be loaded from inside such a bundle
# so copy it explicitely instead
base = os.path.dirname(sounddevice.__file__)
libportaudio_path = os.path.join(base, "_sounddevice_data", "portaudio-binaries", "libportaudio.dylib")

py2app_options = {'includes': includes,
'iconfile': 'resources/images/friture.icns',
'frameworks': [libportaudio_path]}

extra_options = dict(
setup_requires=['py2app'],
app=['main.py'],
options={'py2app': {'includes': includes, 'iconfile': 'resources/images/friture.icns'}},
options={'py2app': py2app_options},
)
else:
extra_options = dict()
Expand Down

0 comments on commit 9d2f21b

Please sign in to comment.