Commit d33efb32 authored by talljosh's avatar talljosh

buildtools: on Windows, include the necessary DLLs for Pygame audio to work.

parent 754e6c049b40
......@@ -10,7 +10,7 @@ import sys
from PyInstaller.building.api import PYZ, EXE
from PyInstaller.building.build_main import Analysis
from PyInstaller.utils.hooks import (
collect_submodules, get_module_file_attribute,
collect_submodules, get_module_file_attribute, collect_dynamic_libs,
)
......@@ -160,11 +160,11 @@ def get_django_bits(spec_path):
return result
def build_exe(script_name, datas=(), hiddenimports=(), excludes=(), exe_name=None, console=True):
def build_exe(script_name, datas=(), hiddenimports=(), excludes=(), exe_name=None, console=True, binaries=()):
a = Analysis(
['scripts/' + script_name],
pathex=[base_dir],
binaries=[],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
......@@ -244,10 +244,15 @@ def get_support_bits(spec_path):
def get_trosnoth_app_bits(spec_path):
if os.name == 'nt':
binaries = [(b, '.') for b, _ in collect_dynamic_libs('pygame')]
else:
binaries = ()
return build_exe(
'trosnoth',
# Avoid name collision with trosnoth folder
exe_name='trosnoth' if os.name == 'nt' else 'trosnothapp',
binaries=binaries,
datas=[
('trosnoth/data/achievements/*.png', 'trosnoth/data/achievements'),
('trosnoth/data/blocks/*.block', 'trosnoth/data/blocks'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment