Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Sur import workaround #324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions vidcutter/libs/mpvwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@
import os
import sys

def monkeypatch_ctypes():
import os
import ctypes.util
uname = os.uname()
if uname.sysname == "Darwin" and uname.release >= "20.":
real_find_library = ctypes.util.find_library
def find_library(name):
if name in {"OpenGL", "GLUT"}: # add more names here if necessary
return f"/System/Library/Frameworks/{name}.framework/{name}"
return real_find_library(name)
ctypes.util.find_library = find_library
return

if sys.platform == 'win32':
from OpenGL import GL
from PyQt5.QtOpenGL import QGLContext
elif sys.platform == 'darwin':
monkeypatch_ctypes()
try:
from OpenGL import GL
try:
Expand Down