python313Packages.pyopengl: update libgl patching (#403739)

authored by Peder Bergebakken Sundt and committed by GitHub ef13b0b2 cd9e8468

+28 -20
+28 -20
pkgs/development/python-modules/pyopengl/default.nix
··· 31 31 # Theses lines are patching the name of dynamic libraries 32 32 # so pyopengl can find them at runtime. 33 33 substituteInPlace OpenGL/platform/glx.py \ 34 - --replace '"OpenGL",' '"${pkgs.libGL}/lib/libOpenGL${ext}",' \ 35 - --replace '"GL",' '"${pkgs.libGL}/lib/libGL${ext}",' \ 36 - --replace '"GLU",' '"${pkgs.libGLU}/lib/libGLU${ext}",' \ 37 - --replace '"GLX",' '"${pkgs.libglvnd}/lib/libGLX${ext}",' \ 38 - --replace '"glut",' '"${pkgs.libglut}/lib/libglut${ext}",' \ 39 - --replace '"GLESv1_CM",' '"${pkgs.libGL}/lib/libGLESv1_CM${ext}",' \ 40 - --replace '"GLESv2",' '"${pkgs.libGL}/lib/libGLESv2${ext}",' \ 41 - --replace '"gle",' '"${pkgs.gle}/lib/libgle${ext}",' \ 42 - --replace "'EGL'" "'${pkgs.libGL}/lib/libEGL${ext}'" 34 + --replace-fail "'OpenGL'" '"${pkgs.libGL}/lib/libOpenGL${ext}"' \ 35 + --replace-fail '"GL",' '"${pkgs.libGL}/lib/libGL${ext}",' \ 36 + --replace-fail "'GL'" '"${pkgs.libGL}/lib/libGL${ext}"' \ 37 + --replace-fail '"GLU",' '"${pkgs.libGLU}/lib/libGLU${ext}",' \ 38 + --replace-fail "'GLX'" '"${pkgs.libglvnd}/lib/libGLX${ext}"' \ 39 + --replace-fail '"glut",' '"${pkgs.libglut}/lib/libglut${ext}",' \ 40 + --replace-fail '"GLESv1_CM",' '"${pkgs.libGL}/lib/libGLESv1_CM${ext}",' \ 41 + --replace-fail '"GLESv2",' '"${pkgs.libGL}/lib/libGLESv2${ext}",' \ 42 + --replace-fail '"gle",' '"${pkgs.gle}/lib/libgle${ext}",' \ 43 + --replace-fail "'EGL'" "'${pkgs.libGL}/lib/libEGL${ext}'" 43 44 substituteInPlace OpenGL/platform/egl.py \ 44 - --replace "('OpenGL','GL')" "('${pkgs.libGL}/lib/libOpenGL${ext}', '${pkgs.libGL}/lib/libGL${ext}')" \ 45 - --replace "'GLU'," "'${pkgs.libGLU}/lib/libGLU${ext}'," \ 46 - --replace "'glut'," "'${pkgs.libglut}/lib/libglut${ext}'," \ 47 - --replace "'GLESv1_CM'," "'${pkgs.libGL}/lib/libGLESv1_CM${ext}'," \ 48 - --replace "'GLESv2'," "'${pkgs.libGL}/lib/libGLESv2${ext}'," \ 49 - --replace "'gle'," '"${pkgs.gle}/lib/libgle${ext}",' \ 50 - --replace "'EGL'," "'${pkgs.libGL}/lib/libEGL${ext}'," 45 + --replace-fail "('OpenGL','GL')" "('${pkgs.libGL}/lib/libOpenGL${ext}', '${pkgs.libGL}/lib/libGL${ext}')" \ 46 + --replace-fail "'GLU'," "'${pkgs.libGLU}/lib/libGLU${ext}'," \ 47 + --replace-fail "'glut'," "'${pkgs.libglut}/lib/libglut${ext}'," \ 48 + --replace-fail "'GLESv1_CM'," "'${pkgs.libGL}/lib/libGLESv1_CM${ext}'," \ 49 + --replace-fail "'GLESv2'," "'${pkgs.libGL}/lib/libGLESv2${ext}'," \ 50 + --replace-fail "'gle'," '"${pkgs.gle}/lib/libgle${ext}",' \ 51 + --replace-fail "'EGL'," "'${pkgs.libGL}/lib/libEGL${ext}'," 51 52 substituteInPlace OpenGL/platform/darwin.py \ 52 - --replace "'OpenGL'," "'${pkgs.libGL}/lib/libGL${ext}'," \ 53 - --replace "'GLUT'," "'${pkgs.libglut}/lib/libglut${ext}'," 53 + --replace-fail "'OpenGL'," "'${pkgs.libGL}/lib/libGL${ext}'," \ 54 + --replace-fail "'GLUT'," "'${pkgs.libglut}/lib/libglut${ext}'," 54 55 '' 55 56 + '' 56 57 # https://github.com/NixOS/nixpkgs/issues/76822 ··· 61 62 # The following patch put back the "name" (i.e. the path) in the 62 63 # list of possible files. 63 64 substituteInPlace OpenGL/platform/ctypesloader.py \ 64 - --replace "filenames_to_try = [base_name]" "filenames_to_try = [name]" 65 + --replace-fail "filenames_to_try = [base_name]" "filenames_to_try = [name]" 65 66 ''; 66 67 67 68 # Need to fix test runner ··· 71 72 doCheck = false; # does not affect pythonImportsCheck 72 73 73 74 # OpenGL looks for libraries during import, making this a somewhat decent test of the flaky patching above. 74 - pythonImportsCheck = "OpenGL"; 75 + pythonImportsCheck = 76 + [ 77 + "OpenGL" 78 + "OpenGL.GL" 79 + ] 80 + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ 81 + "OpenGL.GLX" 82 + ]; 75 83 76 84 meta = with lib; { 77 85 homepage = "https://mcfletch.github.io/pyopengl/";