diff --git a/flatpak/0001-CMakeLists.txt.patch b/flatpak/0001-CMakeLists.txt.patch new file mode 100644 index 0000000..7a55e56 --- /dev/null +++ b/flatpak/0001-CMakeLists.txt.patch @@ -0,0 +1,150 @@ +--- a/SamTFE/Sources/CMakeLists.txt 2023-12-26 13:14:52.642181538 +0300 ++++ b/SamTFE/Sources/CMakeLists.txt 2024-01-25 13:11:34.028642313 +0300 +@@ -239,16 +239,6 @@ + endif() + endif() + +-# ImageMagic needed for SYSTEM INSTALL +-if(NOT LOCAL_INSTALL) +- find_package(ImageMagick COMPONENTS convert) +- if(ImageMagick_convert_FOUND) +- #message(STATUS "ImageMagick convert found: ${ImageMagick_convert_EXECUTABLE}") +- else() +- message(FATAL_ERROR "Error! LOCAL_INSTAL is set but neccessary ImageMagick convert are missing") +- endif() +-endif() +- + # remove clang spam. + if(MACOSX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness -Wno-deprecated") +@@ -327,10 +317,10 @@ + message(STATUS "Operating system name: ${CMAKE_OS_NAME}") + + set(CMAKE_ARCH_BITS 32) +-set(CMAKE_INSTALL_LIBDIR "/usr/lib") ++set(CMAKE_INSTALL_LIBDIR "/app/lib") ++set(CMAKE_INSTALL_PREFIX "/app") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_ARCH_BITS 64) +- set(CMAKE_INSTALL_LIBDIR "/usr/lib64") + endif() + + if(FREEBSD) +@@ -393,9 +383,9 @@ + add_compile_options(-mpowerpc64) + else() + if(LOCAL_INSTALL) +- add_compile_options(-march=native) ++ add_compile_options(-mtune=generic) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i586|i686|x86|amd64|AMD64|x86_64") +- add_compile_options(-march=native) # set mtune=generic if nedded ++ add_compile_options(-mtune=generic) # set mtune=generic if nedded + endif() + endif() + endif() +@@ -1814,24 +1804,14 @@ + install(FILES ${CMAKE_ADD_TARGET_DIR}/../SE1_10b.gro + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${INTERNAL_NAME}" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic-VK.${INTERNAL_NAME}.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}//share/applications" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- set(A 16) +- set(B 32) +- set(C 48) +- set(D 64) +- set(E 128) +- foreach(X IN LISTS A B C D E) +- #message(STATUS "Create icon ${X}x${X}") +- execute_process ( +- COMMAND bash -c "${ImageMagick_convert_EXECUTABLE} ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png -scale ${X}x${X} ${CMAKE_ADD_TARGET_DIR}/../${X}.png;" +- OUTPUT_VARIABLE outVar +- ) +- install(FILES ${CMAKE_ADD_TARGET_DIR}/../${X}.png +- DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${X}x${X}/apps" RENAME "${INTERNAL_NAME}.png" +- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- endforeach() ++ ++ install(FILES ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png ++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps" RENAME "io.itch.tx00100xt.SeriousSamClassic-VK.${INTERNAL_NAME}.png" ++ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ++ + endif() + + # end of CMakeLists.txt ... +--- a/SamTSE/Sources/CMakeLists.txt 2023-12-26 13:14:52.642181538 +0300 ++++ b/SamTSE/Sources/CMakeLists.txt 2024-01-25 13:11:34.028642313 +0300 +@@ -239,16 +239,6 @@ + endif() + endif() + +-# ImageMagic needed for SYSTEM INSTALL +-if(NOT LOCAL_INSTALL) +- find_package(ImageMagick COMPONENTS convert) +- if(ImageMagick_convert_FOUND) +- #message(STATUS "ImageMagick convert found: ${ImageMagick_convert_EXECUTABLE}") +- else() +- message(FATAL_ERROR "Error! LOCAL_INSTAL is set but neccessary ImageMagick convert are missing") +- endif() +-endif() +- + # remove clang spam. + if(MACOSX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nullability-completeness -Wno-deprecated") +@@ -327,10 +317,10 @@ + message(STATUS "Operating system name: ${CMAKE_OS_NAME}") + + set(CMAKE_ARCH_BITS 32) +-set(CMAKE_INSTALL_LIBDIR "/usr/lib") ++set(CMAKE_INSTALL_LIBDIR "/app/lib") ++set(CMAKE_INSTALL_PREFIX "/app") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_ARCH_BITS 64) +- set(CMAKE_INSTALL_LIBDIR "/usr/lib64") + endif() + + if(FREEBSD) +@@ -393,9 +383,9 @@ + add_compile_options(-mpowerpc64) + else() + if(LOCAL_INSTALL) +- add_compile_options(-march=native) ++ add_compile_options(-mtune=generic) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i586|i686|x86|amd64|AMD64|x86_64") +- add_compile_options(-march=native) # set mtune=generic if nedded ++ add_compile_options(-mtune=generic) # set mtune=generic if nedded + endif() + endif() + endif() +@@ -1814,24 +1804,14 @@ + install(FILES ${CMAKE_ADD_TARGET_DIR}/../SE1_10b.gro + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${INTERNAL_NAME}" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic-VK.${INTERNAL_NAME}.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}//share/applications" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- set(A 16) +- set(B 32) +- set(C 48) +- set(D 64) +- set(E 128) +- foreach(X IN LISTS A B C D E) +- #message(STATUS "Create icon ${X}x${X}") +- execute_process ( +- COMMAND bash -c "${ImageMagick_convert_EXECUTABLE} ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png -scale ${X}x${X} ${CMAKE_ADD_TARGET_DIR}/../${X}.png;" +- OUTPUT_VARIABLE outVar +- ) +- install(FILES ${CMAKE_ADD_TARGET_DIR}/../${X}.png +- DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/${X}x${X}/apps" RENAME "${INTERNAL_NAME}.png" +- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) +- endforeach() ++ ++ install(FILES ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png ++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps" RENAME "io.itch.tx00100xt.SeriousSamClassic-VK.${INTERNAL_NAME}.png" ++ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ++ + endif() + + # end of CMakeLists.txt ... diff --git a/flatpak/0002-Engine.cpp.patch b/flatpak/0002-Engine.cpp.patch new file mode 100644 index 0000000..43194d0 --- /dev/null +++ b/flatpak/0002-Engine.cpp.patch @@ -0,0 +1,290 @@ +--- a/SamTFE/Sources/Engine/Engine.cpp 2023-11-28 16:51:55.989955484 +0300 ++++ b/SamTFE/Sources/Engine/Engine.cpp 2024-01-25 12:59:40.376276525 +0300 +@@ -743,11 +743,11 @@ + + #ifdef PLATFORM_UNIX + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/local/bin/", (size_t) 15 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/local/bin/", (size_t) 15 ); + #elif defined(__NetBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/pkg/bin/", (size_t) 13 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/pkg/bin/", (size_t) 13 ); + #else +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/bin/", (size_t) 9 ); + #endif + if( _isystempath == 0 ) { + sys_iSysPath = 1; // using system path +@@ -759,35 +759,35 @@ + _fnmModLibPath = ""; + #if defined(__OpenBSD__) || defined(__FreeBSD__) + if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/local/lib/" + strGameID + "/"; ++ _fnmModLibPath = "/app/local/lib/" + strGameID + "/"; + #elif defined(__NetBSD__) + if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/pkg/lib/" + strGameID + "/"; ++ _fnmModLibPath = "/app/pkg/lib/" + strGameID + "/"; + #else +- if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/aarch64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/aarch64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/arm-linux-gnueabihf/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/arm-linux-gnueabihf/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/riscv64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/riscv64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/s390x-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/s390x-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/powerpc64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/powerpc64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/x86_64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/x86_64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/i386-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64/" + strGameID)) { +- _fnmModLibPath = "/usr/lib64/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib//" + strGameID)) { +- _fnmModLibPath = "/usr/lib/" + strGameID + "/"; ++ if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/aarch64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/aarch64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/arm-linux-gnueabihf/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/arm-linux-gnueabihf/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/riscv64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/riscv64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/s390x-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/s390x-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/powerpc64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/powerpc64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/x86_64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/x86_64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/i386-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/i386-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib64/" + strGameID)) { ++ _fnmModLibPath = "/app/lib64/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/" + strGameID + "/"; + #endif +- } else if( sys_iSysPath == 0 ) { +- _fnmModLibPath = _fnmApplicationPath; ++ } else if( sys_iSysPath == 1 ) { ++ _fnmModLibPath = "/app/lib/" + strGameID + "/"; + } else { + CPrintF(TRANSV("ERROR: Game libraries not ound!\n")); +- FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID); + } + + if( sys_iSysPath == 1 ) { // search game data +@@ -813,11 +813,11 @@ + } + CPrintF(TRANSV("Testing file: %s\n"), (const char *) _fnm_TestFile); + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnm_usr_TestFile = "/usr/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #elif defined(__NetBSD__) +- _fnm_usr_TestFile = "/usr/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #else +- _fnm_usr_TestFile = "/usr/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #endif + _fnm_local_TestFile = _fnmUserDir + _fnm_TestFile; // data in home .local + _fnm_home_TestFile = (const char *)_fnmUserDataPath + _fnm_TestFile; +@@ -827,11 +827,11 @@ + CPrintF(TRANSV("Testing local path: %s\n"), (const char *) _fnm_local_TestFile); + if( access((const char *) _fnm_usr_TestFile, F_OK) == 0 ) { + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnmApplicationPath = "/usr/local/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/local/share/" + strGameID + "/"; // all game data + #elif defined(__NetBSD__) +- _fnmApplicationPath = "/usr/pkg/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/pkg/share/" + strGameID + "/"; // all game data + #else +- _fnmApplicationPath = "/usr/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/share/" + strGameID + "/"; // all game data + #endif + CPrintF(TRANSV("Found usr path: %s\n"), (const char *) _fnmUserDataPath); + } else if( access((const char *) _fnm_local_TestFile, F_OK) == 0 ) { +@@ -841,11 +841,11 @@ + // search in home dir + // BOOL YesNoMessage(const char *strFormat, ...) + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- InfoMessage(TRANS("No game files were found in /usr/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #elif defined(__NetBSD__) +- InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #else +- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #endif + struct passwd *pw = getpwuid(getuid()); + const char *_homedir = pw->pw_dir; +@@ -865,11 +865,11 @@ + CPrintF(TRANSV("ERROR: Game data not ound!\n")); + _fnmUserDataPath = ""; + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #elif defined(__NetBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #else +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #endif + } + } +@@ -1041,7 +1041,7 @@ + } + #elif defined(PLATFORM_PANDORA) + // restore default gamma +- system("sudo /usr/pandora/scripts/op_gamma.sh 0"); ++ system("sudo /app/pandora/scripts/op_gamma.sh 0"); + #endif + } + +--- a/SamTSE/Sources/Engine/Engine.cpp 2023-11-28 16:51:55.989955484 +0300 ++++ b/SamTSE/Sources/Engine/Engine.cpp 2024-01-25 12:59:40.376276525 +0300 +@@ -743,11 +743,11 @@ + + #ifdef PLATFORM_UNIX + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/local/bin/", (size_t) 15 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/local/bin/", (size_t) 15 ); + #elif defined(__NetBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/pkg/bin/", (size_t) 13 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/pkg/bin/", (size_t) 13 ); + #else +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 ); ++ int _isystempath = strncmp((const char *)strExePath, (const char *) "/app/bin/", (size_t) 9 ); + #endif + if( _isystempath == 0 ) { + sys_iSysPath = 1; // using system path +@@ -759,35 +759,35 @@ + _fnmModLibPath = ""; + #if defined(__OpenBSD__) || defined(__FreeBSD__) + if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/local/lib/" + strGameID + "/"; ++ _fnmModLibPath = "/app/local/lib/" + strGameID + "/"; + #elif defined(__NetBSD__) + if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/pkg/lib/" + strGameID + "/"; ++ _fnmModLibPath = "/app/pkg/lib/" + strGameID + "/"; + #else +- if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/aarch64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/aarch64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/arm-linux-gnueabihf/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/arm-linux-gnueabihf/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/riscv64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/riscv64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/s390x-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/s390x-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/powerpc64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/powerpc64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/x86_64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/x86_64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/i386-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64/" + strGameID)) { +- _fnmModLibPath = "/usr/lib64/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib//" + strGameID)) { +- _fnmModLibPath = "/usr/lib/" + strGameID + "/"; ++ if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/aarch64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/aarch64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/arm-linux-gnueabihf/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/arm-linux-gnueabihf/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/riscv64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/riscv64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/s390x-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/s390x-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/powerpc64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/powerpc64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib/x86_64-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/x86_64-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/i386-linux-gnu/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/i386-linux-gnu/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/app/lib64/" + strGameID)) { ++ _fnmModLibPath = "/app/lib64/" + strGameID + "/"; ++ } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/app/lib/" + strGameID)) { ++ _fnmModLibPath = "/app/lib/" + strGameID + "/"; + #endif +- } else if( sys_iSysPath == 0 ) { +- _fnmModLibPath = _fnmApplicationPath; ++ } else if( sys_iSysPath == 1 ) { ++ _fnmModLibPath = "/app/lib/" + strGameID + "/"; + } else { + CPrintF(TRANSV("ERROR: Game libraries not ound!\n")); +- FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID); + } + + if( sys_iSysPath == 1 ) { // search game data +@@ -813,11 +813,11 @@ + } + CPrintF(TRANSV("Testing file: %s\n"), (const char *) _fnm_TestFile); + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnm_usr_TestFile = "/usr/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #elif defined(__NetBSD__) +- _fnm_usr_TestFile = "/usr/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #else +- _fnm_usr_TestFile = "/usr/share/" + strGameID + "/" + _fnm_TestFile; // data in usr ++ _fnm_usr_TestFile = "/app/share/" + strGameID + "/" + _fnm_TestFile; // data in usr + #endif + _fnm_local_TestFile = _fnmUserDir + _fnm_TestFile; // data in home .local + _fnm_home_TestFile = (const char *)_fnmUserDataPath + _fnm_TestFile; +@@ -827,11 +827,11 @@ + CPrintF(TRANSV("Testing local path: %s\n"), (const char *) _fnm_local_TestFile); + if( access((const char *) _fnm_usr_TestFile, F_OK) == 0 ) { + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnmApplicationPath = "/usr/local/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/local/share/" + strGameID + "/"; // all game data + #elif defined(__NetBSD__) +- _fnmApplicationPath = "/usr/pkg/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/pkg/share/" + strGameID + "/"; // all game data + #else +- _fnmApplicationPath = "/usr/share/" + strGameID + "/"; // all game data ++ _fnmApplicationPath = "/app/share/" + strGameID + "/"; // all game data + #endif + CPrintF(TRANSV("Found usr path: %s\n"), (const char *) _fnmUserDataPath); + } else if( access((const char *) _fnm_local_TestFile, F_OK) == 0 ) { +@@ -841,11 +841,11 @@ + // search in home dir + // BOOL YesNoMessage(const char *strFormat, ...) + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- InfoMessage(TRANS("No game files were found in /usr/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #elif defined(__NetBSD__) +- InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #else +- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); ++ InfoMessage(TRANS("No game files were found in /app/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); + #endif + struct passwd *pw = getpwuid(getuid()); + const char *_homedir = pw->pw_dir; +@@ -865,11 +865,11 @@ + CPrintF(TRANSV("ERROR: Game data not ound!\n")); + _fnmUserDataPath = ""; + #if defined(__OpenBSD__) || defined(__FreeBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #elif defined(__NetBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #else +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); ++ FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/app/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) _fnmUserDir); + #endif + } + } +@@ -1041,7 +1041,7 @@ + } + #elif defined(PLATFORM_PANDORA) + // restore default gamma +- system("sudo /usr/pandora/scripts/op_gamma.sh 0"); ++ system("sudo /app/pandora/scripts/op_gamma.sh 0"); + #endif + } + diff --git a/flatpak/0003-desktop-file.patch b/flatpak/0003-desktop-file.patch new file mode 100644 index 0000000..05e4006 --- /dev/null +++ b/flatpak/0003-desktop-file.patch @@ -0,0 +1,18 @@ +--- a/SamTFE/serioussam.desktop 2024-01-25 13:57:23.483929853 +0300 ++++ a/SamTFE/serioussam.desktop 2024-01-25 14:00:54.558511402 +0300 +@@ -5,5 +5,5 @@ + Comment=Linux port of Serious Sam Classic The First Encounter + Exec=serioussam + TryExec=serioussam +-Icon=serioussam ++Icon=io.itch.tx00100xt.SeriousSamClassic-VK.serioussam + Categories=Application;Game; +--- a/SamTSE/serioussamse.desktop 2024-01-25 13:57:23.483929853 +0300 ++++ a/SamTSE/serioussamse.desktop 2024-01-25 14:00:54.558511402 +0300 +@@ -5,5 +5,5 @@ + Comment=Linux port of Serious Sam Classic The Second Encounter + Exec=serioussamse + TryExec=serioussamse +-Icon=serioussam ++Icon=io.itch.tx00100xt.SeriousSamClassic-VK.serioussamse + Categories=Application;Game;