Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 854567 - games-fps/serious-sam-tse: switch to fork for working package
Summary: games-fps/serious-sam-tse: switch to fork for working package
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: EBUILD, PullRequest
Depends on:
Blocks:
 
Reported: 2022-06-27 08:32 UTC by Alexander Pavlov
Modified: 2024-01-08 12:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
New ebuild for Serious Sam The Second Encounter (serious-sam-tse-1.10.2.ebuild,6.44 KB, application/x-extension-ebuild)
2022-06-27 08:32 UTC, Alexander Pavlov
Details
New ebuild for Serious Sam The First Encounter (serious-sam-tfe-1.10.2.ebuild,6.51 KB, application/x-extension-ebuild)
2022-06-27 08:34 UTC, Alexander Pavlov
Details
Patch1 (rparh_security_2.patch,1.34 KB, patch)
2022-06-27 08:36 UTC, Alexander Pavlov
Details | Diff
Patch2 (rparh_security_vk_2.patch,1.75 KB, patch)
2022-06-27 08:37 UTC, Alexander Pavlov
Details | Diff
Manifest for Serious Sam TFE (Manifest,1.84 KB, text/plain)
2022-06-27 08:51 UTC, Alexander Pavlov
Details
Manifest for Serious Sam TSE (Manifest,1.84 KB, text/plain)
2022-06-27 08:52 UTC, Alexander Pavlov
Details
Fixing the game under building with gcc 11.3 (gcc-11.3_fixed_mod_startup.patch,1.40 KB, patch)
2022-07-01 16:44 UTC, Alexander Pavlov
Details | Diff
Ebuild for building with gcc 11.3 Serious Sam The First Encounter (serious-sam-tfe-1.10.2.ebuild,7.41 KB, application/x-extension-ebuild)
2022-07-01 16:48 UTC, Alexander Pavlov
Details
Ebuild for building with gcc 11.3 Serious Sam The Second Encounter (serious-sam-tse-1.10.2.ebuild,7.23 KB, application/x-extension-ebuild)
2022-07-01 16:49 UTC, Alexander Pavlov
Details
Patch for standardize paths "usr_system_dir.patch" (usr_system_dir.patch,6.96 KB, patch)
2022-07-14 15:45 UTC, Alexander Pavlov
Details | Diff
games-fps/serioussam/serioussam-1.10.2.ebuild (serioussam-1.10.2.ebuild,8.57 KB, application/x-extension-ebuild)
2022-07-14 15:47 UTC, Alexander Pavlov
Details
games-fps/serioussam/Manifest (Manifest,1.83 KB, text/plain)
2022-07-14 15:49 UTC, Alexander Pavlov
Details
games-fps/serioussamse/serioussamse-1.10.2.ebuild (serioussamse-1.10.2.ebuild,8.87 KB, application/x-extension-ebuild)
2022-07-14 15:50 UTC, Alexander Pavlov
Details
games-fps/serioussamse/Manifest (Manifest,1.83 KB, text/plain)
2022-07-14 15:52 UTC, Alexander Pavlov
Details
games-fps/serioussam-data/serioussam-data-1.5.ebuild (serioussam-data-1.5.ebuild,2.06 KB, application/x-extension-ebuild)
2022-07-14 15:52 UTC, Alexander Pavlov
Details
games-fps/serioussamse-data/serioussamse-data-1.7.ebuild (serioussamse-data-1.7.ebuild,1.95 KB, application/x-extension-ebuild)
2022-07-14 15:54 UTC, Alexander Pavlov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov 2022-06-27 08:32:15 UTC
Created attachment 787979 [details]
New ebuild for Serious Sam The Second Encounter

At the moment Serious Sam The Second Encounter installed from here https://packages.gentoo.org/packages/games-fps/serious-sam-tse does not run.
On startup we have an error:
ssam_lnx:
Program received signal SIGSEGV, Segmentation fault.
0xf72c58e0 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/32/libstdc++.so

ssam_lnx.dynamic:
Thread 1 "ssam_lnx.dynami" received signal SIGSEGV, Segmentation fault.
0xf72168e0 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/32/libstdc++.so.6

As you know, in 2016, Croteam published the source code of the Serious Sam game engine. Then, in 2016, Ryan Gordon took up porting it.
Porting work has not been completed. There are many mistakes left. Last fall, I started fixing the errors in the Linux port of the game.
Then I ported the Vulkan support to Serious Sam. I documented some of the fixes. They can be viewed here:
https://github.com/tx00100xt/SeriousSamClassic/blob/main/CHANGELOG.md
https://github.com/tx00100xt/SeriousSamClassic-VK/blob/main/CHANGELOG.md

