RealRTCW icon indicating copy to clipboard operation
RealRTCW copied to clipboard

fix linux build

Open jjdredd opened this issue 3 years ago • 10 comments

jjdredd avatar Aug 18 '22 06:08 jjdredd

Can you explain? I'm literally ZERO at anything related to linux

wolfetplayer avatar Aug 18 '22 16:08 wolfetplayer

function va_arg() used at https://github.com/wolfetplayer/RealRTCW/blob/master/code/steamshim/steamshim_child.c#L58 in function static void dbgpipe(const char *fmt, ...) is declared in stdarg.h: https://man7.org/linux/man-pages/man3/va_arg.3p.html

jjdredd avatar Aug 18 '22 17:08 jjdredd

I believe this file is related to steam integration code. Maybe it may be omitted at the stage of compilation for linux (or whenever you don't want steam integration).

Besides, I'm not sure if steam integration is going to work for linux. What do you think @Sialor ?

jjdredd avatar Aug 18 '22 17:08 jjdredd

Can confirm that this fix build on linux. together with

--- a/code/game/g_main.c        2022-08-14 10:45:34.000000000 +0200
+++ b/code/game/g_main.c        2022-08-19 14:37:51.620735638 +0200
@@ -30,7 +30,7 @@


 #include "g_local.h"
-#include "../../steam/steam.h"
+#include "../steam/steam.h"

 level_locals_t level;

M0Rf30 avatar Aug 19 '22 12:08 M0Rf30

@M0Rf30 I will recheck again later but I don't think I had to change path to steam.h in g_main.c to build the engine. Perhaps we were building with different options.

jjdredd avatar Aug 19 '22 20:08 jjdredd

here my build options

  USE_INTERNAL_LIBS=0 \
  COPYDIR=${pkgdir}/opt/realrtcw \
  make copyfiles

and I also use unset CFLAGS cause some warnings are treated as errors with default distro flags. with the referenced patches I manage to build the executable and launch the game, but it suddenly stops, clicking on any of the menu entries. Nothing of this happens with previous non-steam/steam splitting

M0Rf30 avatar Aug 19 '22 22:08 M0Rf30

I have just tested again: the game works fine on my intel video card, but when I try to use the nvidia video card, the menu freezes when I select a savegame. I'm using optimus, this might cause the issue

Nothing of this happens with previous non-steam/steam splitting

Do you think if we omit the steam stuff from the engine, the linux build will work fine?

Edit: The game freezing with nvidia graphics is a problem on my side, probably nothing wrong with the engine.

jjdredd avatar Aug 20 '22 01:08 jjdredd

Finally I managed to fix it. Seems to work like a charm. Because I maintain the AUR package since 2.1, I also updated it. Check it out for the patch

Schermata del 2022-08-20 16-41-13

M0Rf30 avatar Aug 20 '22 14:08 M0Rf30

Can you guys put together a final commit in this pull request?

wolfetplayer avatar Aug 20 '22 14:08 wolfetplayer

@wolfetplayer I can say from side that the only needed edits are the ones within this file https://aur.archlinux.org/cgit/aur.git/plain/disable-steam.patch?h=realrtcw

and using the unset CFLAGS, because otherwise some warnings are treated as errors (cause of arch linux strict CFLAGS).

I refer to thiis error

CGAME_CC code/cgame/cg_main.c
code/cgame/cg_main.c: In function ‘CG_LoadTranslationTextStrings’:
code/cgame/cg_main.c:969:9: error: format not a string literal and no format arguments [-Werror=format-security]
  969 |         Com_sprintf(filename, MAX_QPATH, file);
      |         ^~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [Makefile:2923: build/release-linux-x86_64/main/cgame/cg_main.o] Errore 1

That's all . Dunno about nvidia. I'm using Intel HD 630 GPU with rend2 renderer

Here my 2 cents https://github.com/wolfetplayer/RealRTCW/pull/86

M0Rf30 avatar Aug 20 '22 14:08 M0Rf30