Recipe for AssaultCube 1.3.0.2 (#12150)

+ Haiku-specific startup script
This commit is contained in:
Peppersawce
2025-04-22 11:38:53 +00:00
committed by GitHub
parent e5f8e2b926
commit ef51c85463
4 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = @REV@,
short_info = "AssaultCube",
long_info = "@LONG_INFO@"
};
resource app_signature "application/x-vnd.assaultcube";
resource vector_icon {
$"6E6369660603D2363804003F04001104002005FF04004F0F0005CA81BFB6CA81"
$"BFB6CA81C5BBBF9ACA9DC59FCA9DB994CA9DB4B3BFB6B4B3C5BBB4B3B9B0BF9A"
$"B4CEB994B4CEC59FB4CECA81BFB6CA81B9B0CA81BFB6020CBFBFB7CABFBFB7CA"
$"BD79B91AB8EEBBBABB34BA6AB964BBFDB9CEBC84B961BC40B9BABCA3BA17BCFE"
$"BABDBD59B9AFBCE4B8B3BC64B8D1BBFEB8B3BEEDB8B3C400B8B3C177BE0EC98F"
$"BF03CA99BE67C9F8BF35CA9BBF9ACA9DBF67CA9DC58DCA9DCA80BFEDCA63C5D9"
$"C9DBBF3DC695BBBAC8C4BE12C611BB8FC55EBB09C5ECBB56C37EB9F4BFBFB7CA"
$"C19FB8DFBFBFB7CA0005C030B565C030B565C636B565CB17C04CCB17BA46CB17"
$"C651C030CB33C636CB33BA2BCB33B549C04CB549C651B549BA46C030B565BA2B"
$"B565C030B565000540B32840B328B8BCB328B30CBFDBB30CB8D8B30CC6DF40CC"
$"8EB8BCCC8EC6C3CC8ECC73BFDBCC73C6DFCC73B8D840B328C6C3B32840B32800"
$"05C00BB53FC00BB53FC610B53FCAF241CAF2BA21CAF2C62CC00BCB0DC610CB0D"
$"BA05CB0DB52341B523C62CB523BA21C00BB53FBA05B53FC00BB53F000540B354"
$"40B354B8D4B354B338BFDBB338B8F0B338C6C740CC63B8D4CC63C6ABCC63CC47"
$"BFDBCC47C6C7CC47B8F040B354C6ABB35440B3540005BFE5B51ABFE5B51AC5EA"
$"B51ACACCC001CACCB9FBCACCC606BFE55CC5EA5CB9E05C25C00125C60625B9FB"
$"BFE5B51AB9E0B51ABFE5B51A000540B38640B386B8F0B386B36ABFDBB36AB90B"
$"B36AC6AB40CC31B8F0CC31C68FCC31CC15BFDBCC15C6ABCC15B90B40B386C68F"
$"B38640B3860206BF9AB4CFBF9AB4CFC59FB4CFCA81BFB6CA81B9B0CA81C5BBBF"
$"9ACA9DC59FCA9DB994CA9DB4B2BFB6B4B2C5BBB4B2B9B0BF9AB4CFB994B4CFBF"
$"9AB4CFBF9AB4CFBF9AB4CFBF9AB4CF0206BF9AB37FBF9AB37FB8DBB37FB364BF"
$"B6B364B8F7B364C674BF9ACBECB8DBCBECC658CBECCBD0BFB6CBD0C674CBD0B8"
$"F7BF9AB37FC658B37FBF9AB37FBF9AB37FBF9AB37FBF9AB37F0206BF9AB4CFBF"
$"9AB4CFC59FB4CFCA81BFB6CA81B9B0CA81C5BBBF9ACA9DC59FCA9DB994CA9DB4"
$"B2BFB6B4B2C5BBB4B2B9B0BF9AB4CFB994B4CFBF9AB4CFBF9AB4CFBF9AB4CFBF"
$"9AB4CF0206BF9AB37FBF9AB37FB8DBB37FB364BFB6B364B8F7B364C674BF9ACB"
$"ECB8DBCBECC658CBECCBD0BFB6CBD0C674CBD0B8F7BF9AB37FC658B37FBF9AB3"
$"7FBF9AB37FBF9AB37FBF9AB37F0206C6CDBC35C6CDBC35C489BD83C002C020C2"
$"45BED2C002C2BAC002C7ECC002C553C245C69EC6CDC400C489C54FC6CDC167C6"
$"CDBC35C6CDBECEC6CDBC35C6CDBC35C6CDBC35C6CDBC350205B8B2BC30B8B2BC"
$"30B8B2BECBB8B2C400B8B2C166BAF6C54FBF7DC7ECBD3AC69EBF7DC552BF7DC0"
$"1CBF7DC2B7BD3ABECEB8B2BC30BAF6BD7FB8B2BC300205BFBFB7CABFBFB7CABD"
$"79B91AB8EEBBBABB34BA6ABB35BD0ABFC3BFABBD7CBE5BC209BE5CC695BBBCC4"
$"4FBD0CC44EBA6BBFBFB7CAC206B91BBFBFB7CA080A000100000A010101000A02"
$"020203000A03020405000A03020607000A04020809000A05020A0B1001178000"
$"040A04030C0D0E00"
};

