From 23ee82b6b41e598aa8563debeccfaed465d85bd5 Mon Sep 17 00:00:00 2001 From: Peppersawce <157759066+Peppersawce@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:45:25 +0200 Subject: [PATCH] Update DevilutionX to 1.5.3 (#11161) --- ...-1.2.0.recipe => devilutionx-1.5.3.recipe} | 50 ++++++++++++------- .../patches/devilutionx-1.5.3.patchset | 38 ++++++++++++++ 2 files changed, 71 insertions(+), 17 deletions(-) rename games-rpg/devilutionx/{devilutionx-1.2.0.recipe => devilutionx-1.5.3.recipe} (65%) create mode 100644 games-rpg/devilutionx/patches/devilutionx-1.5.3.patchset diff --git a/games-rpg/devilutionx/devilutionx-1.2.0.recipe b/games-rpg/devilutionx/devilutionx-1.5.3.recipe similarity index 65% rename from games-rpg/devilutionx/devilutionx-1.2.0.recipe rename to games-rpg/devilutionx/devilutionx-1.5.3.recipe index ee36ea8a8..0b8ff38fa 100644 --- a/games-rpg/devilutionx/devilutionx-1.2.0.recipe +++ b/games-rpg/devilutionx/devilutionx-1.5.3.recipe @@ -1,16 +1,17 @@ SUMMARY="An open-source reconstruction of Diablo" -DESCRIPTION="DevilutionX is a new effort of an open-source re-implementation \ -of Blizzard's Diablo game from 1996. +DESCRIPTION="DevilutionX is an open-source re-implementation of Blizzard's \ +Diablo game from 1996. To play, you'll need the file 'diabdat.mpq' from the original Diablo CD. Visit the homepage for more info, a FAQ, controller mappings, etc." HOMEPAGE="https://github.com/diasurgical/devilutionX" -COPYRIGHT="2018 GalaXyHaXz" +COPYRIGHT="2024 DevilutionX" LICENSE="Public Domain" -REVISION="2" +REVISION="1" SOURCE_URI="https://github.com/diasurgical/devilutionX/archive/$portVersion.zip" -CHECKSUM_SHA256="b235724e4c7128661898bf571e290e42a4f4afd5102d70a05cdbf08632e13a35" +CHECKSUM_SHA256="33d4cc3c0c10ff71937c8507cb21267fc2c8f0634893d01a71773467078ca5d6" SOURCE_DIR="devilutionX-$portVersion" +PATCHES="devilutionx-$portVersion.patchset" ADDITIONAL_FILES="devilutionx.sh" ARCHITECTURES="all !x86_gcc2" @@ -22,19 +23,27 @@ USER_SETTINGS_FILES=" PROVIDES=" devilutionx$secondaryArchSuffix = $portVersion - app:devilutionx$secondaryArchSuffix = $portVersion + app:devilutionx = $portVersion " REQUIRES=" haiku$secondaryArchSuffix + lib:libbz2$secondaryArchSuffix + lib:libfmt$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:libsodium$secondaryArchSuffix + lib:libz$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libsdl2_2.0$secondaryArchSuffix + devel:libfmt$secondaryArchSuffix + devel:libgettextlib$secondaryArchSuffix + devel:libgtest$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:libsodium$secondaryArchSuffix @@ -51,15 +60,18 @@ defineDebugInfoPackage devilutionx$secondaryArchSuffix \ BUILD() { + export CXXFLAGS="-D_DEFAULT_SOURCE -Wall -w" + export LDFLAGS="-lbsd -lnetwork" + mkdir -p build && cd build - cmake .. \ - -DASAN=OFF \ - -DUBSAN=OFF \ - -DDEBUG=OFF \ - -DDIST=OFF \ - -DDISABLE_LTO=ON \ + + cmake .. $cmakeDirArgs \ -DCMAKE_BUILD_TYPE=Release \ - -DVERSION_NUM=$portVersion + -DDISABLE_ZERO_TIER=ON \ + -DDISABLE_LTO=ON \ + -DBUILD_TESTING=OFF \ + -DPIE=OFF + make $jobArgs } @@ -67,9 +79,14 @@ INSTALL() { cd build + # Setup pre-installed assets dir + mkdir -p $dataDir/devilutionx + cp -r assets/* $dataDir/devilutionx + + # Generate the rdef local MAJOR="`echo "$portVersion" | cut -d. -f1`" local MIDDLE="`echo "$portVersion" | cut -d. -f2`" - local MINOR="0" + local MINOR="`echo "$portVersion" | cut -d. -f3`" sed \ -e "s|@MAJOR@|$MAJOR|" \ -e "s|@MIDDLE@|$MIDDLE|" \ @@ -82,8 +99,7 @@ INSTALL() cp devilutionx $appsDir/DevilutionX # Installing start-script - cp $portDir/additional-files/devilutionx.sh \ - $appsDir/DevilutionX + cp $portDir/additional-files/devilutionx.sh $appsDir/DevilutionX chmod +x $appsDir/DevilutionX/devilutionx.sh # Installing extra-attribs diff --git a/games-rpg/devilutionx/patches/devilutionx-1.5.3.patchset b/games-rpg/devilutionx/patches/devilutionx-1.5.3.patchset new file mode 100644 index 000000000..0c8c28f14 --- /dev/null +++ b/games-rpg/devilutionx/patches/devilutionx-1.5.3.patchset @@ -0,0 +1,38 @@ +From ed8b4cbd54401c07eec9cd040db9bec18b742110 Mon Sep 17 00:00:00 2001 +From: Peppersawce +Date: Sun, 6 Oct 2024 23:00:09 +0200 +Subject: Define Haiku assets path + + +diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp +index e803436..79c1619 100644 +--- a/Source/utils/paths.cpp ++++ b/Source/utils/paths.cpp +@@ -7,6 +7,11 @@ + #include "utils/log.hpp" + #include "utils/sdl_ptrs.h" + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #ifdef __IPHONEOS__ + #include "platform/ios/ios_paths.h" + #endif +@@ -113,6 +118,12 @@ const std::string &ConfigPath() + + const std::string &AssetsPath() + { ++#if defined(__HAIKU__) ++ char buffer[B_PATH_NAME_LENGTH+10]; ++ find_directory(B_SYSTEM_DATA_DIRECTORY, dev_for_path("/boot"), false, buffer, B_PATH_NAME_LENGTH); ++ strcat(buffer, "/devilutionx/"); ++ assetsPath.emplace(strdup(buffer)); ++#endif + if (!assetsPath) { + #if __EMSCRIPTEN__ + assetsPath.emplace("assets/"); +-- +2.45.2 +