Fix bundled bindings provider launch on Linux

This commit is contained in:
Sapphire committed 2026-12-05 19:16:44 -05:00
1 parent 8750da0855
commit b81fa39499
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