macos build recode (pystray and tkinter)

This commit is contained in:
Flowseal
2026-08-04 16:26:13 +03:00
parent 2496004c93
commit 35e7560fa8
6 changed files with 386 additions and 543 deletions
+7
View File
@@ -303,6 +303,12 @@ jobs:
python3.12 -m pip install .
python3.12 -m pip install pyinstaller==6.13.0
- name: Validate macOS GUI dependencies
run: |
python3.12 -m pip check
python3.12 -m py_compile macos.py
python3.12 -c "import AppKit, customtkinter, macos, pystray, tkinter"
- name: Create macOS icon
run: |
set -euo pipefail
@@ -318,6 +324,7 @@ jobs:
'dist/TG WS Proxy.app/Contents/Info.plist')"
test -n "$ICON_FILE"
test -f "dist/TG WS Proxy.app/Contents/Resources/$ICON_FILE"
test -d "dist/TG WS Proxy.app/Contents/Resources/customtkinter"
found=0
while IFS= read -r -d '' file; do
+2
View File
@@ -20,6 +20,8 @@ tg-ws-proxy-tray-win
### macOS
Требуется сборка Python с поддержкой Tk. Проверить её можно командой `python3 -m tkinter`.
```bash
pip install -e .
tg-ws-proxy-tray-macos
+2
View File
@@ -24,6 +24,8 @@
Подробная инструкция: [BuildFromSource.md](./BuildFromSource.md)
Для интерфейса требуются Tk, CustomTkinter и доступ к Cocoa через PyObjC. Они устанавливаются автоматически, кроме Tk, который должен входить в используемую сборку Python.
```bash
pip install -e .
tg-ws-proxy-tray-macos
+361 -530
View File
File diff suppressed because it is too large Load Diff
+10 -9
View File
@@ -1,24 +1,28 @@
# -*- mode: python ; coding: utf-8 -*-
import sys
import os
block_cipher = None
import customtkinter
ctk_path = os.path.dirname(customtkinter.__file__)
_i18n_path = os.path.join(os.path.dirname(SPEC), os.pardir, 'ui', 'i18n')
a = Analysis(
[os.path.join(os.path.dirname(SPEC), os.pardir, 'macos.py')],
pathex=[],
binaries=[],
datas=[(_i18n_path, 'ui/i18n')],
datas=[(ctk_path, 'customtkinter/'), (_i18n_path, 'ui/i18n')],
hiddenimports=[
'rumps',
'tkinter',
'customtkinter',
'pystray._darwin',
'PIL._tkinter_finder',
'objc',
'Foundation',
'AppKit',
'PyObjCTools',
'PyObjCTools.AppHelper',
'PyObjCTools.MachSignals',
'cryptography.hazmat.primitives.ciphers',
'cryptography.hazmat.primitives.ciphers.algorithms',
'cryptography.hazmat.primitives.ciphers.modes',
@@ -30,14 +34,13 @@ a = Analysis(
excludes=[
'PIL._avif',
'PIL._webp',
'PIL._imagingtk',
],
noarchive=False,
cipher=block_cipher,
)
_PIL_EXCLUDE_PYDS = {
'_avif', '_webp', '_imagingtk',
'_avif', '_webp',
'FpxImagePlugin', 'MicImagePlugin',
}
a.binaries = [
@@ -93,7 +96,5 @@ app = BUNDLE(
'LSMinimumSystemVersion': '10.15',
'LSUIElement': True,
'NSHighResolutionCapable': True,
'NSAppleEventsUsageDescription':
'TG WS Proxy needs to display dialogs.',
},
)
+3 -3
View File
@@ -45,9 +45,9 @@ dependencies = [
"cryptography==46.0.5; platform_system != 'Windows' or python_version >= '3.9'",
"Pillow==12.1.1; (platform_system != 'Windows' or python_version >= '3.9') and platform_system != 'Darwin'",
"customtkinter==5.2.2; platform_system != 'Darwin'",
"pystray==0.19.5; platform_system != 'Darwin'",
"rumps==0.4.0; platform_system == 'Darwin'",
"customtkinter==5.2.2",
"pystray==0.19.5",
"pyobjc-framework-Cocoa>=9.0; platform_system == 'Darwin'",
"Pillow==12.1.0; platform_system == 'Darwin'",
]