View File

@@ -0,0 +1,9 @@
#!/bin/bash
acbin=$(finddir B_SYSTEM_APPS_DIRECTORY)/AssaultCube/ac_client
if [ ! -e $acbin ]; then
acbin=$(finddir B_USER_APPS_DIRECTORY)/AssaultCube/ac_client
fi
$acbin --init --loadmap=ac_ingress $@

View File

@@ -0,0 +1,100 @@
SUMMARY="Free multiplayer first-person shooter based on the CUBE engine"
DESCRIPTION="AssaultCube is a FREE, multiplayer, first-person shooter game, based on the CUBE engine.
Taking place in realistic environments, with fast, arcade gameplay, it's addictive and fun!
With efficient bandwidth usage, it's low-latency and can even run over a 56 Kbps connection.
It's tiny too, weighing in at a lightweight about 50 MB package.
On the correct settings, it can even run on old hardware (Pentium III and above)."
HOMEPAGE="https://assault.cubers.net/"
COPYRIGHT="2022 Rabid Viper Productions"
LICENSE="Zlib"
REVISION="1"
SOURCE_URI="https://github.com/assaultcube/AC/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="05f21db1f20ee5cc8f83c2cd4e8746f16224654343959f29a4902859479e2dec"
SOURCE_DIR="AC-$portVersion"
PATCHES="assaultcube-$portVersion.patchset"
ADDITIONAL_FILES="
assaultcube.rdef.in
assaultcube.sh
"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
assaultcube$secondaryArchSuffix = $portVersion
app:ac_client
app:ac_server
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libopenal$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libSDL2_image_2.0$secondaryArchSuffix
lib:libvorbisfile$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libGL$secondaryArchSuffix
devel:libopenal$secondaryArchSuffix
devel:libSDL2$secondaryArchSuffix
devel:libSDL2_image$secondaryArchSuffix
devel:libvorbisfile$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:autoreconf
cmd:automake
cmd:clang
cmd:gcc$secondaryArchSuffix
cmd:make
"
BUILD()
{
cd source/enet
rm -f config.guess config.sub
aclocal
automake --add-missing
autoreconf
cd ../src
make $jobArgs
}
INSTALL()
{
# Pack binaries, script and game data
mkdir -p $appsDir/AssaultCube
cp -t $appsDir/AssaultCube source/src/ac_client source/src/ac_server
cp -t $appsDir/AssaultCube $portDir/additional-files/assaultcube.sh
chmod +x $appsDir/AssaultCube/assaultcube.sh
cp -rt $appsDir/AssaultCube bot config mods packages
# Pack docs
mkdir -p $docDir && cp -rt $docDir *.md docs/* source/*.txt
# Generate the rdef
local MAJOR="`echo "$portVersion" | cut -b1`"
local MIDDLE="`echo "$portVersion" | cut -b3`"
local MINOR="`echo "$portVersion" | cut -b5`"
local REV="`echo "$portVersion" | cut -b7`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@REV@|$REV|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/assaultcube.rdef.in > assaultcube.rdef
rc assaultcube.rdef
resattr -o $appsDir/AssaultCube/assaultcube.sh assaultcube.rsrc
addResourcesToBinaries assaultcube.rdef $appsDir/AssaultCube/ac_client
addAppDeskbarSymlink $appsDir/AssaultCube/assaultcube.sh "AssaultCube"
}

View File

@@ -0,0 +1,93 @@
From e24ed11581a15ea18d54587b046c9d4ed82cace3 Mon Sep 17 00:00:00 2001
From: Peppersawce <michaelpeppers89@yahoo.it>
Date: Sun, 13 Apr 2025 15:01:30 +0200
Subject: De-linuxify Makefile, remove need for X11 header, disable "No OpenGL"
startup error, setup Haiku config paths
diff --git a/source/src/Makefile b/source/src/Makefile
index bf06195..d894c60 100644
--- a/source/src/Makefile
+++ b/source/src/Makefile
@@ -59,9 +59,10 @@ WINDRES= windres
CLIENT_INCLUDES= $(INCLUDES) -I../include
CLIENT_LIBS= -mwindows -L../lib -lSDL2 -lSDL2_image -lzdll -lopengl32 -lenet -lOpenAL32 -llibvorbisfile -lws2_32 -lwinmm
else
-USRLIB=$(shell if [ -e /usr/lib64 ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi)
-CLIENT_INCLUDES= $(INCLUDES) -I/usr/include `sdl2-config --cflags` -idirafter ../include
-CLIENT_LIBS= -L../enet/.libs -lenet -L$(USRLIB) -lX11 `sdl2-config --libs` -lSDL2_image -lz -lGL -lopenal -lvorbisfile
+USRLIB=$(shell if [ -e /boot/system/lib/x86 ]; then echo "/boot/system/lib/x86"; else echo "/boot/system/lib"; fi)
+INCLUDEDIR=$(shell if [ -e /boot/system/develop/headers/x86 ]; then echo "/boot/system/develop/headers/x86/SDL2"; else echo "/boot/system/develop/headers/SDL2"; fi)
+CLIENT_INCLUDES= $(INCLUDES) -I$(INCLUDEDIR) `sdl2-config --cflags` -idirafter ../include
+CLIENT_LIBS= -L../enet/.libs -lenet -L$(USRLIB) -lbsd -lnetwork `sdl2-config --libs` -lSDL2_image -lz -lGL -lopenal -lvorbisfile
endif
CLIENT_OBJS= \
@@ -126,10 +126,7 @@ SERVER_INCLUDES= -DSTANDALONE $(INCLUDES) -I../include
SERVER_LIBS= -L../lib -lzdll -lenet -lws2_32 -lwinmm
else
SERVER_INCLUDES= -DSTANDALONE $(INCLUDES)
-SERVER_LIBS= -L../enet/.libs -lenet -lz -lpthread
-ifeq (,$(findstring OpenBSD,$(PLATFORM)))
-SERVER_LIBS+= -lrt
-endif
+SERVER_LIBS= -L../enet/.libs -lbsd -lnetwork -lenet -lz -lpthread
endif
SERVER_OBJS= \
diff --git a/source/src/server.cpp b/source/src/server.cpp
index 42e9039..9eb38ca 100644
--- a/source/src/server.cpp
+++ b/source/src/server.cpp
@@ -2356,7 +2356,7 @@ void startdemoplayback(const char *newname)
void startgame(const char *newname, int newmode, int newtime, bool notify)
{
- if(!newname || !*newname || (newmode == GMODE_DEMO && isdedicated)) fatal("startgame() abused");
+ //if(!newname || !*newname || (newmode == GMODE_DEMO && isdedicated)) fatal("startgame() abused");
if(newmode == GMODE_DEMO)
{
startdemoplayback(newname);
diff --git a/source/src/stream.cpp b/source/src/stream.cpp
index 3a549c5..55453dd 100644
--- a/source/src/stream.cpp
+++ b/source/src/stream.cpp
@@ -9,6 +9,11 @@
#include <dirent.h>
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
string homedir = "";
vector<char *> packagedirs;
@@ -176,7 +181,10 @@ char *getregszvalue(HKEY root, const char *keystr, const char *query)
void sethomedir(const char *dir)
{
string tmpdir;
- copystring(tmpdir, dir);
+ //copystring(tmpdir, dir);
+ char buffer[B_PATH_NAME_LENGTH+10];
+ find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, buffer, B_PATH_NAME_LENGTH);
+ formatstring(tmpdir)("%s%s", buffer, "/assaultcube");
#ifdef WIN32
const char substitute[] = "?MYDOCUMENTS?";
diff --git a/source/src/tools.cpp b/source/src/tools.cpp
index 75a5128..fc9813a 100644
--- a/source/src/tools.cpp
+++ b/source/src/tools.cpp
@@ -716,7 +716,6 @@ bool glmatrixf::invert(const glmatrixf &m, float mindet)
#else
#include <pthread.h>
#include <semaphore.h>
- #include <sys/shm.h>
#endif
static int sl_sem_errorcountdummy = 0;
--
2.48.1