Take account of VLC on macOS being bundled with OpenLP

This commit is contained in:
Raoul Snyman 2023-05-17 07:25:48 +00:00 committed by Tim Bentley
parent 2427ae10a8
commit c897ed8d40
2 changed files with 10 additions and 6 deletions

View File

@ -34,7 +34,7 @@ install:
# Update pip
- python -m pip install --upgrade pip
# Install generic dependencies from pypi. sqlalchemy most be 1.4 for now
- python -m pip install "sqlalchemy<1.5" alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets waitress six requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc flask-cors pytest-qt pyenchant pysword qrcode pillow
- python -m pip install "sqlalchemy<1.5" alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets waitress six requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc flask-cors pytest-qt pyenchant pysword qrcode pillow "flask<2.3"
# Install Windows only dependencies
- cmd: python -m pip install pyodbc pypiwin32
- cmd: choco install vlc %CHOCO_VLC_ARG% --no-progress --limit-output

View File

@ -451,12 +451,16 @@ def main():
set_up_logging(AppLocation.get_directory(AppLocation.CacheDir))
set_up_web_engine_cache(AppLocation.get_directory(AppLocation.CacheDir) / 'web_cache')
# Set the libvlc environment variable if we're frozen
if getattr(sys, 'frozen', False) and is_win():
if getattr(sys, 'frozen', False):
# Path to libvlc and the plugins
os.environ['PYTHON_VLC_LIB_PATH'] = str(AppLocation.get_directory(AppLocation.AppDir) / 'vlc' / 'libvlc.dll')
os.environ['PYTHON_VLC_MODULE_PATH'] = str(AppLocation.get_directory(AppLocation.AppDir) / 'vlc')
os.environ['PATH'] += ';' + str(AppLocation.get_directory(AppLocation.AppDir) / 'vlc')
log.debug('VLC Path: {}'.format(os.environ['PYTHON_VLC_LIB_PATH']))
vlc_dir = AppLocation.get_directory(AppLocation.AppDir) / 'vlc'
if is_win():
os.environ['PYTHON_VLC_LIB_PATH'] = str(vlc_dir / 'libvlc.dll')
elif is_macosx():
os.environ['PYTHON_VLC_LIB_PATH'] = str(vlc_dir / 'libvlc.5.dylib')
os.environ['PYTHON_VLC_MODULE_PATH'] = str(vlc_dir)
os.environ['PATH'] += ';' + str(vlc_dir)
log.debug('VLC Path: {}'.format(os.environ.get('PYTHON_VLC_LIB_PATH', '')))
app = OpenLP()
# Initialise the Registry
Registry.create()