diff --git a/pkgs/development/python-modules/pyopengl/default.nix b/pkgs/development/python-modules/pyopengl/default.nix index a425fcf5be96..ed643eb21983 100644 --- a/pkgs/development/python-modules/pyopengl/default.nix +++ b/pkgs/development/python-modules/pyopengl/default.nix @@ -19,6 +19,8 @@ buildPythonPackage rec { patchPhase = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in '' + # 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}'" \ @@ -26,6 +28,16 @@ buildPythonPackage rec { 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 + # pyopengl takes the "name" (for us: the path) and tries to add a + # few suffix during its loading phase. + # The following patch put back the "name" (i.e. the path) in the + # list of possible files. + substituteInPlace OpenGL/platform/ctypesloader.py \ + --replace "filenames_to_try = []" "filenames_to_try = [name]" ''; # Need to fix test runner