depot/third_party/nixpkgs/pkgs/development/python-modules/glcontext/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

52 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
isPy3k,
libGL,
libX11,
}:
buildPythonPackage rec {
pname = "glcontext";
version = "2.5.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "moderngl";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-ld+INKIGDZA2Y+sTxDPY7MI1nru6x+FeixngaJQzKkg=";
};
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; [ ];
};
}