From 0f5e6abc118f71ef3fd07282dbdbbb78f834c50b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 2 Aug 2016 15:55:24 +0200 Subject: [PATCH] freeze.py: Copy plugin folders on Windows This makes HTML5 video work. Fixes #1068. --- scripts/dev/freeze.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/dev/freeze.py b/scripts/dev/freeze.py index 6c269e890..33de7e9ce 100755 --- a/scripts/dev/freeze.py +++ b/scripts/dev/freeze.py @@ -49,6 +49,16 @@ def get_egl_path(): r'PyQt5\libEGL.dll') +def get_plugin_folders(): + """Get the plugin folders to copy to the output.""" + if not sys.platform.startswith('win'): + return [] + plugin_dir = os.path.join(distutils.sysconfig.get_python_lib(), + 'PyQt5', 'plugins') + folders = ['audio', 'iconengines', 'mediaservice', 'printsupport'] + return [os.path.join(plugin_dir, folder) for folder in folders] + + def get_build_exe_options(skip_html=False): """Get the options passed as build_exe_options to cx_Freeze. @@ -81,6 +91,8 @@ def get_build_exe_options(skip_html=False): if egl_path is not None: include_files.append((egl_path, 'libEGL.dll')) + include_files += get_plugin_folders() + return { 'include_files': include_files, 'include_msvcr': True,