Files
nixpkgs/pkgs/development/python-modules/glcontext/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

53 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";
tag = 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 = {
homepage = "https://github.com/moderngl/glcontext";
description = "OpenGL implementation for ModernGL";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ ];
};
}