1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 isPy3k, 6 libGL, 7 libX11, 8}: 9 10buildPythonPackage rec { 11 pname = "glcontext"; 12 version = "2.5.0"; 13 format = "setuptools"; 14 15 src = fetchFromGitHub { 16 owner = "moderngl"; 17 repo = pname; 18 rev = "refs/tags/${version}"; 19 hash = "sha256-ld+INKIGDZA2Y+sTxDPY7MI1nru6x+FeixngaJQzKkg="; 20 }; 21 22 disabled = !isPy3k; 23 24 buildInputs = [ 25 libGL 26 libX11 27 ]; 28 29 postPatch = '' 30 substituteInPlace glcontext/x11.cpp \ 31 --replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \ 32 --replace '"libX11.so"' '"${libX11}/lib/libX11.so"' 33 substituteInPlace glcontext/egl.cpp \ 34 --replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \ 35 --replace '"libEGL.so"' '"${libGL}/lib/libEGL.so"' 36 ''; 37 38 # Tests fail because they try to open display. See 39 # https://github.com/NixOS/nixpkgs/pull/121439 40 # for details. 41 doCheck = false; 42 43 pythonImportsCheck = [ "glcontext" ]; 44 45 meta = with lib; { 46 homepage = "https://github.com/moderngl/glcontext"; 47 description = "OpenGL implementation for ModernGL"; 48 license = licenses.mit; 49 platforms = platforms.linux; 50 maintainers = with maintainers; [ friedelino ]; 51 }; 52}