92b3d6365d
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, isPy3k
|
|
, libGL
|
|
, libX11
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "glcontext";
|
|
version = "2.3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "moderngl";
|
|
repo = pname;
|
|
rev = "refs/tags/${version}";
|
|
sha256 = "sha256-U/oP9nx7iTK6EYbUl90UD7fTOo5oDlh9ULPNjRibsXE=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|