Update DevilutionX to 1.5.3 (#11161)

This commit is contained in:
Peppersawce
2024-10-06 23:45:25 +02:00
committed by GitHub
parent c3d10adaa9
commit 23ee82b6b4
2 changed files with 71 additions and 17 deletions

View File

@@ -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

View File

@@ -0,0 +1,38 @@
From ed8b4cbd54401c07eec9cd040db9bec18b742110 Mon Sep 17 00:00:00 2001
From: Peppersawce <michaelpeppers89@yahoo.it>
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 <FindDirectory.h>
+#include <fs_info.h>
+#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