cavepacker, new recipe (#5214)

Co-authored with @Ra-V2
This commit is contained in:
Schrijvers Luc
2020-07-22 09:01:44 +02:00
committed by GitHub
parent d5f678d1fa
commit faf76530f4
2 changed files with 161 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
SUMMARY="Classic 2D platformer with physics-based gameplay and dozens of levels"
DESCRIPTION="Master your pedal-powered flying machine to pick up packages \
from your cave-dwelling clients and drop them off at the collection point. \
But beware! Mighty mastodons, terrifying pterodactyls and others \
would rather see you extinct."
HOMEPAGE="http://www.caveproductions.org/"
COPYRIGHT="2014-2020 Martin Gerhardy"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/mgerhardy/caveexpress/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="54b8fb68efc837a78a73b2d285412bc75a28d692918aea4312305fff964f9a26"
SOURCE_DIR="caveexpress-$portVersion"
PATCHES="cavepacker-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
cavepacker$secondaryArchSuffix = $portVersion
app:CavePacker = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libatomic$secondaryArchSuffix
lib:libBox2D$secondaryArchSuffix
# lib:libgtest$secondaryArchSuffix
lib:liblua$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libSDL2_image_2.0$secondaryArchSuffix
lib:libSDL2_mixer_2.0$secondaryArchSuffix
lib:libSDL2_net_2.0$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libyajl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libBox2D$secondaryArchSuffix
devel:glm
# devel:libgtest$secondaryArchSuffix
devel:liblua$secondaryArchSuffix >= 5.2
devel:libncurses$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libSDL2_image_2.0$secondaryArchSuffix
devel:libSDL2_mixer_2.0$secondaryArchSuffix
devel:libSDL2_net_2.0$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libyajl$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:ccache
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p build && cd build
export CFLAGS="`pkg-config --cflags lua`"
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCAVEEXPRESS=OFF \
-DCMAKE_INSTALL_PREFIX=$appsDir
make $jobArgs
}
INSTALL()
{
cd build
make install
mv $appsDir/cavepacker/cavepacker $appsDir/cavepacker/CavePacker
addAppDeskbarSymlink $appsDir/cavepacker/CavePacker
}

View File

@@ -0,0 +1,84 @@
From 5031f52ea1e90744e69cabfeeef8d6d8b198cf2c Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:14:39 +0000
Subject: Fix reference to luac5.2
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f214082..68f6f29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
endforeach()
-set(DEFAULT_LUAC_EXECUTABLE luac)
+set(DEFAULT_LUAC_EXECUTABLE luac5.2)
set(CP_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CP_CMAKE_DIR})
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE})
--
2.27.0
From cef62bc3e9571d33979c929aa64058692be6be68 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:17:19 +0000
Subject: Don't use fullscreen on launch, set to 800*600
diff --git a/base/cavepacker/config.lua b/base/cavepacker/config.lua
index e5e482d..d65d6aa 100644
--- a/base/cavepacker/config.lua
+++ b/base/cavepacker/config.lua
@@ -2,9 +2,9 @@ function isMobile()
return (isAndroid() or isIOS()) and not isOUYA();
end
-defaultwidth = -1
-defaultheight = -1
-defaultfullscreen = true
+defaultwidth = 800
+defaultheight = 600
+defaultfullscreen = false
defaultpersister = "sqlite"
defaultfrontend = "sdl"
defaultsoundengine = "sdl"
--
2.27.0
From 07c5499fabb47265468426790cc68c2bf47c2d39 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:18:30 +0000
Subject: Fix launch from Tracker and Deskbar
diff --git a/src/Main.cpp b/src/Main.cpp
index 41cb968..4707873 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -8,8 +8,20 @@
#include <SDL_main.h>
#include "game.h"
+#ifdef __HAIKU__
+#include <libgen.h>
+#include <unistd.h>
+#endif
+
extern "C" int main (int argc, char *argv[])
{
+#ifdef __HAIKU__
+ char* binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ chdir(dirname(binpath));
+ free(binpath);
+ }
+#endif
Application& app = Singleton<Application>::getInstance();
const GamePtr& game = Singleton<GameRegistry>::getInstance().getGame();
app.setOrganisation("caveproductions");
--
2.27.0