linux: add PyGObject as a dependency

This dependency is required for proper support of the AppIndicator
backend from pystray:

https://github.com/moses-palmer/pystray/blob/v0.19.4/docs/faq.rst#how-do-i-use-pystray-in-a-virtualenv-on-linux
This commit is contained in:
guihkx authored and DevilXD committed 2023-06-11 16:58:18 +02:00
1 parent 82653fcc20
commit 7c1e7b0af1
2 files changed
+21 -9

No files matched your search

+20 -9
View File
@@ -34,28 +34,39 @@ for source_path, dest_path, required in to_add:
elif required: elif required:
raise FileNotFoundError(str(source_path)) raise FileNotFoundError(str(source_path))
binaries: list[tuple[Path, str]] = []
hiddenimports: list[str] = [
"PIL._tkinter_finder",
"setuptools._distutils.log",
"setuptools._distutils.dir_util",
"setuptools._distutils.file_util",
"setuptools._distutils.archive_util",
]
if sys.platform == "linux":
# Needed files for better system tray support on Linux via pystray (AppIndicator backend).
datas.append((Path("/usr/lib/girepository-1.0/AppIndicator3-0.1.typelib"), "gi_typelibs"))
binaries.append((Path("/lib/x86_64-linux-gnu/libappindicator3.so.1"), "."))
hiddenimports.extend([
"gi.repository.Gtk",
"gi.repository.GObject",
])
block_cipher = None block_cipher = None
a = Analysis( a = Analysis(
["main.py"], ["main.py"],
pathex=[], pathex=[],
datas=datas, datas=datas,
binaries=[],
excludes=[], excludes=[],
hookspath=[], hookspath=[],
hooksconfig={}, hooksconfig={},
noarchive=False, noarchive=False,
hiddenimports=[
"setuptools._distutils.log",
"setuptools._distutils.dir_util",
"setuptools._distutils.file_util",
"setuptools._distutils.archive_util",
"PIL._tkinter_finder",
],
runtime_hooks=[], runtime_hooks=[],
binaries=binaries,
cipher=block_cipher, cipher=block_cipher,
win_no_prefer_redirects=False, hiddenimports=hiddenimports,
win_private_assemblies=False, win_private_assemblies=False,
win_no_prefer_redirects=False,
) )
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE( exe = EXE(
+1
View File
@@ -2,6 +2,7 @@ aiohttp>2.0,<4.0
Pillow Pillow
# TODO: switch back to a stable pystray release when a version newer than v0.19.4 is out # TODO: switch back to a stable pystray release when a version newer than v0.19.4 is out
pystray@git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992 pystray@git+https://github.com/moses-palmer/pystray.git@903836104f8b1a2979f4fa5a333870ef7b075992
PyGObject; sys_platform == "linux" # required for better system tray support on Linux
# selenium-wire # selenium-wire
# undetected-chromedriver # undetected-chromedriver
# this is installed only on windows # this is installed only on windows