Files
nixpkgs/pkgs/development/python-modules/moderngl/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

54 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
libGL,
libX11,
setuptools,
glcontext,
pythonOlder,
}:
buildPythonPackage rec {
pname = "moderngl";
version = "5.12.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-UpNqmMyy8uHW48sYUospGfaDHn4/kk54i1hzutzlEps=";
};
postPatch = ''
substituteInPlace _moderngl.py \
--replace-fail '"libGL.so"' '"${libGL}/lib/libGL.so"' \
--replace-fail '"libEGL.so"' '"${libGL}/lib/libEGL.so"'
'';
build-system = [ setuptools ];
buildInputs = [
libGL
libX11
];
dependencies = [ glcontext ];
# Tests need a display to run.
doCheck = false;
pythonImportsCheck = [ "moderngl" ];
meta = {
description = "High performance rendering for Python";
homepage = "https://github.com/moderngl/moderngl";
changelog = "https://github.com/moderngl/moderngl/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ c0deaddict ];
# should be mesa.meta.platforms, darwin build breaks.
platforms = lib.platforms.linux;
};
}