I wrote ebuilds for Serious Sam The First Encounter and Serious Sam The Second Encounter with Vulkan support and the Xplus add-on.
Ebuilds have "vulkan xplus cdrom" USE flags. The USE flag vulkan determines whether to build the game with volcano support. 
The xplus flag sets the xplus addition. The cdrom flag is for installing game content from disk.
Comment 1 Alexander Pavlov 2022-06-27 08:34:36 UTC
Created attachment 787985 [details]
New ebuild for Serious Sam The First Encounter
Comment 2 Alexander Pavlov 2022-06-27 08:36:36 UTC
Created attachment 787988 [details, diff]
Patch1
Comment 3 Alexander Pavlov 2022-06-27 08:37:04 UTC
Created attachment 787991 [details, diff]
Patch2
Comment 4 Alexander Pavlov 2022-06-27 08:51:44 UTC
Created attachment 787994 [details]
Manifest for Serious Sam TFE
Comment 5 Alexander Pavlov 2022-06-27 08:52:16 UTC
Created attachment 787997 [details]
Manifest for Serious Sam TSE
Comment 6 James Le Cuirot gentoo-dev 2022-06-28 13:34:27 UTC
Haven't looked at this yet, but I've had my own ebuilds lined up for ages. The only reason I haven't published them yet is because I'd done some heavy patching to deal with the engine's terrible path handling. I got a bit sidetracked, trying to ensure I hadn't broken the game on Windows, but it was probably broken already. I had been thinking about coming back to this soon.
Comment 7 Alexander Pavlov 2022-06-29 07:48:43 UTC
Thanks for reply. Serious Sam classic is my favorite game.
Recently, I discovered that if the video adapter is defined as ATI, 
then the parameter mdl_bFineQuality worsens the weapon model is set. 
This is due to the fact that the scripts are old and were designed for old hardware.
This is easy to fix before installing with sed.

> sed -i 's/mdl_bFineQuality = 0;/mdl_bFineQuality = 1;/g' "${D}/${dir}"/Scripts/GLSettings/RAM.ini
> sed -i 's/mdl_bFineQuality = 0;/mdl_bFineQuality = 1;/g' "${D}/${dir}"/Scripts/GLSettings/ATI-RPRO.in
Comment 8 Alexander Pavlov 2022-07-01 16:44:24 UTC
Created attachment 789320 [details, diff]
Fixing the game under building with gcc 11.3

The day before yesterday I updated the system to the latest portage. Today I discovered that when building with gcc 11.3 with the -DSINGLE_THREADED=FALSE key, the mods does not start. Under the gdb debugger I found the problem and made a patch. The problem turned out to be the incorrect end of the game. Under gcc 10.3 this problem was not. The patch solves this problem. Now the game ends correctly and the mods are launched. I rewrote the ebuilds and at the same time added the arm64 architecture to them, since the fork works on Raspberry Pi 4.
Comment 9 Alexander Pavlov 2022-07-01 16:48:55 UTC
Created attachment 789323 [details]
Ebuild for building with gcc 11.3 Serious Sam The First Encounter
Comment 10 Alexander Pavlov 2022-07-01 16:49:41 UTC
Created attachment 789326 [details]
Ebuild for building with gcc 11.3 Serious Sam The Second Encounter
Comment 11 James Le Cuirot gentoo-dev 2022-07-11 22:47:01 UTC
Hey tx00100xt. I feel a bit odd addressing you as that, but you appear to want to remain anonymous, and I respect that.

I wanted to check the origins of this work as we cannot just assume it to be safe. I have quickly compared it against ptitSeb's fork and it looks okay. There are a lot of changes, but reading around, I understand that someone else forked ptitSeb's version privately and worked on it for a while, then you made that work public and took it further. Is that correct?

As I mentioned, I'd done quite a lot of work against ptitSeb's fork, but only a small amount has been merged as it is in progress. You seem to believe that his version is very buggy. It ran okay for me, but then I've only done some very brief testing. I don't want my efforts to go to waste, so I'll see whether I can redo some of my changes against your version.

Some of my work improves the path handling, not just to write files to HOME, but also to allow a more standards-compliant installation with the binaries in /usr/bin, the libraries in /usr/lib, and the data in /usr/share.

I find it strange that the engine source was duplicated for TFE and TSE when they used to share a single source tree. Do you know the reason for that?

Finally, my new ebuilds have just the data for TFE and TSE in separate packages, and both engines in a third package with "tfe" and "tse" as USE flags. I'd at least like to keep the data separate. Let's review this after I've gone over my patches.
Comment 12 Alexander Pavlov 2022-07-12 12:35:04 UTC
Hello James Le Cuirot. Thank you for working on my favorite game.

Yes, that's exactly how it is. Last fall, I cloned the ptitSeb repository and built the game. 
Unfortunately, there were a lot of errors uncorrected since 2016. 
So I decided to take on the task of fixing bugs and bringing the game to a stable state. 
Later I published the result of my work.

