diff --git a/README.md b/README.md index ad65fd4..cb524f6 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,20 @@ make -j4 make install ``` +Flatpak +------- +You can also install the game using [io.itch.tx00100xt.SeriousSamClassic] flatpak +from the flathub repository. When you first start the game, +you will be asked to place your game data along the following paths: +``` +~/.var/app/io.itch.tx00100xt.SeriousSamClassic/data/Serious-Engine/serioussam +``` +``` +~/.var/app/io.itch.tx00100xt.SeriousSamClassic/data/Serious-Engine/serioussamse +``` +You can place game data in these paths before starting the game. Then the game will start immediately. +To start the game, use the application menu. More detailed information about flatpak on the [SeriousSamClassic Flatpak wiki.](https://github.com/tx00100xt/SeriousSamClassic/wiki/Flatpak.md) + Running ------- @@ -431,6 +445,7 @@ Some of the code included with the engine sources is not licensed under the GNU * LightWave SDK (located in `Sources/LWSkaExporter/SDK`) by NewTek Inc. * libogg/libvorbis (located in `Sources/libogg` and `Sources/libvorbis`) by Xiph.Org Foundation +[io.itch.tx00100xt.SeriousSamClassic]: https://flathub.org/apps/io.itch.tx00100xt.SeriousSamClassic "Serious Sam Classic on flathub" [Xplus TFE from Google Drive]: https://drive.google.com/file/d/1MPmibfMCGTWFBSGeFWG3uae0zZzJpiKy/view?usp=sharing "Serious Sam Classic XPLUS Mod" [Xplus TSE from Google Drive]: https://drive.google.com/file/d/1W_UIeVl7y3ZBroM39FmKdngNZuXC7DKv/view?usp=sharing "Serious Sam Classic XPLUS Mod" [Xplus TFE from pCloud]: https://e1.pcloud.link/publink/show?code=XZ02gRZ4nhrRGPSfV4aEL4IF8GYySafWVJX "Serious Sam Classic XPLUS Mod" diff --git a/flatpak/0001-CMakeLists.txt.patch b/flatpak/0001-CMakeLists.txt.patch new file mode 100644 index 0000000..7b35edc --- /dev/null +++ b/flatpak/0001-CMakeLists.txt.patch @@ -0,0 +1,160 @@ +--- 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,19 @@ + 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" ++ if(INTERNAL_NAME STREQUAL "serioussam") ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic.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() ++ else() ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic.SE.desktop" ++ DESTINATION "${CMAKE_INSTALL_PREFIX}//share/applications" ++ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ++ endif() ++ install(FILES ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png ++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps" RENAME "io.itch.tx00100xt.SeriousSamClassic.${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,19 @@ + 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" ++ if(INTERNAL_NAME STREQUAL "serioussam") ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic.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() ++ else() ++ install(FILES "${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.desktop" RENAME "io.itch.tx00100xt.SeriousSamClassic.SE.desktop" ++ DESTINATION "${CMAKE_INSTALL_PREFIX}//share/applications" ++ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ++ endif() ++ install(FILES ${CMAKE_ADD_TARGET_DIR}/../${INTERNAL_NAME}.png ++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps" RENAME "io.itch.tx00100xt.SeriousSamClassic.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..49e8939 --- /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 %s\nThe home directory will be searched."),(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 path:\n%s\n \nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(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 %s\nThe home directory will be searched."),(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 path:\n%s\n \nSee the log for more details.\nGame log is here: %s/SeriousSam.log"),(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..3efa20e --- /dev/null +++ b/flatpak/0003-desktop-file.patch @@ -0,0 +1,20 @@ +--- 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,6 @@ + Comment=Linux port of Serious Sam Classic The First Encounter + Exec=serioussam + TryExec=serioussam +-Icon=serioussam ++Icon=io.itch.tx00100xt.SeriousSamClassic + Categories=Application;Game; ++Keywords=serious;sam;first;person;shooter;singleplayer;multiplayer +--- 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,6 @@ + Comment=Linux port of Serious Sam Classic The Second Encounter + Exec=serioussamse + TryExec=serioussamse +-Icon=serioussam ++Icon=io.itch.tx00100xt.SeriousSamClassic + Categories=Application;Game; ++Keywords=serious;sam;first;person;shooter;singleplayer;multiplayer; diff --git a/flatpak/io.itch.tx00100xt.SeriousSamClassic.metainfo.xml b/flatpak/io.itch.tx00100xt.SeriousSamClassic.metainfo.xml new file mode 100644 index 0000000..6593db6 --- /dev/null +++ b/flatpak/io.itch.tx00100xt.SeriousSamClassic.metainfo.xml @@ -0,0 +1,56 @@ + + + + + io.itch.tx00100xt.SeriousSamClassic + SeriousSamClassic + SeriousSamClassic is a Serious-Engine GPL source port + CC0-1.0 + GPL-2.0 + + Alexander Pavlov + t.x00100x.t@yandex.ru + + https://github.com/tx00100xt/SeriousSamClassic + https://github.com/tx00100xt/SeriousSamClassic/wiki + https://github.com/tx00100xt/SeriousSamClassic + + io.itch.tx00100xt.SeriousSamClassic.desktop + io.itch.tx00100xt.SeriousSamClassic.SE.desktop + + +

SeriousSamClassic is open source game engine version developed by Croteam for Serious Sam Classic (Windows, Linux, FreeBSD, OpenBSD, Raspberry Pi OS, macOS). Based on https://github.com/Croteam-official/Serious-Engine and linux port https://github.com/icculus/Serious-Engine, but it should work on (or be easily portable to) any system that supports OpenGL 1.3 and SDL2. +

+

Note that while the Serious-Engine source code has been released under GPL, you still need to legally own the game and provide Serious Sam Classic The First Encounter and Serious Sam Classic The Second Encounter the game data to play. See the How to Install section for more information. +

+
+ + + + https://github.com/tx00100xt/SeriousSamClassic/raw/main/Images/samxplus_1.png + SeriousSamClassic running on Linux with XPLUS Mod. Oasis. + + + https://github.com/tx00100xt/SeriousSamClassic/raw/main/Images/samxplus_2.png + SeriousSamClassic running on Linux with XPLUS Mod. Dunes. + + + https://github.com/tx00100xt/SeriousSamClassic/raw/main/Images/samxplus_3.png + SeriousSamClassic running on Linux with XPLUS Mod. Sacred Yards. + + + + + moderate + none + mild + mild + intense + + + + + + +
+ diff --git a/flatpak/io.itch.tx00100xt.SeriousSamClassic.png b/flatpak/io.itch.tx00100xt.SeriousSamClassic.png new file mode 100644 index 0000000..b8924f6 Binary files /dev/null and b/flatpak/io.itch.tx00100xt.SeriousSamClassic.png differ diff --git a/flatpak/io.itch.tx00100xt.SeriousSamClassic.yaml b/flatpak/io.itch.tx00100xt.SeriousSamClassic.yaml new file mode 100644 index 0000000..88e63e3 --- /dev/null +++ b/flatpak/io.itch.tx00100xt.SeriousSamClassic.yaml @@ -0,0 +1,53 @@ +app-id: io.itch.tx00100xt.SeriousSamClassic +runtime: org.freedesktop.Platform +sdk: org.freedesktop.Sdk +runtime-version: '23.08' +command: serioussam + +finish-args: + - --socket=wayland + - --socket=fallback-x11 + - --device=dri + - --share=ipc + - --share=network + - --socket=pulseaudio + +cleanup: + - '*.la' + - '*.a' + +modules: + + - name: serioussam + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + post-install: + - install -Dm 644 io.itch.tx00100xt.SeriousSamClassic.metainfo.xml -t /app/share/metainfo + - install -Dm 644 io.itch.tx00100xt.SeriousSamClassic.png -t /app/share/icons/hicolor/128x128/apps/ + sources: + - type: archive + url: https://github.com/tx00100xt/SeriousSamClassic/archive/refs/tags/1.10.6d.tar.gz + sha256: 26d228036068dfb966ecc3986819e3e17db93a28449702416caee8526c795d2b + - type: patch + path: 0001-CMakeLists.txt.patch + - type: patch + path: 0002-Engine.cpp.patch + - type: patch + path: 0003-desktop-file.patch + - type: file + path: io.itch.tx00100xt.SeriousSamClassic.metainfo.xml + - type: file + path: io.itch.tx00100xt.SeriousSamClassic.png + + - name: xplus + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DXPLUS=TRUE + sources: + - type: archive + url: https://github.com/tx00100xt/SeriousSamClassic-VK/archive/refs/tags/1.10.6d.tar.gz + sha256: 26d228036068dfb966ecc3986819e3e17db93a28449702416caee8526c795d2b + - type: patch + path: 0001-CMakeLists.txt.patch