3
0
Fork 0
forked from mirrors/nixpkgs

glcontext: init at 2.3.3 and add as moderngl dep

This commit is contained in:
Frido Friedemann 2021-04-30 16:11:46 +02:00 committed by Jonathan Ringer
parent 7b056fe82d
commit d52e8aaab5
4 changed files with 55 additions and 2 deletions

View file

@ -0,0 +1,49 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy3k
, libGL
, libX11
, pytestCheckHook
, psutil
}:
buildPythonPackage rec {
pname = "glcontext";
version = "2.3.3";
src = fetchFromGitHub {
owner = "moderngl";
repo = pname;
rev = version;
sha256 = "16kwrfjijn9bnb48rk17wapmhxq6g9s59zczh65imyncb9k82wkc";
};
disabled = !isPy3k;
buildInputs = [ libGL libX11 ];
postPatch = ''
substituteInPlace glcontext/x11.cpp \
--replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \
--replace '"libX11.so"' '"${libX11}/lib/libX11.so"'
substituteInPlace glcontext/egl.cpp \
--replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \
--replace '"libEGL.so"' '"${libGL}/lib/libEGL.so"'
'';
# Tests fail because they try to open display. See
# https://github.com/NixOS/nixpkgs/pull/121439
# for details.
doCheck = false;
pythonImportsCheck = [ "glcontext" ];
meta = with lib; {
homepage = "https://github.com/moderngl/glcontext";
description = "OpenGL implementation for ModernGL";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ friedelino ];
};
}

View file

@ -4,6 +4,7 @@
, isPy3k
, libGL
, libX11
, glcontext
}:
buildPythonPackage rec {
@ -17,7 +18,7 @@ buildPythonPackage rec {
disabled = !isPy3k;
buildInputs = [ libGL libX11 ];
buildInputs = [ libGL libX11 glcontext ];
# Tests need a display to run.
doCheck = false;

View file

@ -7,6 +7,7 @@
, pyglet
, pillow
, pyrr
, glcontext
}:
buildPythonPackage rec {
@ -20,7 +21,7 @@ buildPythonPackage rec {
sha256 = "1p03j91pk2bwycd13p0qi8kns1sf357180hd2mkaip8mfaf33x3q";
};
propagatedBuildInputs = [ numpy moderngl pyglet pillow pyrr ];
propagatedBuildInputs = [ numpy moderngl pyglet pillow pyrr glcontext ];
disabled = !isPy3k;

View file

@ -2725,6 +2725,8 @@ in {
glasgow = callPackage ../development/python-modules/glasgow { };
glcontext = callPackage ../development/python-modules/glcontext { };
glob2 = callPackage ../development/python-modules/glob2 { };
globre = callPackage ../development/python-modules/globre { };