Regarding the PtitSteb fork, I can say the following. I've looked at all the commits since 2016. 
And I did not see any engine fixes. In fact, all serious work stopped in the fall of 2016, when Ryan Gordon stopped accepting pull requests. 
This influenced my decision to take up the work of fixing the errors.

Since my fork is based on the ptitSeb fork, I think patching the paths /usr/lib  and /usr/share shouldn't be a problem.
These patches can also be added to the source code on github.

The original source code published by Croteam did not contain the Entities library for TFE. 
This library was later added to Ryan Gordon's port from the SDK published in 2001. 
In fact, the published code was more suitable for TSE. For convenience, I made two branches TFE and TSE at the very beginning of work. 
Because there are resource conflicts in the Scripts directory, as well as slightly different settings in the Controls directory.
Also, the game engine loads all resources from the game's root directory on startup into memory. 
So I decided early on that it would be more convenient to separate directories, since at an early stage I did not think about the directory /usr.

I also think it's better to have separate data and code ebuilds. It's just that the old ebuild was taken as a basis, where everything was together.

Best Regards
Comment 13 Alexander Pavlov 2022-07-14 15:45:45 UTC
Created attachment 791396 [details, diff]
Patch for standardize paths "usr_system_dir.patch"

I decided to rewrite the code to standardize paths so that executables are in the /usr/bin directory, libraries in /usr/lib(64), and the date is in /usr/share.
After thinking, I decided that the best way would be to use the internal name of the game inside the engine.
This will immediately give the paths universality, regardless of the running game, TFE or TSE. I also made the most of internal functions and shared variables. As a result, the code turned out to be compact.
All changes are included in the patch usr_system_dir.patch. Also, the solution turned out to be universal. If the user launches the game from the /usr/bin directory, then all system paths /usr (share, lib ) are used, and if the game is built and launched in the home directory, then they are not used. I also included the xplus mod as a USE flag because it's the best thing ever fans made for a Serious Sam The First Encounter. For four years they worked and changed textures to HD. They also changed weapon models to HD and changed effects.

The directory structure looks like this:

Binaries - /usr/bin/"gamename"
Librares - /usr/lib(64), /usr/lib(64)/"gamename"
Game data - /usr/share/"gamename"
Mods librares - /usr/lib(64)/"gamename"/Mods/"modname"
Mods data - /usr/share/"gamename"/Mods/"modname"
User writable data - ~/.local/share/Serious-Engine/"gamename"

"gamename" - serioussam or serioussamse (internal game name).

As a result, I made four ebuilds. Two for the source code, the other two for installing data from the CD or image.
Comment 14 Alexander Pavlov 2022-07-14 15:47:47 UTC
Created attachment 791399 [details]
games-fps/serioussam/serioussam-1.10.2.ebuild

serioussam-1.10.2.ebuild
Comment 15 Alexander Pavlov 2022-07-14 15:49:21 UTC
Created attachment 791402 [details]
games-fps/serioussam/Manifest

Manifest for serioussam-1.10.2.ebuild
Comment 16 Alexander Pavlov 2022-07-14 15:50:30 UTC
Created attachment 791405 [details]
games-fps/serioussamse/serioussamse-1.10.2.ebuild

serioussamse-1.10.2.ebuild
Comment 17 Alexander Pavlov 2022-07-14 15:52:04 UTC
Created attachment 791408 [details]
games-fps/serioussamse/Manifest

Manifest for serioussamse-1.10.2.ebuild
Comment 18 Alexander Pavlov 2022-07-14 15:52:55 UTC
Created attachment 791411 [details]
games-fps/serioussam-data/serioussam-data-1.5.ebuild

serioussam-data-1.5.ebuild
Comment 19 Alexander Pavlov 2022-07-14 15:54:15 UTC
Created attachment 791414 [details]
games-fps/serioussamse-data/serioussamse-data-1.7.ebuild

serioussamse-data-1.7.ebuild
Comment 20 Alexander Pavlov 2022-07-14 17:47:24 UTC
In ebuilds serioussam-data-1.5.ebuild and serioussamse-data-1.7.ebuild, you need to remove the line DEPEND="games-fps/serioussam" and DEPEND="games-fps/serioussam", Otherwise, there is a cyclic dependency.
Comment 21 James Le Cuirot gentoo-dev 2022-07-14 22:38:23 UTC
Wow, I wish I could keep up here. It's been a busy week for me. This sounds great anyway. I'll try to take a look at the weekend.
Comment 22 Alexander Pavlov 2023-12-04 19:00:06 UTC
Hello!
At the request of @ulm, https://github.com/gentoo/gentoo/pull/34045#issuecomment-1839151916 I added the serious-sam-tse-1_beta1-r1.ebuild test here:

