Skip to content

Commit

Permalink
Merge pull request #2087 from pupil-labs/macOS_bigsur_compat
Browse files Browse the repository at this point in the history
macOS 11 Big Sur bundle compatibility
  • Loading branch information
papr authored Jan 21, 2021
2 parents 8163b6a + c286e2f commit 31dd08a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
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.")

0 comments on commit 31dd08a

Please sign in to comment.