Newer
Older
minerva / Ports / serious-sam-classic / patches / 0007-Engine-Support-running-from-usr-local.patch
@minerva minerva on 13 Jul 1 KB Initial commit
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jelle Raaijmakers <jelle@gmta.nl>
Date: Sun, 30 Apr 2023 16:53:57 +0200
Subject: [PATCH] Engine: Support running from `/usr/local`

A lot of logic is hardcoded to `/usr`, so we push it in the right
direction to allow it to run from `/usr/local` instead.
---
 SamTFE/Sources/Engine/Engine.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/SamTFE/Sources/Engine/Engine.cpp b/SamTFE/Sources/Engine/Engine.cpp
index f3e2ebe155439cef2a5860201665839fc2cc09c3..0bf86cc57563ef5f44e25d97623194f99484060e 100644
--- a/SamTFE/Sources/Engine/Engine.cpp
+++ b/SamTFE/Sources/Engine/Engine.cpp
@@ -736,7 +736,7 @@ ENGINE_API void SE_InitEngine(CTString strGameID)
   CPrintF(TRANSV("Running %d-bit version\n"), sys_iGameBits);
 
 #ifdef PLATFORM_UNIX
-  int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 );
+  int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/local/bin/", (size_t) 15 );
   if( _isystempath == 0 ) {
        sys_iSysPath = 1; // using system path
   } else {
@@ -751,8 +751,8 @@ ENGINE_API void SE_InitEngine(CTString strGameID)
     _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/";
   } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64")) {
     _fnmModLibPath = "/usr/lib64/" + strGameID + "/";
-  } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib")) {
-    _fnmModLibPath = "/usr/lib/" + strGameID + "/";
+  } else if( sys_iSysPath == 1 && _pFileSystem->IsDirectory((const char *) "/usr/local/lib")) {
+    _fnmModLibPath = "/usr/local/lib/" + strGameID + "/";
   } else {
     _fnmModLibPath = _fnmApplicationPath;
   }