Fix Linux AppIndicator library path detection on non-multiarch distros (#1131)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3fda85acc
commit
65d1092898
1 file changed
+8
-3
+8
-3
@@ -71,9 +71,14 @@ hiddenimports: list[str] = [
|
|||||||
if sys.platform == "linux":
|
if sys.platform == "linux":
|
||||||
# Needed files for better system tray support on Linux via pystray (AppIndicator backend).
|
# Needed files for better system tray support on Linux via pystray (AppIndicator backend).
|
||||||
arch: str = platform.machine()
|
arch: str = platform.machine()
|
||||||
libraries_path: Path = Path(f"/usr/lib/{arch}-linux-gnu")
|
candidate_library_paths: list[Path] = [
|
||||||
if not libraries_path.exists():
|
Path(f"/usr/lib/{arch}-linux-gnu"), # Debian/Ubuntu multiarch
|
||||||
libraries_path = Path("/usr/lib64")
|
Path("/usr/lib64"), # Fedora/RHEL
|
||||||
|
Path("/usr/lib"), # Arch and other single-dir distros
|
||||||
|
]
|
||||||
|
for libraries_path in candidate_library_paths:
|
||||||
|
if (libraries_path / "libayatana-appindicator3.so.1").exists():
|
||||||
|
break
|
||||||
datas.append(
|
datas.append(
|
||||||
(libraries_path / "girepository-1.0/AyatanaAppIndicator3-0.1.typelib", "gi_typelibs")
|
(libraries_path / "girepository-1.0/AyatanaAppIndicator3-0.1.typelib", "gi_typelibs")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user