From ba2544f2c538f9f0577bb15fa41a0abdbabf76e1 Mon Sep 17 00:00:00 2001 From: extrowerk <5569059+extrowerk@users.noreply.github.com> Date: Wed, 15 Jun 2022 14:14:48 +0200 Subject: [PATCH] S25RTTR: new recipe (#6988) * S25RTTR: new recipe * Constrain boost version --- .../s25rttr/patches/s25rttr-0.9.5.patchset | 66 ++++++++++ games-strategy/s25rttr/s25rttr-0.9.5.recipe | 117 ++++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 games-strategy/s25rttr/patches/s25rttr-0.9.5.patchset create mode 100644 games-strategy/s25rttr/s25rttr-0.9.5.recipe diff --git a/games-strategy/s25rttr/patches/s25rttr-0.9.5.patchset b/games-strategy/s25rttr/patches/s25rttr-0.9.5.patchset new file mode 100644 index 000000000..c40cae19d --- /dev/null +++ b/games-strategy/s25rttr/patches/s25rttr-0.9.5.patchset @@ -0,0 +1,66 @@ +From 0bc2faa19e54d137eec0d5cc926b29288c81c1b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 11 Jun 2022 20:07:08 +0200 +Subject: Haiku support for getExecutablePath + + +diff --git a/external/libutil/libs/common/src/getExecutablePath.cpp b/external/libutil/libs/common/src/getExecutablePath.cpp +index 6cd69b5..6e3d4d1 100644 +--- a/external/libutil/libs/common/src/getExecutablePath.cpp ++++ b/external/libutil/libs/common/src/getExecutablePath.cpp +@@ -121,6 +121,25 @@ std::string getExecutablePath() + return ec ? "" : p.make_preferred().string(); + } + ++#elif(BOOST_OS_HAIKU) ++ ++# include ++ ++std::string getExecutablePath() ++{ ++ std::string ret; ++ int32 cookie = 0; ++ image_info info; ++ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) ++ { ++ if (info.type == B_APP_IMAGE) ++ { ++ ret = info.name; ++ } ++ } ++ return ret; ++} ++ + #else + + # error Unsupported plattform! +-- +2.36.1 + + +From 9ba7557aecb9cba0c944b5eaf8495371d1f6e079 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 11 Jun 2022 20:38:09 +0200 +Subject: Locale fix + + +diff --git a/external/libutil/libs/common/src/LocaleHelper.cpp b/external/libutil/libs/common/src/LocaleHelper.cpp +index 3b6ed4b..a06baf1 100644 +--- a/external/libutil/libs/common/src/LocaleHelper.cpp ++++ b/external/libutil/libs/common/src/LocaleHelper.cpp +@@ -78,6 +78,12 @@ std::locale createUtf8Locale() + // Don't change the locale on OSX. Using "" fails with 'locale::facet::_S_create_c_locale name not valid' + return LocaleHelper::getBfsDefaultLocale(); + } ++#elif BOOST_OS_HAIKU ++std::locale createUtf8Locale() ++{ ++ // Don't change the locale on HAIKU. Using "" fails with 'locale::facet::_S_create_c_locale name not valid' ++ return LocaleHelper::getBfsDefaultLocale(); ++} + #else + std::locale createUtf8Locale() + { +-- +2.36.1 + diff --git a/games-strategy/s25rttr/s25rttr-0.9.5.recipe b/games-strategy/s25rttr/s25rttr-0.9.5.recipe new file mode 100644 index 000000000..892bbe954 --- /dev/null +++ b/games-strategy/s25rttr/s25rttr-0.9.5.recipe @@ -0,0 +1,117 @@ +SUMMARY="Open Source remake of The Settlers II game" +DESCRIPTION="Return To The Roots is a fan-project, which aims to renew the \ +original The Settlers 2. + +To play this game the original game data should be placed in the +/boot/home/config/non-packaged/data/s25rttr/S2 +folder!" +HOMEPAGE="https://www.siedler25.org/" +COPYRIGHT="2005-2022 Settlers Freaks" +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="https://github.com/Return-To-The-Roots/s25client/releases/download/v${portVersion}/s25client_src_v${portVersion}.tar.gz" +CHECKSUM_SHA256="c6a9ef5b90943b5f2e81543f1e3290ff773663a45ebbbcc5a786bb5f5495fbec" +SOURCE_DIR="s25client_v${portVersion}" +PATCHES="s25rttr-$portVersion.patchset" + +ARCHITECTURES="?x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + s25rttr$secondaryArchSuffix = $portVersion + app:s25client = $portVersion + app:s25edit = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libboost_chrono$secondaryArchSuffix + lib:libboost_filesystem$secondaryArchSuffix + lib:libboost_iostreams$secondaryArchSuffix + lib:libboost_locale$secondaryArchSuffix + lib:libboost_program_options$secondaryArchSuffix + lib:libboost_random$secondaryArchSuffix + lib:libboost_regex$secondaryArchSuffix + lib:libboost_system$secondaryArchSuffix + lib:libbz2$secondaryArchSuffix + lib:libcurl$secondaryArchSuffix + lib:libexecinfo$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:liblua$secondaryArchSuffix + lib:libminiupnpc$secondaryArchSuffix + lib:libSDL_1.2$secondaryArchSuffix + lib:libSDL_mixer_1.2$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_mixer_2.0$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libboost_chrono$secondaryArchSuffix >= 1.69.0 + devel:libboost_filesystem$secondaryArchSuffix >= 1.69.0 + devel:libboost_iostreams$secondaryArchSuffix >= 1.69.0 + devel:libboost_locale$secondaryArchSuffix >= 1.69.0 + devel:libboost_program_options$secondaryArchSuffix >= 1.69.0 + devel:libboost_random$secondaryArchSuffix >= 1.69.0 + devel:libboost_regex$secondaryArchSuffix >= 1.69.0 + devel:libboost_system$secondaryArchSuffix >= 1.69.0 + devel:libbz2$secondaryArchSuffix + devel:libcurl$secondaryArchSuffix + devel:libexecinfo$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:liblua$secondaryArchSuffix + devel:libminiupnpc$secondaryArchSuffix + devel:libSDL_1.2$secondaryArchSuffix + devel:libSDL_mixer_1.2$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_mixer$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:awk + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:git + cmd:gettext + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +defineDebugInfoPackage s25rttr$secondaryArchSuffix \ + "$appsDir"/RTTR/s25client \ + "$appsDir"/RTTR/s25edit + +BUILD() +{ + mkdir -p haiku_build && cd haiku_build + + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF \ + -DCMAKE_INSTALL_PREFIX="$appsDir/RTTR" \ + -DCMAKE_INSTALL_BINDIR="$appsDir/RTTR" \ + -DCMAKE_INSTALL_DOCDIR="$docDir" \ + -DRTTR_DOCDIR="$docDir" \ + -DCMAKE_INSTALL_DATADIR="$dataDir" \ + -DRTTR_DATADIR="s25rttr" \ + -DRTTR_GAMEDIR="`finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/s25rttr/S2" \ + -DCMAKE_EXE_LINKER_FLAGS="-lnetwork -lexecinfo" + + make $jobArgs +} + +INSTALL() +{ + cd haiku_build + make install + + addAppDeskbarSymlink "$appsDir"/RTTR/s25client + addAppDeskbarSymlink "$appsDir"/RTTR/s25edit +} + +TEST() +{ + cd haiku_build + make test +}