8 buildPythonPackage rec {
15 sha256 = "0bdf5ed600df30c8830455702338902528717c0af85ac5914f1dc5aa0bfa6eee";
18 propagatedBuildInputs = [ pillow ];
21 ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
22 # Theses lines are patching the name of dynamic libraries
23 # so pyopengl can find them at runtime.
24 substituteInPlace OpenGL/platform/glx.py \
25 --replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
26 --replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \
27 --replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'"
28 substituteInPlace OpenGL/platform/darwin.py \
29 --replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
30 --replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'"
32 # https://github.com/NixOS/nixpkgs/issues/76822
33 # pyopengl introduced a new "robust" way of loading libraries in 3.1.4.
34 # The later patch of the filepath does not work anymore because
35 # pyopengl takes the "name" (for us: the path) and tries to add a
36 # few suffix during its loading phase.
37 # The following patch put back the "name" (i.e. the path) in the
38 # list of possible files.
39 substituteInPlace OpenGL/platform/ctypesloader.py \
40 --replace "filenames_to_try = []" "filenames_to_try = [name]"
43 # Need to fix test runner
44 # Tests have many dependencies
45 # Extension types could not be found.
46 # Should run test suite from $out/${python.sitePackages}
50 homepage = "http://pyopengl.sourceforge.net/";
51 description = "PyOpenGL, the Python OpenGL bindings";
53 PyOpenGL is the cross platform Python binding to OpenGL and
54 related APIs. The binding is created using the standard (in
55 Python 2.5) ctypes library, and is provided under an extremely
56 liberal BSD-style Open-Source license.
58 license = "BSD-style";
59 platforms = platforms.mesaPlatforms;