The game even started. But the binaries in it are very old.
After the start, there were graphical bugs and the game is going too fast because it does not know how to work with TSC p-state.
Graphic artifacts removed by changing the settings. But the game speed exceeds the required one several times.
Comment 23 Larry the Git Cow gentoo-dev 2023-12-26 22:50:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4d6e35d92e3b8688f3a53ceae57e4080a73f376

commit b4d6e35d92e3b8688f3a53ceae57e4080a73f376
Author:     Alexander Pavlov <t.x00100x.t@yandex.ru>
AuthorDate: 2023-12-08 13:03:55 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-12-26 22:49:28 +0000

    games-fps/serioussam: new package, add 1.10.6
    
    Bug: https://bugs.gentoo.org/854567
    Signed-off-by: Alexander Pavlov <t.x00100x.t@yandex.ru>
    [Use ED instead of D.]
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 games-fps/serioussam/Manifest                 |   1 +
 games-fps/serioussam/metadata.xml             |  22 ++++++
 games-fps/serioussam/serioussam-1.10.6.ebuild | 106 ++++++++++++++++++++++++++
 3 files changed, 129 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c00ddc858c80ec1423621552e3cc1383335dbf1

commit 7c00ddc858c80ec1423621552e3cc1383335dbf1
Author:     Alexander Pavlov <t.x00100x.t@yandex.ru>
AuthorDate: 2023-12-08 13:00:02 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-12-26 22:49:28 +0000

    games-fps/serioussam-tse-data: new package, add 1.7-r1
    
    Bug: https://bugs.gentoo.org/854567
    Signed-off-by: Alexander Pavlov <t.x00100x.t@yandex.ru>
    [Rename patch. Use ED instead of D.]
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 games-fps/serioussam-tse-data/Manifest             |  1 +
 games-fps/serioussam-tse-data/metadata.xml         | 15 +++++
 .../serioussam-tse-data-1.7-r1.ebuild              | 70 ++++++++++++++++++++++
 3 files changed, 86 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f55cca15abceece466b1f4333774be0e4e55af82

commit f55cca15abceece466b1f4333774be0e4e55af82
Author:     Alexander Pavlov <t.x00100x.t@yandex.ru>
AuthorDate: 2023-12-08 12:59:39 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-12-26 22:49:27 +0000

    games-fps/serioussam-tfe-data: new package, add 1.5-r1
    
    Bug: https://bugs.gentoo.org/854567
    Signed-off-by: Alexander Pavlov <t.x00100x.t@yandex.ru>
    [Rename patch. Use ED instead of D.]
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 games-fps/serioussam-tfe-data/Manifest             |  1 +
 games-fps/serioussam-tfe-data/metadata.xml         | 15 +++++
 .../serioussam-tfe-data-1.5-r1.ebuild              | 70 ++++++++++++++++++++++
 3 files changed, 86 insertions(+)
Comment 24 Larry the Git Cow gentoo-dev 2023-12-26 22:59:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=746a29ef00a7e7b85557f072e82c963b8c6a08d7

commit 746a29ef00a7e7b85557f072e82c963b8c6a08d7
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-12-26 22:59:22 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-12-26 22:59:22 +0000

    profiles: Mask games-fps/serious-sam-tse for removal
    
    Bug: https://bugs.gentoo.org/854567
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles/package.mask | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 25 Alexander Pavlov 2023-12-27 11:15:13 UTC
I checked the build from https://packages.gentoo.org/packages/games-fps/serioussam
Everything works correctly.

I wish you all a happy New Year.
Comment 26 Ulrich Müller gentoo-dev 2023-12-27 11:57:22 UTC
Thanks again for testing.

(Leaving this bug open until removal of the old games-fps/serious-sam-tse package.)
Comment 27 Larry the Git Cow gentoo-dev 2024-01-08 12:48:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aefb4e175260d118d169048111478f02aa058505

commit aefb4e175260d118d169048111478f02aa058505
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-01-08 12:45:52 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-01-08 12:48:03 +0000

    games-fps/serious-sam-tse: treeclean
    
    Closes: https://bugs.gentoo.org/854567
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 games-fps/serious-sam-tse/Manifest                 |   1 -
 games-fps/serious-sam-tse/metadata.xml             |   5 -
 .../serious-sam-tse-1_beta1-r1.ebuild              | 137 ---------------------
 3 files changed, 143 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3800dfdfea39a76b78a97367be251902de129524

commit 3800dfdfea39a76b78a97367be251902de129524
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-01-08 12:46:07 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-01-08 12:48:04 +0000

    profiles: Drop masks for removed games-fps/serious-sam-tse
    
    Bug: https://bugs.gentoo.org/854567
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles/arch/amd64/no-multilib/package.mask | 3 +--
 profiles/package.mask                        | 7 -------
 2 files changed, 1 insertion(+), 9 deletions(-)