Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Fix MacOS build based on PyInstaller #17

Merged
merged 3 commits into from
Apr 24, 2024
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 build/mac/makedist_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export RESOURCES=build/mac/resources
python3 -m venv build-env
. ./build-env/bin/activate
python3 -m pip install pip==23.0.1 # pin pip version to avoid "--no-use-pep517" issues with the latest version
python3 -m pip install PyInstaller==4.2 --no-use-pep517
python3 -m pip install pyinstaller-hooks-contrib==2024.4 # for more recent version it needs PyInstaller>=5.0
python3 -m pip install PyInstaller==4.2 --no-use-pep517 # requires pyinstaller-hooks-contrib>=2020.6, broke on 2024.5
python3 -m pip install --upgrade -r requirements-build.txt

# ----- Build
Expand Down
8 changes: 7 additions & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# These are specific versions of the packages that are used for making the build work.
# These are installed before other dependencies.
PyQt5==5.15.1
PyQt5-sip==12.8.1
pyqtgraph==0.12.3

-r requirements.txt

cx_Freeze==6.15.16
cx_Freeze==6.15.16; sys_platform != 'darwin'

setuptools==65.5.1; sys_platform == 'darwin'
text-unidecode==1.3; sys_platform == 'darwin'
Expand Down
10 changes: 10 additions & 0 deletions src/tribler/gui/start_gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import sys
from pathlib import Path
from typing import Optional
Expand All @@ -10,6 +11,15 @@


def run_gui(api_port: Optional[int], api_key: Optional[str], root_state_dir: Path):
# Workaround for macOS Big Sur and later, see https://github.com/Tribler/tribler/issues/5728
if sys.platform == "darwin":
logger.info('Enabling a workaround for macOS Big Sur')
os.environ["QT_MAC_WANTS_LAYER"] = "1"
# Workaround for Ubuntu 21.04+, see https://github.com/Tribler/tribler/issues/6701
elif sys.platform == "linux":
logger.info('Enabling a workaround for Ubuntu 21.04+ wayland environment')
os.environ["GDK_BACKEND"] = "x11"

app = TriblerApplication()
logger.info('Start Tribler Window')
window = TriblerWindow(app.manager, root_state_dir, api_port, api_key=api_key)
Expand Down
Loading