Skip to content

Commit

Permalink
Standalone: Include OpenGL DLLs for PyQt apps using QML on Windows (#272
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
  • Loading branch information
BoboTiG authored and kayhayen committed Feb 21, 2019
1 parent 51787d6 commit a9443b8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nuitka/plugins/Plugins.py
Expand Up @@ -110,7 +110,7 @@ def considerExtraDlls(dist_dir, module):
for extra_dll in plugin.considerExtraDlls(dist_dir, module):
if not os.path.isfile(extra_dll[0]):
sys.exit(
"Error, attempting to copy plugin determinted filename %r for module %r that is not a file."
"Error, attempting to copy plugin determined filename %r for module %r that is not a file."
% (extra_dll[0], module.getFullName())
)

Expand Down
22 changes: 22 additions & 0 deletions nuitka/plugins/standard/PySidePyQtPlugin.py
Expand Up @@ -98,6 +98,8 @@ def hasPluginFamily(plugin_dir, family):
return False

def considerExtraDlls(self, dist_dir, module):
# pylint: disable=too-many-branches,too-many-locals

full_name = module.getFullName()

if full_name in ("PyQt4", "PyQt5"):
Expand Down Expand Up @@ -218,6 +220,26 @@ def considerExtraDlls(self, dist_dir, module):
if not os.path.basename(filename) == "qmldir"
]

# Also copy required OpenGL DLLs on Windows
if os.name == "nt":
qt_bin_dir = os.path.normpath(os.path.join(plugin_dir, "..", "bin"))
opengl_dlls = (
"libegl.dll",
"libglesv2.dll",
"opengl32sw.dll",
)

info("Copying OpenGL DLLs to %r" % (dist_dir,))

for filename in getFileList(qt_bin_dir):
basename = os.path.basename(filename).lower()

if basename in opengl_dlls or basename.startswith("d3dcompiler_"):
shutil.copy(
filename,
os.path.join(dist_dir, basename)
)

return result

return ()
Expand Down

0 comments on commit a9443b8

Please sign in to comment.