From fc037ed4dd0fc322cfba56d6eda9b4a95580d91c Mon Sep 17 00:00:00 2001 From: lmancini Date: Wed, 31 Dec 2008 13:31:16 +0000 Subject: [PATCH] Add hook for PyOpenGL v3.0.0b6 and newer git-svn-id: http://svn.pyinstaller.org/trunk@587 8dd32b29-ccff-0310-8a9a-9233e24343b1 --- hooks/hook-OpenGL.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hooks/hook-OpenGL.py diff --git a/hooks/hook-OpenGL.py b/hooks/hook-OpenGL.py new file mode 100644 index 0000000..2f30bcb --- /dev/null +++ b/hooks/hook-OpenGL.py @@ -0,0 +1,39 @@ +## Hook for PyOpenGL 3.x versions from 3.0.0b6 up. Previous versions have a +## plugin system based on pkg_resources which is problematic to handle correctly +## under pyinstaller; 2.x versions used to run fine without hooks, so this one +## shouldn't hurt. + +import os +import sys + +## PlatformPlugin performs a conditional import based on os.name and +## sys.platform. pyinstaller misses this so let's add it ourselves... + +if os.name == 'nt': + hiddenimports = ['OpenGL.platform.win32'] +else: + if sys.platform == 'linux2': + hiddenimports = ['OpenGL.platform.glx'] + elif sys.platform == 'darwin': + hiddenimports = ['OpenGL.platform.darwin'] + else: + print 'ERROR: hook-OpenGL: Unrecognised combo (os.name: %s, sys.platform: %s)' % (os.name, sys.platform) + + +## arrays modules are needed too + +hiddenimports += ['OpenGL.arrays.ctypesparameters', + 'OpenGL.arrays.numarrays', + 'OpenGL.arrays._numeric', + 'OpenGL.arrays._strings', + 'OpenGL.arrays.ctypespointers', + 'OpenGL.arrays.lists', + 'OpenGL.arrays.numbers', + 'OpenGL.arrays.numeric', + 'OpenGL.arrays.strings', + 'OpenGL.arrays.ctypesarrays', + 'OpenGL.arrays.nones', + 'OpenGL.arrays.numericnames', + 'OpenGL.arrays.numpymodule', + 'OpenGL.arrays.vbo', + ]