#1029936 python3-opengl: Fail to run without freeclut3 installed - glutInit() fail with NullFunctionError

#1029936#5
Date:
2023-01-29 08:58:51 UTC
From:
To:
Dear Maintainer,

We ran into a problem with LinuxCNC, see
<URL: https://github.com/LinuxCNC/linuxcnc/issues/1599 > and
<URL: https://github.com/LinuxCNC/linuxcnc/pull/2259 >.  We have run into
several OpenGL related issues in Bookworm, like
<URL: https://bugs.debian.org/1029011 > and hope to have them adressed
before the freeze.

We have been able to reproduce at leaset one of the problems with this
simple test program:

  #!/usr/bin/python3
  from OpenGL.GL import *
  from OpenGL.GLUT import *
  from OpenGL.GLU import *
  glutInit()

When running it in Bookworm I get this backtrace:

  Traceback (most recent call last):
    File "/home/linuxcnc/src/x.py", line 7, in <module>
      glutInit()
    File "/usr/lib/python3/dist-packages/OpenGL/GLUT/special.py", line 333, in glutInit
      _base_glutInit( ctypes.byref(count), holder )
    File "/usr/lib/python3/dist-packages/OpenGL/platform/baseplatform.py", line 423, in __call__
      raise error.NullFunctionError(
  OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

This error do not occur when installing freeglut3_2.8.1-6_amd64.deb from
snapshots.  Trying to install the latest version of freeglut from
Bookworm, libglut3.12, did not solve the problem.  I suspect a
dependency is missing and some code need to be updated to work with
libglut3.12.

Perhaps the problematic code could be turned into a script in
debian/tests/ to ensure this keep working in the future?