mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
Fix bundled bindings provider launch on Linux
This commit is contained in:
1 file changed
+14
-1
@@ -147,7 +147,20 @@ suspend fun startBindingsProvider() = withContext(Dispatchers.IO) {
|
||||
// For some users, starting the executable immediately may cause startup failures
|
||||
delay(3000L)
|
||||
val proc = try {
|
||||
ProcessBuilder(path.toString()).start()
|
||||
val b = ProcessBuilder(path.toString())
|
||||
|
||||
// Make the dynamic linker able to find bundled libopenvr_api.so
|
||||
if (CURRENT_PLATFORM == Platform.LINUX) {
|
||||
val parent = path.parent
|
||||
if (parent.resolve("libopenvr_api.so").exists()) {
|
||||
val libraryPath = System.getenv("LD_LIBRARY_PATH")?.let { curLibraryPath ->
|
||||
"$curLibraryPath:$parent"
|
||||
} ?: parent.toString()
|
||||
b.environment()["LD_LIBRARY_PATH"] = libraryPath
|
||||
}
|
||||
}
|
||||
|
||||
b.start()
|
||||
} catch (e: Exception) {
|
||||
AppLogger.steamvr.error(e, "Failed to start bindings provider")
|
||||
return@withContext
|
||||
|
||||
Reference in new issue
Block a user