From 8111d4ca8e5c0973bd8e4a2b9ed176b9896cc648 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 14 Jan 2024 22:01:52 +0100 Subject: [PATCH] python3Packages.pyopengl: fix substituteInPlace --- .../python-modules/pyopengl/default.nix | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pyopengl/default.nix b/pkgs/development/python-modules/pyopengl/default.nix index 10333862bb8d..ddffa534ab85 100644 --- a/pkgs/development/python-modules/pyopengl/default.nix +++ b/pkgs/development/python-modules/pyopengl/default.nix @@ -23,22 +23,26 @@ buildPythonPackage rec { # 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}'" \ - --replace "'GLESv1_CM'," "'${pkgs.libGL}/lib/libGLESv1_CM${ext}'," \ - --replace "'GLESv2'," "'${pkgs.libGL}/lib/libGLESv2${ext}'," + --replace '"OpenGL",' '"${pkgs.libGL}/lib/libOpenGL${ext}",' \ + --replace '"GL",' '"${pkgs.libGL}/lib/libGL${ext}",' \ + --replace '"GLU",' '"${pkgs.libGLU}/lib/libGLU${ext}",' \ + --replace '"GLX",' '"${pkgs.libglvnd}/lib/libGLX${ext}",' \ + --replace '"glut",' '"${pkgs.freeglut}/lib/libglut${ext}",' \ + --replace '"GLESv1_CM",' '"${pkgs.libGL}/lib/libGLESv1_CM${ext}",' \ + --replace '"GLESv2",' '"${pkgs.libGL}/lib/libGLESv2${ext}",' \ + --replace '"gle",' '"${pkgs.gle}/lib/libgle${ext}",' \ + --replace "'EGL'" "'${pkgs.libGL}/lib/libEGL${ext}'" substituteInPlace OpenGL/platform/egl.py \ --replace "('OpenGL','GL')" "('${pkgs.libGL}/lib/libOpenGL${ext}', '${pkgs.libGL}/lib/libGL${ext}')" \ --replace "'GLU'," "'${pkgs.libGLU}/lib/libGLU${ext}'," \ --replace "'glut'," "'${pkgs.freeglut}/lib/libglut${ext}'," \ --replace "'GLESv1_CM'," "'${pkgs.libGL}/lib/libGLESv1_CM${ext}'," \ --replace "'GLESv2'," "'${pkgs.libGL}/lib/libGLESv2${ext}'," \ + --replace "'gle'," '"${pkgs.gle}/lib/libgle${ext}",' \ --replace "'EGL'," "'${pkgs.libGL}/lib/libEGL${ext}'," substituteInPlace OpenGL/platform/darwin.py \ --replace "'OpenGL'," "'${pkgs.libGL}/lib/libGL${ext}'," \ --replace "'GLUT'," "'${pkgs.freeglut}/lib/libglut${ext}'," - # TODO: patch 'gle' in OpenGL/platform/egl.py '' + '' # https://github.com/NixOS/nixpkgs/issues/76822 # pyopengl introduced a new "robust" way of loading libraries in 3.1.4. @@ -48,7 +52,7 @@ buildPythonPackage rec { # 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]" + --replace "filenames_to_try = [base_name]" "filenames_to_try = [name]" ''; # Need to fix test runner @@ -61,7 +65,7 @@ buildPythonPackage rec { pythonImportsCheck = "OpenGL"; meta = with lib; { - homepage = "https://pyopengl.sourceforge.net/"; + homepage = "https://mcfletch.github.io/pyopengl/"; description = "PyOpenGL, the Python OpenGL bindings"; longDescription = '' PyOpenGL is the cross platform Python binding to OpenGL and