From cd78d8a4e41439329fe2f27c5908bedc7c42f1d2 Mon Sep 17 00:00:00 2001 From: Chidi Williams Date: Wed, 3 Jan 2024 23:58:49 +0000 Subject: [PATCH] fix: execstack --- Buzz.spec | 67 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/Buzz.spec b/Buzz.spec index d87721ae6..3e8f00f4a 100644 --- a/Buzz.spec +++ b/Buzz.spec @@ -5,32 +5,39 @@ import shutil from PyInstaller.utils.hooks import collect_data_files, copy_metadata -from buzz.__version__ import VERSION - datas = [] -datas += collect_data_files('torch') -datas += copy_metadata('tqdm') -datas += copy_metadata('torch') -datas += copy_metadata('regex') -datas += copy_metadata('requests') -datas += copy_metadata('packaging') -datas += copy_metadata('filelock') -datas += copy_metadata('numpy') -datas += copy_metadata('tokenizers') -# Allow transformers package to load __init__.py file dynamically: -# https://github.com/chidiwilliams/buzz/issues/272 -datas += collect_data_files('transformers', include_py_files=True) +if platform.system() != "Linux": + datas += collect_data_files("torch") + +datas += copy_metadata("tqdm") + +if platform.system() != "Linux": + datas += copy_metadata("torch") + +datas += copy_metadata("regex") +datas += copy_metadata("requests") +datas += copy_metadata("packaging") +datas += copy_metadata("filelock") +datas += copy_metadata("numpy") +datas += copy_metadata("tokenizers") + +if platform.system() != "Linux": + # Allow transformers package to load __init__.py file dynamically: + # https://github.com/chidiwilliams/buzz/issues/272 + datas += collect_data_files("transformers", include_py_files=True) + datas += collect_data_files("whisper") -datas += collect_data_files('whisper') -datas += [(file[1], os.path.dirname(file[1])) for file in - Tree('./locale', prefix='locale', excludes=['*.po'])] -datas += [(shutil.which('ffmpeg'), '.')] +datas += [ + (file[1], os.path.dirname(file[1])) + for file in Tree("./locale", prefix="locale", excludes=["*.po"]) +] +datas += [(shutil.which("ffmpeg"), ".")] block_cipher = None a = Analysis( - ['main.py'], + ["main.py"], pathex=[], binaries=[], datas=datas, @@ -50,9 +57,9 @@ exe = EXE( pyz, a.scripts, [], - icon='./assets/buzz.ico', + icon="./assets/buzz.ico", exclude_binaries=True, - name='Buzz', + name="Buzz", debug=True, bootloader_ignore_signals=False, strip=False, @@ -72,17 +79,17 @@ coll = COLLECT( strip=False, upx=False, upx_exclude=[], - name='Buzz', + name="Buzz", ) app = BUNDLE( coll, - name='Buzz.app', - icon='./assets/buzz.icns', - bundle_identifier='com.chidiwilliams.buzz', - version='0.8.4', + name="Buzz.app", + icon="./assets/buzz.icns", + bundle_identifier="com.chidiwilliams.buzz", + version="0.8.4", info_plist={ - 'NSPrincipalClass': 'NSApplication', - 'NSHighResolutionCapable': 'True', - 'NSMicrophoneUsageDescription': 'Allow Buzz to record audio from your microphone.' - } + "NSPrincipalClass": "NSApplication", + "NSHighResolutionCapable": "True", + "NSMicrophoneUsageDescription": "Allow Buzz to record audio from your microphone.", + }, )