lbreakouthd: add initial recipe for 1.1.1 (#7956)

This commit is contained in:
augiedoggie
2023-03-12 15:45:23 -06:00
committed by GitHub
parent 6df074c2c1
commit c9c4322bc6
3 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
resource app_signature "application/x-vnd.lgames.lbreakouthd";
resource app_flags B_SINGLE_LAUNCH | B_ARGV_ONLY;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
/* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */
variety = 5,
internal = 0,
short_info = "LBreakoutHD arcade game",
long_info = "LBreakoutHD is a fun breakout-style arcade game."
};
resource vector_icon {
$"6E63696605020106023D5FC8326AB4B225F53CFFCE4A14594559B7FFA5040400"
$"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00FFCD22FF34EA"
$"BE26FF77F1D806F983E5D882FFFEC2A43EFF020106023B7084B697593638963A"
$"F2BB44015549CCC600AAD2A5F440503F050001010000850502044C24C62E24C2"
$"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937"
$"3C2B3A2948243E2D4A48584E450204B6C93AB86F3AB5223AB3CBC0BFB3CBBEE0"
$"B3CBC29DB6C94BB5224BB86F4B31C0BF31C29D31BEE006033E402E5037423A50"
$"374438493B3F330606BE0F3039243D28352342294822452948445653574D5C5A"
$"504E4555474642090A040104023FFB5DB90A98390A983FFB5D4347234571E30A"
$"03010430222001178500040A020102024000000000000000003FC3C3430000BD"
$"C3C30A0101012022200A02010202404DAB000000000000404DAB4A46D645D13D"
$"0A0001002022200A03010030222001178100040A0301032022200A030103023E"
$"C27B0000000000003EC27B46B88E46B10D"
};

View File

@@ -0,0 +1,86 @@
SUMMARY="A fun breakout-style arcade game"
DESCRIPTION="LBreakoutHD is a scaleable 16:9 remake of LBreakout2. You try to clear levels full of \
different types of bricks and extras by using your paddle to aim balls at the bricks."
HOMEPAGE="http://lgames.sourceforge.net/"
COPYRIGHT="2018-2022 Michael Speck"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://sourceforge.net/projects/lgames/files/lbreakouthd/lbreakouthd-$portVersion.tar.gz"
CHECKSUM_SHA256="9639d9a6e57d1cf3d1e5b81d6f213c814b5be26f89a69c469b7315ebdd6cc3b1"
PATCHES="lbreakouthd-$portVersion.patchset"
ADDITIONAL_FILES="lbreakouthd.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
lbreakouthd$secondaryArchSuffix = $portVersion
app:lbreakouthd
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libSDL2_image_2.0$secondaryArchSuffix
lib:libSDL2_mixer_2.0$secondaryArchSuffix
lib:libSDL2_ttf_2.0$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libSDL2_image_2.0$secondaryArchSuffix
devel:libSDL2_mixer_2.0$secondaryArchSuffix
devel:libSDL2_ttf_2.0$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoheader
cmd:automake
cmd:autoreconf
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:make
"
BUILD()
{
autoreconf -vfi
LDFLAGS="-lintl -lbe" runConfigure ./configure --with-configdir=LBreakoutHD
make $jobArgs
}
INSTALL()
{
make install
mkdir -p $appsDir
mv $binDir/lbreakouthd $appsDir/LBreakoutHD
# add our version and other application resources
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/lbreakouthd.rdef.in > lbreakouthd.rdef
addResourcesToBinaries lbreakouthd.rdef $appsDir/LBreakoutHD
addAppDeskbarSymlink $appsDir/LBreakoutHD LBreakoutHD
rm -rf $binDir
rm -rf $localStateDir
rm -rf $dataDir/{applications,icons}
}

View File

@@ -0,0 +1,86 @@
From 9af1a9ad8d63192dcae843512f5a7c16bd04ee2a Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 12 Mar 2023 14:17:50 -0600
Subject: enable _GNU_SOURCE for vasprintf()
diff --git a/src/tools.cpp b/src/tools.cpp
index 2b7d75c..8704f30 100644
--- a/src/tools.cpp
+++ b/src/tools.cpp
@@ -12,7 +12,7 @@
* *
***************************************************************************/
-#ifdef WIN32
+#if defined(WIN32) || defined(__HAIKU__)
#define _GNU_SOURCE
#endif
--
2.39.2
From 9bd557918c059442a7b06cd9f971569aea6bf23a Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 12 Mar 2023 14:32:17 -0600
Subject: move hiscore file to CONFIGDIR
diff --git a/src/hiscores.cpp b/src/hiscores.cpp
index 3938181..93e13f5 100644
--- a/src/hiscores.cpp
+++ b/src/hiscores.cpp
@@ -100,7 +100,11 @@ Hiscores::Hiscores()
int l, s;
string prefix;
+#ifdef __HAIKU__
+ fname = getHomeDir() + "/" + CONFIGDIR + "/lbreakouthd.hscr";
+#else
fname = string(HISCOREDIR) + "/lbreakouthd.hscr";
+#endif
if (!fileExists(fname)) {
_loginfo("No hiscores file yet.\n");
return; /* no hiscores yet */
--
2.39.2
From 0042bd37f2ee7ad05f106f64c867548306a71702 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 12 Mar 2023 15:21:56 -0600
Subject: use B_USER_SETTINGS_DIRECTORY
diff --git a/src/tools.cpp b/src/tools.cpp
index 8704f30..4c918c4 100644
--- a/src/tools.cpp
+++ b/src/tools.cpp
@@ -16,6 +16,11 @@
#define _GNU_SOURCE
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <Path.h>
+#endif
+
#include <SDL2/SDL.h>
#include <stdio.h>
#include <stdlib.h>
@@ -203,6 +208,11 @@ int readDir(const string &dname, int type, vector<string> &fnames)
}
string getHomeDir() {
+#ifdef __HAIKU__
+ BPath settingsPath;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &settingsPath) == B_OK)
+ return string(settingsPath.Path());
+#endif
return string(getenv("HOME")?getenv("HOME"):".");
}
--
2.39.2