feat: Tray fix
This commit is contained in:
parent
322385fc34
commit
38d159c723
|
|
@ -225,28 +225,27 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: "pip"
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
libgirepository1.0-dev \
|
||||
python3-venv \
|
||||
python3-dev \
|
||||
python3-gi \
|
||||
gir1.2-ayatanaappindicator3-0.1 \
|
||||
python3-tk
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install ".[linux]"
|
||||
- name: Create venv with system site-packages
|
||||
run: python3 -m venv --system-site-packages .venv
|
||||
|
||||
- name: Install pyinstaller
|
||||
run: pip install "pyinstaller==6.13.0"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
.venv/bin/pip install --upgrade pip
|
||||
.venv/bin/pip install ".[linux]"
|
||||
.venv/bin/pip install "pyinstaller==6.13.0"
|
||||
|
||||
- name: Build binary with PyInstaller
|
||||
run: pyinstaller packaging/linux.spec --noconfirm
|
||||
run: .venv/bin/pyinstaller packaging/linux.spec --noconfirm
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
|
||||
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
|
||||
|
||||
block_cipher = None
|
||||
|
||||
|
|
@ -9,11 +12,21 @@ block_cipher = None
|
|||
import customtkinter
|
||||
ctk_path = os.path.dirname(customtkinter.__file__)
|
||||
|
||||
# Collect gi (PyGObject) submodules and data so pystray._appindicator works
|
||||
gi_hiddenimports = collect_submodules('gi')
|
||||
gi_datas = collect_data_files('gi')
|
||||
|
||||
# Collect GObject typelib files from the system
|
||||
typelib_dirs = glob.glob('/usr/lib/*/girepository-1.0')
|
||||
typelib_datas = []
|
||||
for d in typelib_dirs:
|
||||
typelib_datas.append((d, 'gi_typelibs'))
|
||||
|
||||
a = Analysis(
|
||||
[os.path.join(os.path.dirname(SPEC), os.pardir, 'linux.py')],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[(ctk_path, 'customtkinter/')],
|
||||
datas=[(ctk_path, 'customtkinter/')] + gi_datas + typelib_datas,
|
||||
hiddenimports=[
|
||||
'pystray._appindicator',
|
||||
'PIL._tkinter_finder',
|
||||
|
|
@ -22,7 +35,14 @@ a = Analysis(
|
|||
'cryptography.hazmat.primitives.ciphers.algorithms',
|
||||
'cryptography.hazmat.primitives.ciphers.modes',
|
||||
'cryptography.hazmat.backends.openssl',
|
||||
],
|
||||
'gi',
|
||||
'_gi',
|
||||
'gi.repository.GLib',
|
||||
'gi.repository.GObject',
|
||||
'gi.repository.Gtk',
|
||||
'gi.repository.Gdk',
|
||||
'gi.repository.AyatanaAppIndicator3',
|
||||
] + gi_hiddenimports,
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
|
|
|
|||
Loading…
Reference in New Issue