forked from pool/python-opengl
This commit is contained in:
27
python-opengl-nodisplay.patch
Normal file
27
python-opengl-nodisplay.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
--- 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'
|
||||
Reference in New Issue
Block a user