21 buildPythonPackage rec {
26 disabled = pythonOlder "3.5";
28 src = fetchFromGitHub {
31 rev = "refs/tags/${version}";
32 hash = "sha256-V2G8QWXMxFDQpT4XDOJhIFI2V9VhDQCaXYBb/QVLxgM=";
38 name = "relax-pyopengl.patch";
39 url = "https://github.com/mmatl/pyrender/commit/7c613e8aed7142df9ff40767a8f10b7a19b6255c.patch";
40 hash = "sha256-SXRV9RC3PfQGjjIQ+n97HZrSDPae3rAHnTBiHXSFLaY=";
45 # issue: https://github.com/mmatl/pyrender/issues/203
46 # mega pr: https://github.com/mmatl/pyrender/pull/216
47 # relevant pr commit: https://github.com/mmatl/pyrender/pull/216/commits/5069aeb957addff8919f05dc9be4040f55bff329
48 # the commit does not apply as a patch when cherry picked, hence the substituteInPlace
50 substituteInPlace tests/unit/test_meshes.py \
52 "bm = trimesh.load('tests/data/WaterBottle.glb').dump()[0]" \
53 'bm = trimesh.load("tests/data/WaterBottle.glb").geometry["WaterBottle"]'
56 nativeBuildInputs = [ setuptools ];
71 env.PYOPENGL_PLATFORM = "egl"; # enables headless rendering during check
73 nativeCheckInputs = [ pytestCheckHook ];
76 # does not work inside sandbox, no GPU
77 "tests/unit/test_offscreen.py"
80 pythonImportsCheck = [ "pyrender" ];
83 homepage = "https://pyrender.readthedocs.io/en/latest/";
84 description = "Easy-to-use glTF 2.0-compliant OpenGL renderer for visualization of 3D scenes";
85 license = licenses.mit;
86 maintainers = with maintainers; [ pbsds ];