diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-07-05 10:01:30 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-07-05 10:01:30 +0300 |
| commit | ba48fd769a3dc89575a86f15a147d401b69edeb3 (patch) | |
| tree | 4f0759e4da4c79b7f3a42f42555d0fec790a2a4d | |
| parent | 822d5f2df9f64fcc2ac4b726a7214335d7161bf4 (diff) | |
| download | fungus-launcher-ba48fd769a3dc89575a86f15a147d401b69edeb3.tar.gz fungus-launcher-ba48fd769a3dc89575a86f15a147d401b69edeb3.tar.xz | |
unify approach to get package directory for dev builds using @PYTHON_SITE_PACKAGES@ (meson macro)
| -rw-r--r-- | fungus-proton-manager.py | 12 | ||||
| -rw-r--r-- | fungus-run.py | 11 |
2 files changed, 20 insertions, 3 deletions
diff --git a/fungus-proton-manager.py b/fungus-proton-manager.py index 1c57aa6..3e8a991 100644 --- a/fungus-proton-manager.py +++ b/fungus-proton-manager.py @@ -3,8 +3,20 @@ import argparse import os +import sys import threading +IS_RPM_BUILD = "@IS_RPM_BUILD@" +PYTHON_SITE_PACKAGES = "@PYTHON_SITE_PACKAGES@" + +# only for custom builds, use system paths for RPM packages +if IS_RPM_BUILD == "true": + pass +else: + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + dev_site_packages = os.path.join(base_dir, PYTHON_SITE_PACKAGES) + sys.path.insert(0, dev_site_packages) + import gi # type: ignore gi.require_version("Gtk", "3.0") diff --git a/fungus-run.py b/fungus-run.py index ab97922..7c0bc89 100644 --- a/fungus-run.py +++ b/fungus-run.py @@ -4,10 +4,15 @@ import argparse import os import sys +IS_RPM_BUILD = "@IS_RPM_BUILD@" +PYTHON_SITE_PACKAGES = "@PYTHON_SITE_PACKAGES@" + # only for custom builds, use system paths for RPM packages -base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -dev_site_packages = os.path.join(base_dir, "lib", "python3.*", "site-packages") -if os.path.exists(dev_site_packages): +if IS_RPM_BUILD == "true": + pass +else: + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + dev_site_packages = os.path.join(base_dir, PYTHON_SITE_PACKAGES) sys.path.insert(0, dev_site_packages) from fungus.logger import set_level |
