File python-opengl-nodisplay.patch of Package python-opengl
--- setup/togl_setup.py
+++ setup/togl_setup.py
@@ -20,11 +20,22 @@
import distutils.command.build_ext
from distutils.dep_util import newer_group
+##### fake Tkinter object
+class FakeTk:
+ def __init__ (self):
+ import _tkinter
+ self.tk = _tkinter
+
+ def getvar (self,name):
+ if name == 'tk_version': return self.tk.TK_VERSION
+ if name == 'tcl_version': return self.tk.TCL_VERSION
+ if name == 'tk_library': return '/usr/share/tcl/tk'+self.tk.TK_VERSION
+ if name == 'tcl_library': return '/usr/share/tcl/tcl'+self.tk.TCL_VERSION
+
# this is also a simple test if we need to build Togl
# without Tkinter it is not neccessary
try:
- import Tkinter
- tk = Tkinter.Tk()
+ tk = FakeTk()
if tk.getvar('tk_version') < '8.1' or tk.getvar('tcl_version') < '8.1':
Togl = 'Togl-1.5'
togl_version_decimal = '1.5.0'