Unverified Commit be32c59e authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #236059 from wegank/pyopengl-darwin

python310Packages.pyopengl: unbreak on darwin
parents 02380c91 522463b4
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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