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

macOS 11 Big Sur bundle compatibility #2087

Merged
merged 3 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion deployment/bundle_macos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/local/bin/zsh

pl_codesign () {
sign="Developer ID Application: Pupil Labs UG (haftungsbeschrankt) (R55K9ESN6B)"
Expand Down Expand Up @@ -45,6 +45,7 @@ mv dist/*.$ext ../$release_dir
cd ..

printf "\n##########\nSigning applications\n##########\n"
pl_codesign $release_dir/*.$ext/Contents/Resources/**/.dylibs/*.dylib
pl_codesign $release_dir/*.$ext

printf "\n##########\nCreating dmg file\n##########\n"
Expand Down
2 changes: 1 addition & 1 deletion deployment/deploy_capture/bundle.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if platform.system() == "Darwin":
pathex=["../../pupil_src/shared_modules/"],
hiddenimports=hidden_imports,
hookspath=None,
runtime_hooks=None,
runtime_hooks=["../find_opengl_bigsur.py"],
excludes=["matplotlib"],
datas=data_files_pye3d,
)
Expand Down
2 changes: 1 addition & 1 deletion deployment/deploy_player/bundle.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if platform.system() == "Darwin":
pathex=["../../pupil_src/shared_modules/"],
hiddenimports=hidden_imports,
hookspath=None,
runtime_hooks=None,
runtime_hooks=["../find_opengl_bigsur.py"],
excludes=["matplotlib"],
datas=data_files_pye3d,
)
Expand Down
2 changes: 1 addition & 1 deletion deployment/deploy_service/bundle.spec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if platform.system() == "Darwin":
pathex=["../../pupil_src/shared_modules/"],
hiddenimports=hidden_imports,
hookspath=None,
runtime_hooks=None,
runtime_hooks=["../find_opengl_bigsur.py"],
excludes=["matplotlib"],
datas=data_files_pye3d,
)
Expand Down
23 changes: 23 additions & 0 deletions deployment/find_opengl_bigsur.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ctypes.util
import functools


print("Attempting to import OpenGL using patched `ctypes.util.find_library`...")
_find_library_original = ctypes.util.find_library

@functools.wraps(_find_library_original)
def _find_library_patched(name):
if name == "OpenGL":
return "/System/Library/Frameworks/OpenGL.framework/OpenGL"
else:
return _find_library_original(name)

ctypes.util.find_library = _find_library_patched

import OpenGL.GL

print("OpenGL import successful!")
print("Restoring original `ctypes.util.find_library`...")
ctypes.util.find_library = _find_library_original
del _find_library_patched
print("Original `ctypes.util.find_library` restored.")