I built the toolchain as per those instructions inside of a debian bullseye container made with debootstrap. I also had to install the gawk zstd
packages for the toolchain to build and I used “Amlogic-ce” instead of “Amlogic-ng” for the project name since the latter was invalid.
The game shouldn’t require X11 since it can run inside a tty framebuffer, and the build instructions don’t have X11 as a dependency.
Now that I familiarized myself a bit with EmuELEC packaging, I wrote a package.mk script for building the game from source.
packages/sx05re/emuelec-ports/sauerbraten/package.mk
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="sauerbraten"
PKG_VERSION="2020_12_29"
PKG_SHA256="cdba7c4a47cefd30d0afdd6a912199a1384319cf1619923cb7189e72e468be70"
PKG_ARCH="aarch64"
PKG_LICENSE="ZLIB"
PKG_SITE="http://sauerbraten.org"
PKG_URL="https://downloads.sourceforge.net/$PKG_NAME/${PKG_NAME}_${PKG_VERSION}_linux.tar.bz2"
PKG_MAINTAINER="s10mini"
PKG_DEPENDS_TARGET="toolchain SDL2 SDL2_image SDL2_mixer libpng libjpeg-turbo zlib" # libGL (OpenGL) is also needed
PKG_SHORTDESC="3D first-person shooter game - EmuELEC port"
PKG_LONGDESC="Sauerbraten is a networked 3D first-person shooter game. It supports modern graphic effects and conveys a sense of fast-paced oldschool gameplay."
PKG_TOOLCHAIN="make"
# A simple make install builds the game client and server
make_target() {
cd src
make install
}
makeinstall_target() {
# Copy game client and server
cp ../bin_unix/native_client $INSTALL/usr/bin/sauerbraten-client
cp ../bin_unix/native_server $INSTALL/usr/bin/sauerbraten-server
# data, packages folders go in here
#mkdir -p $INSTALL/usr/share/games/sauerbraten
#cp -r ../data $INSTALL/usr/share/games/sauerbraten
#cp -r ../packages $INSTALL/usr/share/games/sauerbraten
# docs folder goes in here
#mkdir -p $INSTALL/usr/share/doc/sauerbraten
#cp -r ../docs $INSTALL/usr/share/games/sauerbraten
}
The make install function needs some work. As for compiling the game itself I get this “CROSS COMPILE Badness” error and don’t know how to proceed:
e[1;33mBUILDe[0m sauerbraten e[1;37m(target)e[0m
e[1;35mTOOLCHAINe[0m make
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -Ishared -Iengine -Ifpsgame -Ienet/include -I/usr/X11R6/include `sdl2-config --cflags` -x c++-header -o shared/cube.h.gch.tmp shared/cube.h
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o engine/worldio-standalone.o engine/worldio.cpp
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o fpsgame/entities-standalone.o fpsgame/entities.cpp
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o fpsgame/server-standalone.o fpsgame/server.cpp
CROSS COMPILE Badness: /usr/include in INCLUDEPATH: /usr/include/SDL2
cc1plus: internal compiler error: in add_path, at incpath.cc:481
0x194fb68 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x19508af internal_error(char const*, ...)
???:0
0x6ea289 fancy_abort(char const*, int, char const*)
???:0
0x8de827 add_path(char*, incpath_kind, int, bool)
???:0
0x92667c c_common_handle_option(unsigned long, char const*, long, int, unsigned int, cl_option_handlers const*)
???:0
0x19418b3 handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, bool, diagnostic_context*)
???:0
0x19419fa read_cmdline_option(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, cl_option_handlers const*, diagnostic_context*)
???:0
0xcfd732 decode_options(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, diagnostic_context*, void (*)())
???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [Makefile:176: shared/cube.h.gch] Error 1
make: *** Waiting for unfinished jobs....
e[1;31mFAILURE: ./scripts/build sauerbraten during make_target (package.mk)e[0m
*********** FAILED COMMAND ***********
make install
**************************************