From a856067b763294753d376dcfb5a32c0abac4de41 Mon Sep 17 00:00:00 2001 From: Martin Rys Date: Thu, 31 Oct 2024 12:59:40 +0100 Subject: [PATCH] README: Fix instructions for running from a local directory --- README.md | 3 +-- scc/tools.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 700c28d1..15cb2682 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,7 @@ Windows: - Clone the repository `git clone https://github.com/C0rn3j/sc-controller.git` and navigate into it: `cd sc-controller` - `python3 -m build --wheel` - `python3 -m installer --destdir="./build" dist/*.whl` - - Run the app via: `./build/usr/bin/sc-controller` - + - Run the app via: `SCC_SHARED="${PWD}" PYTHONPATH="./build/usr/lib/python3.12/site-packages" PATH="${PWD}/build/usr/bin:${PATH}" ./build/usr/bin/sc-controller` ### Via Docker A test build with Docker can be created using the following way: diff --git a/scc/tools.py b/scc/tools.py index c9163d15..1d807293 100644 --- a/scc/tools.py +++ b/scc/tools.py @@ -343,7 +343,7 @@ def find_library(libname: str) -> ctypes.CDLL: os.path.abspath(os.path.normpath( os.path.join( base_path, "..", libname + extension ))), os.path.abspath(os.path.normpath( - os.path.join( base_path, "../..", libname + extension ))) + os.path.join( site_packages_path, libname + extension ))), ] for path in search_paths: @@ -352,7 +352,7 @@ def find_library(libname: str) -> ctypes.CDLL: break if not lib: - raise OSError("Cant find {}.so. searched at:\n {}".format(libname, "\n".join(search_paths))) + raise OSError("Cant find {}.so. searched at:\n {}".format(libname, "\n ".join(search_paths))) return ctypes.CDLL(lib)