python310Packages.pyopengl: unbreak on darwin

This commit is contained in:
Weijia Wang 2023-06-05 12:09:18 +03:00
parent 8f9be47422
commit 522463b4f2

View File

@ -18,17 +18,14 @@ buildPythonPackage rec {
propagatedBuildInputs = [ pillow ];
patchPhase = let
ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
ext = stdenv.hostPlatform.extensions.sharedLibrary; in lib.optionalString (!stdenv.isDarwin) ''
# Theses lines are patching the name of dynamic libraries
# so pyopengl can find them at runtime.
substituteInPlace OpenGL/platform/glx.py \
--replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
--replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \
--replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'"
substituteInPlace OpenGL/platform/darwin.py \
--replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \
--replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'"
'' + ''
# https://github.com/NixOS/nixpkgs/issues/76822
# pyopengl introduced a new "robust" way of loading libraries in 3.1.4.
# The later patch of the filepath does not work anymore because