Author Topic: Arch Linux Compilation Problems  (Read 1411 times)

Matthias

  • PGP
  • Posts: 1
Arch Linux Compilation Problems
« on: October 28, 2023, 05:30:20 AM »
I noticed that the source tarball is at version 40 and the binary is at version 45. Can you please upload the latest source code release?

Trying to compile the current one with the following PKGBUILD

Code: [Select]
pkgname=paintball2
pkgver=40
pkgrel=1
pkgdesc="Digital Paint: Paintball 2 is a fast-paced first-person game"
url="https://digitalpaint.org/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('bash' 'libjpeg' 'libpng' 'libvorbis' 'sdl' 'unzip')
source=("http://downloads.sourceforge.net/paintball2/paintball20_alpha040_src_20131016.zip")
sha256sums=('25c618a3717c5dd4b6f978d14fb921fed02e19b12c183bf4fa507d4e7c4f8c07')

build() {
    cd "${srcdir}/${pkgname}/"

    mkdir -p release
    make X11BASE=/usr LOCALBASE=/usr GAMEBASE=/usr BUILD_SDLGL=YES WITH_OGG_SUPPORT=YES WITH_DATADIR=YES WITH_LIBDIR=YES HAVE_IPV6=YES BUILD_DEDICATED=YES debug
}

package() {
    cd "${srcdir}/${pkgname}"

    make X11BASE=/usr LOCALBASE=/usr GAMEBASE=/usr install_root
}

fails with

Code: [Select]
cc -I/usr/include -I/usr/include -Dstricmp=strcasecmp -D_inline= -DSleep=usleep -DGAME_NAME='"game.so"' -DPAINTBALL2_VERSION='"2.0"' -DBUILD_VERSION='"27"' -Wno-pointer-sign -D_THREAD_SAFE -fno-stack-protector -msse -DC_ONLY -DOGG_SUPPORT -DHAVE_IPV6 -DC_ONLY -DDATADIR='"/usr/games/paintball2"' -DLIBDIR='"/usr/games/paintball2"' -g -ggdb -pipe -ffloat-store -ffast-math -D_DEBUG  -fPIC -o build_debug/ref_gl/gl_cin.o -c ref_gl/gl_cin.c
In file included from ref_gl/gl_local.h:27,
                 from ref_gl/gl_image.c:21:
ref_gl/glext.h:58: warning: "GL_GLEXT_VERSION" redefined
   58 | #define GL_GLEXT_VERSION 6
      |
game/q_shared.c: In function 'CPUID_Features':
game/q_shared.c:2585:4: error: #error no CPUID implementation
 2585 | #  error no CPUID implementation
      |    ^~~~~
In file included from /usr/include/GL/gl.h:2050,
                 from ref_gl/gl_local.h:26:
/usr/include/GL/glext.h:35: note: this is the location of the previous definition
   35 | #define GL_GLEXT_VERSION 20220530
      |
game/q_shared.c: In function 'CPUID_Features':
game/q_shared.c:2585:4: error: #error no CPUID implementation
 2585 | #  error no CPUID implementation
      |    ^~~~~
game/q_shared.c: In function 'CPUID_Features':
game/q_shared.c:2585:4: error: #error no CPUID implementation
 2585 | #  error no CPUID implementation
      |    ^~~~~
ref_gl/glext.h:3130: warning: "GL_OFFSET_TEXTURE_2D_MATRIX_NV" redefined
 3130 | #define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
      |
/usr/include/GL/glext.h:11263: note: this is the location of the previous definition
11263 | #define GL_OFFSET_TEXTURE_2D_MATRIX_NV    0x86E1
      |
ref_gl/glext.h:3131: warning: "GL_OFFSET_TEXTURE_2D_SCALE_NV" redefined
 3131 | #define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
      |
/usr/include/GL/glext.h:11264: note: this is the location of the previous definition
11264 | #define GL_OFFSET_TEXTURE_2D_SCALE_NV     0x86E2
      |
ref_gl/glext.h:3132: warning: "GL_OFFSET_TEXTURE_2D_BIAS_NV" redefined
 3132 | #define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
      |
/usr/include/GL/glext.h:11265: note: this is the location of the previous definition
11265 | #define GL_OFFSET_TEXTURE_2D_BIAS_NV      0x86E3
      |
