From 9d2f21b06bca6e567af9ad3f7f3ff1e7c20f31cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Lecomte?= Date: Mon, 15 Jan 2018 21:43:33 +0100 Subject: [PATCH] (py2app) explicitely include libportaudio.dylib outside of the pythonXXX.zip bundle --- setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2e862471..d039c0ad 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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()