plee-the-bear: add WIP recipe for 0.7.1.

it builds, but the binary exits after starting mesa.
note that it uses a version of the bear engine before
it switches to gles2 (which we don't support).
This commit is contained in:
Jerome Duval
2018-09-18 21:25:46 +02:00
parent a55e3e4bf8
commit 7d099b4a01
3 changed files with 345 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
From e03012cec6e22a0375d20f80cb1e07873087847b Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Apr 2014 14:54:36 +0200
Subject: Fix search paths for SDL2 header files.
diff --git a/cmake-helper/FindSDL2.cmake b/cmake-helper/FindSDL2.cmake
index 7665a55..bcd3050 100644
--- a/cmake-helper/FindSDL2.cmake
+++ b/cmake-helper/FindSDL2.cmake
@@ -70,7 +70,7 @@
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
ENV SDL2DIR
- PATH_SUFFIXES include/SDL2 include
+ PATH_SUFFIXES include/SDL2 include SDL2
)
# SDL2-1.1 is the name used by FreeBSD ports...
diff --git a/cmake-helper/FindSDL2_mixer.cmake b/cmake-helper/FindSDL2_mixer.cmake
index 59ed911..d795965 100644
--- a/cmake-helper/FindSDL2_mixer.cmake
+++ b/cmake-helper/FindSDL2_mixer.cmake
@@ -40,7 +40,7 @@ find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
HINTS
ENV SDL2MIXERDIR
ENV SDL2DIR
- PATH_SUFFIXES include/SDL2 include
+ PATH_SUFFIXES include/SDL2 include SDL2
)
if(NOT SDL2_MIXER_LIBRARY AND SDL2MIXER_LIBRARY)
--
2.19.0
From 285b9389a0d384a334962dd103aa3142076b4d2f Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Apr 2014 17:02:35 +0200
Subject: Link libintl on haiku.
diff --git a/bear-engine/running_bear/CMakeLists.txt b/bear-engine/running_bear/CMakeLists.txt
index 8b04d89..4fffd94 100644
--- a/bear-engine/running_bear/CMakeLists.txt
+++ b/bear-engine/running_bear/CMakeLists.txt
@@ -38,7 +38,7 @@ set(
${CLAW_APPLICATION_LIBRARIES}
)
-if(WIN32)
+if(WIN32 OR HAIKU)
set(
RUNNING_BEAR_LINK_LIBRARIES
${RUNNING_BEAR_LINK_LIBRARIES}
--
2.19.0
From 2b770fa4526c725034de15705eb8acc08d8fb85d Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Apr 2014 19:41:58 +0200
Subject: Fix install directories.
diff --git a/cmake-helper/bear-config.cmake b/cmake-helper/bear-config.cmake
index e66d79e..b483445 100644
--- a/cmake-helper/bear-config.cmake
+++ b/cmake-helper/bear-config.cmake
@@ -47,7 +47,7 @@ if( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
"${BEAR_ENGINE_INSTALL_EXECUTABLE_DIR}"
)
else( WIN32 )
- set( BEAR_ENGINE_INSTALL_LIBRARY_DIR lib )
+ set( BEAR_ENGINE_INSTALL_LIBRARY_DIR lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} )
endif( WIN32 )
endif( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
diff --git a/cmake-module/CMakeLists.txt b/cmake-module/CMakeLists.txt
index e182689..24c2113 100644
--- a/cmake-module/CMakeLists.txt
+++ b/cmake-module/CMakeLists.txt
@@ -1,7 +1,7 @@
project(bear:cmake-modules)
if( NOT BEAR_CMAKE_MODULES_INSTALL_PATH )
- set( BEAR_CMAKE_MODULES_INSTALL_PATH "share/cmake/bear-engine" )
+ set( BEAR_CMAKE_MODULES_INSTALL_PATH "data/cmake/bear-engine" )
endif( NOT BEAR_CMAKE_MODULES_INSTALL_PATH )
set( BEAR_CMAKE_MODULES
--
2.19.0
From aef84df916bf008859a2aab4ae4b9820b64abbbf Mon Sep 17 00:00:00 2001
From: Theodore Kokkoris <t.kokkoris@gmail.com>
Date: Wed, 24 Dec 2014 23:53:14 +0200
Subject: Change settings location on Haiku
diff --git a/bear-engine/core/src/engine/code/game_local_client.cpp b/bear-engine/core/src/engine/code/game_local_client.cpp
index c4a1efb..a65ab13 100644
--- a/bear-engine/core/src/engine/code/game_local_client.cpp
+++ b/bear-engine/core/src/engine/code/game_local_client.cpp
@@ -51,6 +51,11 @@
#include <claw/string_algorithm.hpp>
#include <sstream>
+#if defined(__HAIKU__)
+ #include <FindDirectory.h>
+ #include <Path.h>
+#endif
+
/*----------------------------------------------------------------------------*/
/**
* \brief Print the options of the program.
@@ -1113,6 +1118,15 @@ void bear::engine::game_local_client::init_game_filesystem()
m_game_filesystem =
freedesktop_game_filesystem( m_game_description.game_name() );
+#elif defined( __HAIKU__ )
+ BPath path;
+ status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
+ if (status < B_OK)
+ // fall back to default
+ m_game_filesystem = default_game_filesystem( m_game_description.game_name() );
+ else
+ m_game_filesystem = default_game_filesystem( m_game_description.game_name(), path.Path());
+
#else
m_game_filesystem = default_game_filesystem( m_game_description.game_name() );
diff --git a/bear-engine/core/src/engine/system/code/default_game_filesystem.cpp b/bear-engine/core/src/engine/system/code/default_game_filesystem.cpp
index 99ea2f8..0435b5a 100644
--- a/bear-engine/core/src/engine/system/code/default_game_filesystem.cpp
+++ b/bear-engine/core/src/engine/system/code/default_game_filesystem.cpp
@@ -107,7 +107,11 @@ std::string bear::engine::default_game_filesystem::get_game_directory() const
boost::filesystem::path dir( m_root );
std::string result;
- std::string subdir = '.' + get_name_as_filename( m_game_name );
+ #if defined(__HAIKU__)
+ std::string subdir = get_name_as_filename( m_game_name );
+ #else
+ std::string subdir = '.' + get_name_as_filename( m_game_name );
+ #endif
dir /= boost::filesystem::path( subdir );
--
2.19.0

View File

@@ -0,0 +1,68 @@
From fa26352f4b7a8a32351a664f23a251ba08bc9556 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 18 Sep 2018 19:50:23 +0200
Subject: patch from 0.7.0
* Link libintl on haiku.
* Fix install directories.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a66e3c..f45efb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,12 +23,12 @@ include( docbook-to-man )
#-------------------------------------------------------------------------------
# where the game resources are installed
if( NOT PTB_INSTALL_DATA_DIR )
- set( PTB_INSTALL_DATA_DIR share/plee-the-bear )
+ set( PTB_INSTALL_DATA_DIR data/plee-the-bear )
endif( NOT PTB_INSTALL_DATA_DIR )
# where the game executables are installed
if( NOT PTB_INSTALL_EXECUTABLE_DIR )
- set( PTB_INSTALL_EXECUTABLE_DIR bin )
+ set( PTB_INSTALL_EXECUTABLE_DIR bin${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} )
endif( NOT PTB_INSTALL_EXECUTABLE_DIR )
# where the game libraries (the items) are installed
@@ -38,7 +38,7 @@ if( NOT PTB_INSTALL_CUSTOM_LIBRARY_DIR )
"${PTB_INSTALL_EXECUTABLE_DIR}"
)
else( WIN32 )
- set( PTB_INSTALL_CUSTOM_LIBRARY_DIR lib )
+ set( PTB_INSTALL_CUSTOM_LIBRARY_DIR lib${CMAKE_HAIKU_SECONDARY_ARCH_SUBDIR} )
endif( WIN32 )
endif( NOT PTB_INSTALL_CUSTOM_LIBRARY_DIR )
@@ -140,7 +140,7 @@ subdirs(
install(
DIRECTORY "lib/item-description"
- DESTINATION "share/bear-factory/plee-the-bear"
+ DESTINATION "data/bear-factory/plee-the-bear"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ
WORLD_READ
diff --git a/launcher/src/CMakeLists.txt b/launcher/src/CMakeLists.txt
index d4a6ee3..a1e02c5 100644
--- a/launcher/src/CMakeLists.txt
+++ b/launcher/src/CMakeLists.txt
@@ -121,13 +121,13 @@ set(
${CLAW_APPLICATION_LIBRARIES}
)
-if(WIN32)
+if(WIN32 OR HAIKU)
set(
PTB_LAUNCHER_LINK_LIBRARIES
${PTB_LAUNCHER_LINK_LIBRARIES}
${SDL2_LIBRARY}
intl )
-endif(WIN32)
+endif(WIN32 OR HAIKU)
# FIXME: it would be even better to use "sdl-config"
if(APPLE)
--
2.19.0

View File

@@ -0,0 +1,124 @@
SUMMARY="A platform game in which you're a bear whose son has been kidnapped"
DESCRIPTION="Plee the Bear is a platform game in which you play an angry bear \
whose son has been kidnapped by god. Here is a guy hard to brave! Jump in \
this amazing journey to find and rescue your son. Because you want to rescue \
him, don't you? Or to slap him? Maybe both…
With three levels of the storyline and four mini-games, Plee the Bear \
received very positive criticisms. The players loved the fun, the graphics and \
the music; the community around the free software movement appreciated the \
overall process and the quality of the resources, remarkable for a free game; \
and the indie gaming community was pleasantly surprised by the technical \
skills and the details of the game."
HOMEPAGE="http://www.stuff-o-matic.com/plee-the-bear/"
COPYRIGHT="2012 Stuff O Matic"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/j-jorge/plee-the-bear/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="1353f37d392966e58cb976ad031af4e4aecfd032d6994d22fb08af0a219417bc"
SOURCE_FILENAME="plee-the-bear-$portVersion.tar.gz"
SOURCE_DIR="plee-the-bear-$portVersion"
srcGitRev="8b08a7a49fa74d59dbfcbf0f2d77dcfee1642f7c"
SOURCE_URI_2="https://github.com/j-jorge/bear/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256_2="06c430b7a990014de51d22bd44edda8b631074209d646bab9adbb021581907a7"
SOURCE_FILENAME_2="bear-$srcGitRev.tar.gz"
SOURCE_DIR_2="bear-$srcGitRev"
PATCHES="plee_the_bear-$portVersion.patchset"
PATCHES_2="bear-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
plee_the_bear$secondaryArchSuffix = $portVersion
cmd:plee_the_bear$secondaryArchSuffix = $portVersion
lib:libbear_audio$secondaryArchSuffix
lib:libbear_communication$secondaryArchSuffix
lib:libbear_debug$secondaryArchSuffix
lib:libbear_engine$secondaryArchSuffix
lib:libbear_expr$secondaryArchSuffix
lib:libbear_generic_items$secondaryArchSuffix
lib:libbear_gui$secondaryArchSuffix
lib:libbear_input$secondaryArchSuffix
lib:libbear_net$secondaryArchSuffix
lib:libbear_text_interface$secondaryArchSuffix
lib:libbear_time$secondaryArchSuffix
lib:libbear_universe$secondaryArchSuffix
lib:libbear_visual$secondaryArchSuffix
lib:libplee_the_bear$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_regex$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libclaw_application$secondaryArchSuffix
lib:libclaw_dynamic_library$secondaryArchSuffix
lib:libclaw_graphic$secondaryArchSuffix
lib:libclaw_logger$secondaryArchSuffix
lib:libclaw_net$secondaryArchSuffix
lib:libclaw_tween$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libsdl2_2.0$secondaryArchSuffix
lib:libsdl2_mixer_2.0$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_filesystem$secondaryArchSuffix
devel:libboost_regex$secondaryArchSuffix
devel:libboost_system$secondaryArchSuffix
devel:libboost_thread$secondaryArchSuffix
devel:libclaw_application$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libpng$secondaryArchSuffix
devel:libsdl2_2.0$secondaryArchSuffix
devel:libsdl2_mixer_2.0$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
"
BUILD()
{
rm -rf ../bear
cp -R $sourceDir2 ../bear
cat << EOF > ../CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
if( NOT DEFINED BEAR_ROOT_DIRECTORY )
set( BEAR_ROOT_DIRECTORY "\${CMAKE_CURRENT_SOURCE_DIR}/bear" )
endif()
set( CMAKE_MODULE_PATH "\${BEAR_ROOT_DIRECTORY}/cmake-helper" )
include( uninstall )
subdirs( bear plee-the-bear-$portVersion )
EOF
cmake .. -DBEAR_EDITORS_ENABLED=FALSE -DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_CXX_FLAGS="-DNDEBUG"
make $jobArgs
}
INSTALL()
{
make install
rm -r $prefix/share
addAppDeskbarSymlink $binDir/plee-the-bear "Plee the Bear"
}