server/null/cl_null.c:46:6: error: conflicting types for 'Con_Print'; have 'void(unsigned char *)'
   46 | void Con_Print (unsigned char *text)
      |      ^~~~~~~~~
In file included from server/null/cl_null.c:24:
server/null/../../qcommon/qcommon.h:945:6: note: previous declaration of 'Con_Print' with type 'void(const char *)'
  945 | void Con_Print (const char *text); // jittext
      |      ^~~~~~~~~
server/null/cl_null.c:62:6: error: conflicting types for 'SCR_BeginLoadingPlaque'; have 'void(void)'
   62 | void SCR_BeginLoadingPlaque (void)
      |      ^~~~~~~~~~~~~~~~~~~~~~
server/null/../../qcommon/qcommon.h:946:6: note: previous declaration of 'SCR_BeginLoadingPlaque' with type 'void(const char *)'
  946 | void SCR_BeginLoadingPlaque (const char *mapname); // jitloading
      |      ^~~~~~~~~~~~~~~~~~~~~~
linux/net_udp6.c: In function 'NetadrToSockadr':
linux/net_udp6.c:92:14: error: 'NA_MULTICAST6' undeclared (first use in this function); did you mean 'IN_MULTICAST'?
   92 |         case NA_MULTICAST6:
      |              ^~~~~~~~~~~~~
      |              IN_MULTICAST
linux/net_udp6.c:92:14: note: each undeclared identifier is reported only once for each function it appears in
linux/net_udp6.c:108:38: error: 'netadr_t' has no member named 'scope_id'
  108 |                 s6->sin6_scope_id = a->scope_id;
      |                                      ^~
linux/net_udp6.c:112:14: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  112 |         case NA_IP6:
      |              ^~~~~~
      |              NA_IPX
make[1]: *** [makefile:588: build_debug/ded/cl_null.o] Error 1
make[1]: *** Waiting for unfinished jobs....
linux/net_udp6.c:135:46: error: 'netadr_t' has no member named 'scope_id'
  135 |                         s6->sin6_scope_id = a->scope_id;
      |                                              ^~
linux/net_udp6.c: In function 'SockadrToNetadr':
linux/net_udp6.c:172:35: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  172 |                         a->type = NA_IP6;
      |                                   ^~~~~~
      |                                   NA_IPX
linux/net_udp6.c:173:26: error: 'netadr_t' has no member named 'scope_id'
  173 |                         a->scope_id = s6->sin6_scope_id;
      |                          ^~
make[1]: *** [makefile:646: build_debug/ref_gl/q_shared.o] Error 1
linux/net_udp6.c: In function 'NET_CompareAdr':
linux/net_udp6.c:197:23: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  197 |         if (a.type == NA_IP6)
      |                       ^~~~~~
      |                       NA_IPX
make[1]: *** [makefile:578: build_debug/ded/q_shared.o] Error 1
linux/net_udp6.c: In function 'NET_CompareBaseAdr':
linux/net_udp6.c:228:23: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  228 |         if (a.type == NA_IP6)
      |                       ^~~~~~
      |                       NA_IPX
linux/net_udp6.c: In function 'NET_BaseAdrToString':
linux/net_udp6.c:259:14: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  259 |         case NA_IP6:
      |              ^~~~~~
      |              NA_IPX
make[1]: *** [makefile:518: build_debug/client/q_shared.o] Error 1
linux/net_udp6.c:260:14: error: 'NA_MULTICAST6' undeclared (first use in this function); did you mean 'IN_MULTICAST'?
  260 |         case NA_MULTICAST6:
      |              ^~~~~~~~~~~~~
      |              IN_MULTICAST
linux/net_udp6.c:280:46: error: 'netadr_t' has no member named 'scope_id'
  280 |                         s6->sin6_scope_id = a.scope_id;
      |                                              ^
linux/net_udp6.c: At top level:
linux/net_udp6.c:417:17: error: conflicting types for 'NET_StringToAdr'; have 'qboolean(char *, netadr_t *)'
  417 | qboolean        NET_StringToAdr (char *s, netadr_t *a)
      |                 ^~~~~~~~~~~~~~~
