Skip to content

Fix/cleanup tribler.spec #8542

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

Merged
merged 1 commit into from
Apr 14, 2025
Merged
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
19 changes: 0 additions & 19 deletions build/tribler.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
from packaging.version import Version

block_cipher = None
import imp
import os
import re
import shutil
import sys

import aiohttp_apispec

from PyInstaller.utils.hooks import collect_data_files, collect_submodules

root_dir = os.path.abspath(os.path.dirname(__name__))
src_dir = os.path.join(root_dir, "src")
sys.path.append(src_dir)
Expand Down Expand Up @@ -54,13 +51,6 @@ data_to_copy = [
(os.path.dirname(aiohttp_apispec.__file__), 'aiohttp_apispec')
]

# Importing lib2to3 as hidden import does not import all the necessary files for some reason so had to import as data.
try:
lib2to3_dir = imp.find_module('lib2to3')[1]
data_to_copy += [(lib2to3_dir, 'lib2to3')]
except ImportError:
pass

if sys.platform.startswith('darwin'):
# Create the right version info in the Info.plist file
with open('build/mac/resources/Info.plist', 'r') as f:
Expand All @@ -70,11 +60,6 @@ if sys.platform.startswith('darwin'):
with open('build/mac/resources/Info.plist', 'w') as f:
f.write(content)

# Embed the "Noto Color Emoji" font on Linux
ttf_path = os.path.join("/usr", "share", "fonts", "truetype", "noto", "NotoColorEmoji.ttf")
if sys.platform.startswith('linux') and os.path.exists(ttf_path):
data_to_copy += [(ttf_path, 'fonts')]

excluded_libs = ['wx', 'PyQt4', 'FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter', 'matplotlib']

# Pony dependencies; each packages need to be added separatedly; added as hidden import
Expand All @@ -90,7 +75,6 @@ hiddenimports = [
'pkg_resources',
# 'pkg_resources.py2_warn', # Workaround PyInstaller & SetupTools, https://github.com/pypa/setuptools/issues/1963
'pyaes',
'pydantic',
'requests',
'scrypt', '_scrypt',
'sqlalchemy', 'sqlalchemy.ext.baked', 'sqlalchemy.ext.declarative',
Expand All @@ -106,9 +90,6 @@ hiddenimports += [x for member in known_components.__dict__.values() for x in ge
if sys.platform.startswith('linux'):
hiddenimports += ['gi', 'gi.repository.GdkPixbuf']

# https://github.com/pyinstaller/pyinstaller/issues/5359
hiddenimports += collect_submodules('pydantic')

sys.modules['FixTk'] = None
a = Analysis(['src/run_tribler.py'],
pathex=[''],
Expand Down