summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-26 21:08:44 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-26 21:08:44 -0400
commit23bbee0a9c553ae84c211f47ca870cfe14dfdfba (patch)
treea749e2459531711c94ff1cd7da2156cc17d1456a
parentb04fa027f7291710359bb6c4a8c1d0ebb85d53e5 (diff)
downloaddecky-lsfg-vk-23bbee0a9c553ae84c211f47ca870cfe14dfdfba.tar.gz
decky-lsfg-vk-23bbee0a9c553ae84c211f47ca870cfe14dfdfba.zip
initial test to build on noui package based on upstream build of lsfg-vk action
-rw-r--r--package.json8
-rw-r--r--py_modules/lsfg_vk/constants.py2
-rw-r--r--py_modules/lsfg_vk/installation.py37
3 files changed, 41 insertions, 6 deletions
diff --git a/package.json b/package.json
index 237961c..d54c204 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "decky-lossless-scaling-vk",
- "version": "0.7.5",
+ "version": "0.7.6",
"description": "Use Lossless Scaling on the Steam Deck using the lsfg-vk vulkan layer",
"type": "module",
"scripts": {
@@ -45,9 +45,9 @@
"remote_binary_bundling" : true,
"remote_binary": [
{
- "name": "lsfg-vk_archlinux.zip",
- "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/upstream-16403902734/lsfg-vk_archlinux.zip",
- "sha256hash": "220628261bfea8c81661d37fd0069a02214e85dbf32e28dcb08c5f55a6193075"
+ "name": "lsfg-vk_noui.zip",
+ "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/noui-jul26/lsfg-vk_noui.zip",
+ "sha256hash": "90320d382b8e10fdc2e3e5fb370877c29e6b6c3c55a19d70a632976102da268f"
}
],
diff --git a/py_modules/lsfg_vk/constants.py b/py_modules/lsfg_vk/constants.py
index 252c7a5..69989c1 100644
--- a/py_modules/lsfg_vk/constants.py
+++ b/py_modules/lsfg_vk/constants.py
@@ -15,7 +15,7 @@ SCRIPT_NAME = "lsfg"
CONFIG_FILENAME = "conf.toml"
LIB_FILENAME = "liblsfg-vk.so"
JSON_FILENAME = "VkLayer_LS_frame_generation.json"
-ZIP_FILENAME = "lsfg-vk_archlinux.zip"
+ZIP_FILENAME = "lsfg-vk_noui.zip"
# File extensions
SO_EXT = ".so"
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py
index 996a03f..b0e05ad 100644
--- a/py_modules/lsfg_vk/installation.py
+++ b/py_modules/lsfg_vk/installation.py
@@ -6,6 +6,7 @@ import os
import shutil
import zipfile
import tempfile
+import json
from pathlib import Path
from typing import Dict, Any
@@ -102,9 +103,43 @@ class InstallationService(BaseService):
dst_dir = dest_map.get(file_path.suffix)
if dst_dir:
dst_file = dst_dir / file
- shutil.copy2(src_file, dst_file)
+
+ # Special handling for JSON files - need to modify library_path
+ if file_path.suffix == JSON_EXT and file == JSON_FILENAME:
+ self._copy_and_fix_json_file(src_file, dst_file)
+ else:
+ shutil.copy2(src_file, dst_file)
+
self.log.info(f"Copied {file} to {dst_file}")
+ def _copy_and_fix_json_file(self, src_file: Path, dst_file: Path) -> None:
+ """Copy JSON file and fix the library_path to use relative path
+
+ Args:
+ src_file: Source JSON file path
+ dst_file: Destination JSON file path
+ """
+ try:
+ # Read the JSON file
+ with open(src_file, 'r') as f:
+ json_data = json.load(f)
+
+ # Fix the library_path from "liblsfg-vk.so" to "../../../lib/liblsfg-vk.so"
+ if 'layer' in json_data and 'library_path' in json_data['layer']:
+ current_path = json_data['layer']['library_path']
+ if current_path == "liblsfg-vk.so":
+ json_data['layer']['library_path'] = "../../../lib/liblsfg-vk.so"
+ self.log.info(f"Fixed library_path from '{current_path}' to '../../../lib/liblsfg-vk.so'")
+
+ # Write the modified JSON file
+ with open(dst_file, 'w') as f:
+ json.dump(json_data, f, indent=2)
+
+ except (json.JSONDecodeError, KeyError, OSError) as e:
+ self.log.error(f"Error fixing JSON file {src_file}: {e}")
+ # Fallback to simple copy if JSON modification fails
+ shutil.copy2(src_file, dst_file)
+
def _create_config_file(self) -> None:
"""Create the TOML config file in ~/.config/lsfg-vk with default configuration and detected DLL path"""
# Import here to avoid circular imports