In file included from linux/net_udp6.c:22:
linux/../qcommon/qcommon.h:663:17: note: previous declaration of 'NET_StringToAdr' with type 'qboolean(const char *, netadr_t *)'
  663 | qboolean        NET_StringToAdr (const char *s, netadr_t *a);
      |                 ^~~~~~~~~~~~~~~
linux/net_udp6.c: In function 'NET_SendPacket':
linux/net_udp6.c:565:14: error: 'NA_IP6' undeclared (first use in this function); did you mean 'NA_IPX'?
  565 |         case NA_IP6:
      |              ^~~~~~
      |              NA_IPX
linux/net_udp6.c:566:14: error: 'NA_MULTICAST6' undeclared (first use in this function); did you mean 'IN_MULTICAST'?
  566 |         case NA_MULTICAST6:
      |              ^~~~~~~~~~~~~
      |              IN_MULTICAST
make[1]: *** [makefile:535: build_debug/client/net_udp6.o] Error 1
In file included from ref_gl/gl_local.h:27,
                 from ref_gl/gl_cin.c:30:
ref_gl/glext.h:58: warning: "GL_GLEXT_VERSION" redefined
   58 | #define GL_GLEXT_VERSION 6
      |
In file included from /usr/include/GL/gl.h:2050,
                 from ref_gl/gl_local.h:26:
/usr/include/GL/glext.h:35: note: this is the location of the previous definition
   35 | #define GL_GLEXT_VERSION 20220530
      |
ref_gl/glext.h:3130: warning: "GL_OFFSET_TEXTURE_2D_MATRIX_NV" redefined
 3130 | #define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
      |
/usr/include/GL/glext.h:11263: note: this is the location of the previous definition
11263 | #define GL_OFFSET_TEXTURE_2D_MATRIX_NV    0x86E1
      |
ref_gl/glext.h:3131: warning: "GL_OFFSET_TEXTURE_2D_SCALE_NV" redefined
 3131 | #define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
      |
/usr/include/GL/glext.h:11264: note: this is the location of the previous definition
11264 | #define GL_OFFSET_TEXTURE_2D_SCALE_NV     0x86E2
      |
ref_gl/glext.h:3132: warning: "GL_OFFSET_TEXTURE_2D_BIAS_NV" redefined
 3132 | #define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
      |
/usr/include/GL/glext.h:11265: note: this is the location of the previous definition
11265 | #define GL_OFFSET_TEXTURE_2D_BIAS_NV      0x86E3
      |
ref_gl/gl_image.c: In function 'LoadPNG':
ref_gl/gl_image.c:632:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  632 |         if (info_ptr->height > MAX_TEXTURE_DIMENSIONS)
      |                     ^~
ref_gl/gl_image.c:640:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  640 |         if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
      |                     ^~
ref_gl/gl_image.c:646:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  646 |         if (info_ptr->color_type == PNG_COLOR_TYPE_RGB)
      |                     ^~
ref_gl/gl_image.c:649:22: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  649 |         if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY) && info_ptr->bit_depth < 8)
      |                      ^~
ref_gl/gl_image.c:649:70: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  649 |         if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY) && info_ptr->bit_depth < 8)
      |                                                                      ^~
ref_gl/gl_image.c:650:17: warning: implicit declaration of function 'png_set_gray_1_2_4_to_8'; did you mean 'png_set_expand_gray_1_2_4_to_8'? [-Wimplicit-function-declaration]
  650 |                 png_set_gray_1_2_4_to_8(png_ptr);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                 png_set_expand_gray_1_2_4_to_8
ref_gl/gl_image.c:655:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  655 |         if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
      |                     ^~
ref_gl/gl_image.c:655:68: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  655 |         if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
      |                                                                    ^~
ref_gl/gl_image.c:658:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  658 |         if (info_ptr->bit_depth == 16)
      |                     ^~
ref_gl/gl_image.c:661:21: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  661 |         if (info_ptr->bit_depth < 8)
      |                     ^~
ref_gl/gl_image.c:671:32: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  671 |         *pic = malloc (info_ptr->height * rowbytes);
      |                                ^~
ref_gl/gl_image.c:673:33: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  673 |         for (i = 0; i < info_ptr->height; i++)
      |                                 ^~
