1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, pkgs
5, pillow
6}:
7
8buildPythonPackage rec {
9 pname = "pyopengl";
10 version = "3.1.4";
11
12 src = fetchPypi {
13 pname = "PyOpenGL";
14 inherit version;
15 sha256 = "0bdf5ed600df30c8830455702338902528717c0af85ac5914f1dc5aa0bfa6eee";
16 };
17
18 propagatedBuildInputs = [ pkgs.libGLU pkgs.libGL pkgs.freeglut pillow ];
19
20 patchPhase = let
21 ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
22 substituteInPlace OpenGL/platform/glx.py \
23 --replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
24 --replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \
25 --replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'"
26 substituteInPlace OpenGL/platform/darwin.py \
27 --replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
28 --replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'"
29 '';
30
31 # Need to fix test runner
32 # Tests have many dependencies
33 # Extension types could not be found.
34 # Should run test suite from $out/${python.sitePackages}
35 doCheck = false;
36
37 meta = with stdenv.lib; {
38 homepage = http://pyopengl.sourceforge.net/;
39 description = "PyOpenGL, the Python OpenGL bindings";
40 longDescription = ''
41 PyOpenGL is the cross platform Python binding to OpenGL and
42 related APIs. The binding is created using the standard (in
43 Python 2.5) ctypes library, and is provided under an extremely
44 liberal BSD-style Open-Source license.
45 '';
46 license = "BSD-style";
47 platforms = platforms.mesaPlatforms;
48 };
49
50
51}