Skip to content

Commit 8f48609

Browse files
authored
Merge pull request #2091 from pupil-labs/develop
Pupil v3.1 Release Candidate 1
2 parents d01e26b + 91d2173 commit 8f48609

File tree

34 files changed

+400
-72
lines changed

34 files changed

+400
-72
lines changed

deployment/bundle_macos.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
#!/bin/bash
1+
#!/usr/local/bin/zsh
22

33
pl_codesign () {
44
sign="Developer ID Application: Pupil Labs UG (haftungsbeschrankt) (R55K9ESN6B)"
55
codesign \
6+
--all-architectures \
7+
--force \
8+
--strict=all \
69
--options runtime \
710
--entitlements entitlements.plist \
811
--continue \
@@ -42,6 +45,7 @@ mv dist/*.$ext ../$release_dir
4245
cd ..
4346

4447
printf "\n##########\nSigning applications\n##########\n"
48+
pl_codesign $release_dir/*.$ext/Contents/Resources/**/.dylibs/*.dylib
4549
pl_codesign $release_dir/*.$ext
4650

4751
printf "\n##########\nCreating dmg file\n##########\n"

deployment/deploy_capture/bundle.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if platform.system() == "Darwin":
5252
pathex=["../../pupil_src/shared_modules/"],
5353
hiddenimports=hidden_imports,
5454
hookspath=None,
55-
runtime_hooks=None,
55+
runtime_hooks=["../find_opengl_bigsur.py"],
5656
excludes=["matplotlib"],
5757
datas=data_files_pye3d,
5858
)

deployment/deploy_player/bundle.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if platform.system() == "Darwin":
5353
pathex=["../../pupil_src/shared_modules/"],
5454
hiddenimports=hidden_imports,
5555
hookspath=None,
56-
runtime_hooks=None,
56+
runtime_hooks=["../find_opengl_bigsur.py"],
5757
excludes=["matplotlib"],
5858
datas=data_files_pye3d,
5959
)

deployment/deploy_service/bundle.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if platform.system() == "Darwin":
4343
pathex=["../../pupil_src/shared_modules/"],
4444
hiddenimports=hidden_imports,
4545
hookspath=None,
46-
runtime_hooks=None,
46+
runtime_hooks=["../find_opengl_bigsur.py"],
4747
excludes=["matplotlib"],
4848
datas=data_files_pye3d,
4949
)

deployment/find_opengl_bigsur.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import ctypes.util
2+
import functools
3+
4+
5+
print("Attempting to import OpenGL using patched `ctypes.util.find_library`...")
6+
_find_library_original = ctypes.util.find_library
7+
8+
@functools.wraps(_find_library_original)
9+
def _find_library_patched(name):
10+
if name == "OpenGL":
11+
return "/System/Library/Frameworks/OpenGL.framework/OpenGL"
12+
else:
13+
return _find_library_original(name)
14+
15+
ctypes.util.find_library = _find_library_patched
16+
17+
import OpenGL.GL
18+
19+
print("OpenGL import successful!")
20+
print("Restoring original `ctypes.util.find_library`...")
21+
ctypes.util.find_library = _find_library_original
22+
del _find_library_patched
23+
print("Original `ctypes.util.find_library` restored.")

pupil_src/launchables/eye.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ def eye(
126126

127127
# display
128128
import glfw
129+
from gl_utils import GLFWErrorReporting
129130

130-
glfw.ERROR_REPORTING = "raise"
131+
GLFWErrorReporting.set_default()
131132

132133
from pyglui import ui, graph, cygl
133134
from pyglui.cygl.utils import draw_points, RGBA, draw_polyline

pupil_src/launchables/player.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ def player(
7373

7474
# display
7575
import glfw
76+
from gl_utils import GLFWErrorReporting
7677

77-
glfw.ERROR_REPORTING = "raise"
78+
GLFWErrorReporting.set_default()
7879

7980
# check versions for our own depedencies as they are fast-changing
8081
from pyglui import __version__ as pyglui_version
@@ -137,7 +138,7 @@ def player(
137138
)
138139

139140
assert parse_version(pyglui_version) >= parse_version(
140-
"1.28"
141+
"1.29"
141142
), "pyglui out of date, please upgrade to newest version"
142143

143144
process_was_interrupted = False
@@ -374,7 +375,6 @@ def get_dt():
374375
glfw.init()
375376
glfw.window_hint(glfw.SCALE_TO_MONITOR, glfw.TRUE)
376377
main_window = glfw.create_window(width, height, window_name, None, None)
377-
378378
window_position_manager = gl_utils.WindowPositionManager()
379379
window_pos = window_position_manager.new_window_position(
380380
window=main_window,
@@ -808,8 +808,9 @@ def player_drop(
808808

809809
try:
810810
import glfw
811+
from gl_utils import GLFWErrorReporting
811812

812-
glfw.ERROR_REPORTING = "raise"
813+
GLFWErrorReporting.set_default()
813814

814815
import gl_utils
815816
from OpenGL.GL import glClearColor

pupil_src/launchables/world.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ def detection_enabled_setter(is_on: bool):
121121

122122
# display
123123
import glfw
124+
from gl_utils import GLFWErrorReporting
124125

125-
glfw.ERROR_REPORTING = "raise"
126+
GLFWErrorReporting.set_default()
126127

127128
from version_utils import parse_version
128129
from pyglui import ui, cygl, __version__ as pyglui_version

pupil_src/shared_modules/audio_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def _load_audio_single(file_path, return_pts_based_timestamps=False):
8181
),
8282
dtype=float,
8383
)
84-
container.seek(0)
84+
try:
85+
container.seek(0)
86+
except av.AVError as err:
87+
logger.debug(f"{err}")
88+
return None
8589

8690
return LoadedAudio(container, stream, timestamps)
8791

pupil_src/shared_modules/calibration_choreography/controller/gui_monitor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import typing as T
33

44
import glfw
5+
from gl_utils import GLFWErrorReporting
56

6-
glfw.ERROR_REPORTING = "raise"
7+
GLFWErrorReporting.set_default()
78

89
try:
910
from typing import OrderedDict as T_OrderedDict # Python 3.7.2

0 commit comments

Comments
 (0)