ref_gl/gl_image.c:678:26: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  678 |         *width = info_ptr->width;
      |                          ^~
ref_gl/gl_image.c:679:27: error: invalid use of incomplete typedef 'png_info' {aka 'struct png_info_def'}
  679 |         *height = info_ptr->height;
      |                           ^~
ref_gl/gl_image.c: At top level:
ref_gl/gl_image.c:968:6: error: conflicting types for 'jpeg_mem_src'; have 'void(struct jpeg_decompress_struct *, byte *, int)' {aka 'void(struct jpeg_decompress_struct *, unsigned char *, int)'}
  968 | void jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
      |      ^~~~~~~~~~~~
In file included from ref_gl/gl_image.c:27:
/usr/include/jpeglib.h:974:14: note: previous declaration of 'jpeg_mem_src' with type 'void(struct jpeg_decompress_struct *, const unsigned char *, long unsigned int)'
  974 | EXTERN(void) jpeg_mem_src(j_decompress_ptr cinfo,
      |              ^~~~~~~~~~~~
make[1]: *** [makefile:635: build_debug/ref_gl/gl_image.o] Error 1
make[1]: Leaving directory '/home/matthias/Entwicklung/AUR/paintball2/src/paintball2'
make: *** [makefile:334: debug] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

That is too many errors for me to patch. Also, the Makefile says version 27, which is confusing.

xrichardx

  • 68 Carbine
  • Posts: 295
Re: Arch Linux Compilation Problems
« Reply #1 on: October 28, 2023, 03:19:52 PM »
The CVS repository of the game's code is hosted at https://sourceforge.net/p/paintball2/code/HEAD/tree/.

The build errors mostly look like dependency version incompatibilities to me. The makefile BUILD variable is unused, the makefile itself is not maintained actively.

Note that you can not compile your own version of the client and use it on public servers for anti-cheat reasons. The public code parts only cover the "engine" part. The actual game logic is closed source, you only get 32-bit compiled binaries of that (published with the official releases). I think uploading a build-from-source script to the arch user repos wouldn't make much sense with that in mind.

your teammate

  • PGP
  • Posts: 7
Re: Arch Linux Compilation Problems
« Reply #2 on: December 20, 2023, 06:45:35 AM »
Oh, someone else mad enough to compile it on Linux :D

I guess you want to make an AUR package for the game? As mentioned by richard it's probably not worth it because even if you manage to compile it you will still need to copy some files over from the binary release to make it work, and the game will still complain that it's not an official build. But as far as I'm aware joining public servers is actually possible. So if an AUR package is your goal, your best bet would be making a bin package that just extracts the binary release and has all necessary dependencies.
But even that will be not great, because the Linux client has a lot of issues. Sound will not work, unless you launch it with "+snd_driver sdl" as command line argument and restart the game, because the default sound driver uses OSS which has been removed from Linux for ages. And once you got the sound working, you will notice a load of other issues related to mouse and keyboard input. Mouse is jittery, the game steals *all* keyboard input (if you're using X11), enabling fullscreen messes up multimonitor setups, and so on.

If all you want to do is play the game, install lutris and use its install script for the game (https://lutris.net/games/digital-paintball-2/) to install the Windows version with Wine. It works much much better, and I try to keep the install scripts updated.

Anyway, if you really want to compile the linux build, your best bet is breaking into jitspoes house and stealing his old Laptop which has Ubuntu 10 or something with all obscure dependencies installed.
Your second best bet is using this docker image that I made a while ago specifically to compile the game: https://hub.docker.com/r/nukla/dp2compile. It can pull the latest code from the SVN repository that was already mentioned here. And it is based on 32 bit Ubuntu 16.04 and has all dependencies necessary to compile the game preinstalled. More specifically, it has these packages installed on top of Ubuntu 16.04 (you can also find it in the Dockerfile):
Code: [Select]
subversion
build-essential
libsdl1.2-dev
libjpeg62-dev
libasound2-dev
ca-certificates

This list might be useful for your third best bet: compiling it manually. I only ever managed to do it on old 32 bit Ubuntu versions, but maybe I should give it another try on Arch someday.

Keep in mind that the Linux build can break at any time when new code is pushed, it is very fragile and mostly only tested on Windows.