depot/third_party/nixpkgs/pkgs/development/python-modules/glcontext/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

52 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
libGL,
libX11,
}:
buildPythonPackage rec {
pname = "glcontext";
version = "3.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "moderngl";
repo = "glcontext";
rev = "refs/tags/${version}";
hash = "sha256-GC2sb6xQjg99xLcXSynLOOyyqNwCHZwZqrs9RZh99pY=";
};
build-system = [ setuptools ];
buildInputs = [
libGL
libX11
];
postPatch = ''
substituteInPlace glcontext/x11.cpp \
--replace-fail '"libGL.so"' '"${libGL}/lib/libGL.so"' \
--replace-fail '"libX11.so"' '"${libX11}/lib/libX11.so"'
substituteInPlace glcontext/egl.cpp \
--replace-fail '"libGL.so"' '"${libGL}/lib/libGL.so"' \
--replace-fail '"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 = [ ];
};
}