BetterSpades: Add recipe and icon (#6800)

* BetterSpades: Add recipe and icon

* BetterSpades: Formatting fixes

* BetterSpades: Switch to upstream with patchset

* BetterSpades: Sync to upstream with Haiku support

* BetterSpades: Remove obsoleted patchset
This commit is contained in:
Julius Enriquez
2023-08-18 20:08:48 +08:00
committed by GitHub
parent 892f848b76
commit 24fae32cde
4 changed files with 208 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
resource app_flags B_MULTIPLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = 0,
minor = 0,
variety = B_APPV_FINAL,
internal = 0,
short_info = "BetterSpades",
long_info = "@LONG_INFO@"
};
resource app_signature "@APP_SIGNATURE@";
resource vector_icon {
$"6E636966050500020006023D81A7BD6CC23F63133F77BD4475B5C2D31B00F84B"
$"FFFFA005F0020006023C99083AC8E6BC16DD3DE5E74980F040101000FFFFFFFF"
$"D64BFF020006023E01563D1395BF8418404AAC4C051BC7ADDD007604A6FFD13C"
$"FC040174050A084B574A584A58545D5A5C6257585052530A06253125503F5C54"
$"4D542E39260A04302C303E404540320A04302C40324C2A3C250A04403240454C"
$"3C4C2A060A04010002427878000000000000427878CD28F0CCE52D0A00010138"
$"1E1E15FF01178400040A000101381E1E001501178600040A0101020241600000"
$"0000000000416000C90000C480000A02010302416816000000000000416816C9"
$"0F79C4421C0A0301040241425E00000000000041425EC8C84BC34BDA"
};

View File

