diff options
| author | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-07-07 16:03:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-07 16:03:03 -0400 |
| commit | 68d1ffc838df119f9e317edd86a4c1e39d834bb6 (patch) | |
| tree | 97217883b2c0cefbf42ccbcb3ed0f5e6016c4085 /py_modules/lsfg_vk/installation.py | |
| parent | 97a70cd68813f2174fe145ee79784e509d11a742 (diff) | |
| parent | fc8724b850b7c59151522da8391963cc071d49f8 (diff) | |
| download | decky-lsfg-vk-68d1ffc838df119f9e317edd86a4c1e39d834bb6.tar.gz decky-lsfg-vk-68d1ffc838df119f9e317edd86a4c1e39d834bb6.zip | |
Merge pull request #199 from xXJSONDeruloXx/arm-test
add experimental arm .so and overwrite logic on setup
Diffstat (limited to 'py_modules/lsfg_vk/installation.py')
| -rw-r--r-- | py_modules/lsfg_vk/installation.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py index 4329d49..4f01be1 100644 --- a/py_modules/lsfg_vk/installation.py +++ b/py_modules/lsfg_vk/installation.py @@ -3,6 +3,7 @@ Installation service for lsfg-vk. """ import os +import platform import shutil import traceback import zipfile @@ -14,7 +15,7 @@ from typing import Dict, Any from .base_service import BaseService from .constants import ( LIB_FILENAME, JSON_FILENAME, ZIP_FILENAME, BIN_DIR, - SO_EXT, JSON_EXT + SO_EXT, JSON_EXT, ARM_LIB_FILENAME ) from .config_schema import ConfigurationManager from .types import InstallationResponse, UninstallationResponse, InstallationCheckResponse @@ -48,6 +49,13 @@ class InstallationService(BaseService): self._extract_and_install_files(zip_path) + # If on ARM, overwrite the .so with the ARM version + if self._is_arm_architecture(): + self.log.info("Detected ARM architecture, using ARM binary") + arm_so_path = plugin_dir / BIN_DIR / ARM_LIB_FILENAME + shutil.copy2(arm_so_path, self.lib_file) + self.log.info(f"Overwrote with ARM binary: {self.lib_file}") + self._create_config_file() self._create_lsfg_launch_script() @@ -64,6 +72,14 @@ class InstallationService(BaseService): self.log.error(error_msg) return self._error_response(InstallationResponse, str(e), message="") + def _is_arm_architecture(self) -> bool: + """Check if running on ARM architecture + + Returns: + True if running on ARM (aarch64), False otherwise + """ + return platform.machine().lower() == 'aarch64' + def _extract_and_install_files(self, zip_path: Path) -> None: """Extract zip file and install files to appropriate locations |
