diff --git a/.github/workflows/install-macos.sh b/.github/workflows/install-macos.sh index 96ec4c4b..ff3ebece 100644 --- a/.github/workflows/install-macos.sh +++ b/.github/workflows/install-macos.sh @@ -10,12 +10,22 @@ pip3 install -r requirements.txt # pyinstaller needs to have the extensions built explicitely python3 setup.py build_ext --inplace +# for Macos Big Sur, the stable portaudio (19.6.0) makes Friture freeze on startup +# install from latest master instead +# see: https://github.com/tlecomte/friture/issues/154 +brew install portaudio --HEAD + pip3 install -U pyinstaller==4.2 pyinstaller friture.spec -y --onedir --windowed ls -la dist/* +# compare the portaudio libs to make the package contains the one that was installed with brew +ls -la /usr/local/lib/libportaudio.dylib +ls -la /usr/local/Cellar/portaudio/*/lib/libportaudio.dylib +ls -la dist/friture.app/Contents/MacOS/_sounddevice_data/portaudio-binaries + # prepare a dmg out of friture.app export ARTIFACT_FILENAME=friture-$(python3 -c 'import friture; print(friture.__version__)')-$(date +'%Y%m%d').dmg echo $ARTIFACT_FILENAME diff --git a/friture.spec b/friture.spec index ad30e500..3ad4df65 100644 --- a/friture.spec +++ b/friture.spec @@ -84,20 +84,26 @@ excluded_binaries = [ 'QtWebKitWidgets.framework', 'QtWebSockets.framework'] +pathex = [] +binaries = [] + if platform.system() == "Windows": # workaround for PyInstaller that does not look where the new PyQt5 official wheels put the Qt dlls from PyInstaller.compat import getsitepackages - pathex = [os.path.join(x, 'PyQt5', 'Qt', 'bin') for x in getsitepackages()] + pathex += [os.path.join(x, 'PyQt5', 'Qt', 'bin') for x in getsitepackages()] - # add vcruntime140.dll - PyInstaller excludes it by default because it thinks it comes from c:\Windows - binaries = [('vcruntime140.dll', 'C:\\Python39\\vcruntime140.dll', 'BINARY')] -else: - pathex = [] - binaries = [] +# for Macos Big Sur, the stable portaudio (19.6.0) makes Friture freeze on startup +# install from latest master instead with homebrew +# and include it in the package +if platform.system() == "Darwin": + libportaudio_path = "/usr/local/lib/libportaudio.dylib" + if not os.path.isfile(libportaudio_path): + raise ValueError('libportaudio could not be found') + binaries += [(libportaudio_path, os.path.join("_sounddevice_data", "portaudio-binaries"))] a = Analysis(['main.py'], pathex=pathex, - binaries=None, + binaries=binaries, datas=[], hiddenimports=[], hookspath=[], @@ -123,7 +129,7 @@ exe = EXE(pyz, icon="resources/images/friture.ico") coll = COLLECT(exe, - a.binaries + binaries, + a.binaries, a.zipfiles, a.datas, strip=False,