@@ -0,0 +1,143 @@
SUMMARY="Ace of Spades client for low-end systems"
DESCRIPTION="BetterSpades is an Ace of Spades client targeted at low end \
systems (GL/ES 1.1). Runs on your grandmother's rig!
* Replicates of the great game Ace of Spades (classic voxlap)
* Runs on very old systems back to OpenGL 1.1 (OpenGL ES support too)
* Shares similar if not even better performance to voxlap
* Can run on "embedded" systems like a Steam Link
* Open for future expansion
* Easy to use"
HOMEPAGE="https://github.com/xtreme8000/BetterSpades"
COPYRIGHT="2016-2022 xtreme8000 and contributors"
LICENSE="GNU GPL v3"
REVISION="1"
srcGitRev="fc7ab028345306391081953ec9383580b835f391"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="2a45dc71bf8a0efcc0f0deee7aa34595329a4c977e88fe9a3a094204c23e5e79"
SOURCE_DIR="BetterSpades-$srcGitRev"
SOURCE_URI_2="https://raw.githubusercontent.com/benhoyt/inih/master/ini.c#noarchive"
CHECKSUM_SHA256_2="c984fe9ca91c131f2388571952c25b17b97df0f47904ad142517ce981b672580"
SOURCE_URI_3="https://raw.githubusercontent.com/benhoyt/inih/master/ini.h#noarchive"
CHECKSUM_SHA256_3="b5342061a317f8cedd1103c10e241f74c16b5944d62deb9ab9e3e8a3f1ca4e5d"
SOURCE_URI_4="https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.cpp#noarchive"
CHECKSUM_SHA256_4="72d1b2221c9568082b9d1cd26f0edd89aa0f1ced74f7eb74e0a7886675580041"
SOURCE_URI_5="https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.h#noarchive"
CHECKSUM_SHA256_5="1dc9633d9954444d4d588ba710e0002b9d7d341990122a4b5b3e6de6bb322e66"
SOURCE_URI_6="https://raw.githubusercontent.com/mackron/dr_libs/14707e8ee5aec7620781bcc3b484b8b1607aba50/dr_wav.h#noarchive"
CHECKSUM_SHA256_6="602057bce13d79d22f82f6e215234c66d3cb23b4ea7e28bf2157f2867d2a5519"
SOURCE_URI_7="https://raw.githubusercontent.com/nothings/stb/master/stb_truetype.h#noarchive"
CHECKSUM_SHA256_7="a34d8d536ce7c11b9163ab2d524721c1f4df1452cce6595c4f11d3048384f925"
SOURCE_URI_8="https://raw.githubusercontent.com/kgabis/parson/master/parson.c#noarchive"
CHECKSUM_SHA256_8="690c15276df905618bb958d262044b41d573ae7ed7294640934b6b223583190a"
SOURCE_URI_9="https://raw.githubusercontent.com/kgabis/parson/master/parson.h#noarchive"
CHECKSUM_SHA256_9="4541045531850208b2c8d52807d9aba1d3a78188d690df324c100d570af1d165"
SOURCE_URI_10="https://raw.githubusercontent.com/mattiasgustavsson/libs/main/http.h#noarchive"
CHECKSUM_SHA256_10="a1d26fae0fd5583969519db78f17f7d30c73a422ec0a95e56d05e77f4dfe10a7"
SOURCE_URI_11="https://raw.githubusercontent.com/xtreme8000/log.c/master/src/log.h#noarchive"
CHECKSUM_SHA256_11="ec786dc1dac326ce37180f9eed9467861494ad9c7a96dda2b05e92c8231c5c87"
SOURCE_URI_12="https://raw.githubusercontent.com/xtreme8000/log.c/master/src/log.c#noarchive"
CHECKSUM_SHA256_12="83fec3febc70e3a1faa0ea4e3f8b8598794a3eea8b403fcc02b34ee5298833d5"
SOURCE_URI_13="https://raw.githubusercontent.com/goldsborough/hashtable/master/hashtable.c#noarchive"
CHECKSUM_SHA256_13="38e402ebee3abc8cb49396c01d6994ff046f49023bcdf40518dd9c058eef37f5"
SOURCE_URI_14="https://raw.githubusercontent.com/goldsborough/hashtable/master/hashtable.h#noarchive"
CHECKSUM_SHA256_14="c50d268cf67979cf1144adaaa49b68d46f69508ef48b210bd17bb96fa03511f4"
SOURCE_URI_15="https://raw.githubusercontent.com/ebiggers/libdeflate/master/libdeflate.h#noarchive"
CHECKSUM_SHA256_15="dac716f0a290f28a9f51cc8af84ede17673efa3afd2d380e066e82c71dca14cf"
SOURCE_URI_16="http://aos.party/bsresources.zip#noarchive"
CHECKSUM_SHA256_16="5f8a7dd8eae317227b51a52bd70fb32ed4146505ddb61aa8e4e32695bf2c7f48"
SOURCE_URI_17="https://raw.githubusercontent.com/rxi/microui/master/src/microui.c#noarchive"
CHECKSUM_SHA256_17="eea1c9659a3b53899eba38979509c5dd79c69cd3c0b3661c1f51acdc3e717b21"
SOURCE_URI_18="https://raw.githubusercontent.com/rxi/microui/master/src/microui.h#noarchive"
CHECKSUM_SHA256_18="3260c377a45e5712311f0703715e18154dadae4cb60b2e4314d25b772beb322e"
PATCHES="betterspades-$portVersion.patchset"
ADDITIONAL_FILES="betterspades.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
GLOBAL_WRITABLE_FILES="
settings/BetterSpades/config.ini auto-merge
"
PROVIDES="
betterspades$secondaryArchSuffix = $portVersion
app:BetterSpades = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libenet$secondaryArchSuffix
lib:libdeflate$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libglew$secondaryArchSuffix
lib:libglfw$secondaryArchSuffix
lib:libGLU$secondaryArchSuffix
lib:libopenal$secondaryArchSuffix
lib:libdeflate$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libenet$secondaryArchSuffix
devel:libdeflate$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libglew$secondaryArchSuffix
devel:libglfw$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libopenal$secondaryArchSuffix
devel:libdeflate$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:find
cmd:git
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p src/lodepng
cp -r $sourceDir4/* $sourceDir5/* src/lodepng
mv src/lodepng/lodepng.cpp src/lodepng/lodepng.c
cp -r $sourceDir2/* $sourceDir3/* $sourceDir6/* src
mv src/dr_wav.h src/dr_wav.c
cp -r $sourceDir7/* $sourceDir8/* $sourceDir9/* src
cp -r $sourceDir10/* $sourceDir11/* $sourceDir12/* src
cp -r $sourceDir13/* $sourceDir14/* src
cp -r $sourceDir15/* deps
cp -r $sourceDir17/* $sourceDir18/* src
cp -r $sourceDir16/* .
cd build/
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXE_LINKER_FLAGS=-lnetwork
make $jobArgs
}
INSTALL()
{
mkdir -p $appsDir/BetterSpades
mkdir -p $settingsDir/BetterSpades
cp -r build/BetterSpades/* $appsDir/BetterSpades
mv $appsDir/BetterSpades/config.ini $settingsDir/BetterSpades/config.ini
ln -s $settingsDir/BetterSpades/config.ini $appsDir/BetterSpades/config.ini
find $appsDir/BetterSpades \( -name '.gitignore' \) -delete
local APP_SIGNATURE="application/x-vnd.openspades"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/betterspades.rdef.in > $sourceDir/betterspades.rdef
addResourcesToBinaries $sourceDir/betterspades.rdef $appsDir/BetterSpades/client
addAppDeskbarSymlink $appsDir/BetterSpades/client "BetterSpades"
}

View File

@@ -0,0 +1,37 @@
From eb20b27f6ddbdec29a53dfc161e59eb807283fd2 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Fri, 18 Aug 2023 13:44:43 +0200
Subject: Fix launch from Deskbar/Tracker
diff --git a/src/main.c b/src/main.c
index 7a1f924..2955170 100644
--- a/src/main.c
+++ b/src/main.c
@@ -47,6 +47,11 @@
#include "chunk.h"
#include "main.h"
+#ifdef __HAIKU__
+#include <libgen.h>
+#include <unistd.h>
+#endif
+
int fps = 0;
int ms_seed = 1;
@@ -674,6 +679,11 @@ void on_error(int i, const char* s) {
}
int main(int argc, char** argv) {
+ char *binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ chdir(dirname(binpath));
+ free(binpath);
+ }
settings.opengl14 = 1;
settings.color_correction = 0;
settings.multisamples = 0;
--
2.37.3