crawl: fix docs (#6118)

Co-authored-by: Crestwave <crestwave@users.noreply.github.com>
This commit is contained in:
Crestwave
2021-08-08 13:40:50 +08:00
committed by GitHub
parent 453ffb4449
commit 86f2212ce8
2 changed files with 45 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ strategy, and prevail against overwhelming odds."
HOMEPAGE="https://crawl.develz.org" HOMEPAGE="https://crawl.develz.org"
COPYRIGHT="1997-2021 Lindley Henzell, the dev team, and the contributors" COPYRIGHT="1997-2021 Lindley Henzell, the dev team, and the contributors"
LICENSE="crawl" LICENSE="crawl"
REVISION="1" REVISION="2"
SOURCE_URI="https://github.com/crawl/crawl/releases/download/$portVersion/stone_soup-$portVersion-nodeps.tar.xz" SOURCE_URI="https://github.com/crawl/crawl/releases/download/$portVersion/stone_soup-$portVersion-nodeps.tar.xz"
CHECKSUM_SHA256="d8a6f7419e324a225d95474e7e878d58370a0727f3d436e50fb5375ff1fdf343" CHECKSUM_SHA256="d8a6f7419e324a225d95474e7e878d58370a0727f3d436e50fb5375ff1fdf343"
SOURCE_FILENAME="crawl-$portVersion.tar.xz" SOURCE_FILENAME="crawl-$portVersion.tar.xz"
@@ -81,9 +81,13 @@ defineDebugInfoPackage crawl$secondaryArchSuffix \
BUILD() BUILD()
{ {
cd ./source cd ./source
make $jobArgs TILES=y if [ -n "$secondaryArchSuffix" ]; then
set HAIKU_HYBRID_SECONDARY="$effectiveTargetArchitecture"
fi
make $jobArgs TILES=y "$@"
mv crawl crawl-tiles mv crawl crawl-tiles
make $jobArgs make $jobArgs "$@"
} }
INSTALL() INSTALL()
@@ -94,8 +98,8 @@ INSTALL()
"$docDir" "$manDir"/man6 "$docDir" "$manDir"/man6
cp -r dat "$dataDir"/crawl/ cp -r dat "$dataDir"/crawl/
cp -r ../docs/* ../settings "$docDir" cp -r ../docs ../settings "$docDir"
mv "$docDir"/crawl.6 "$manDir"/man6 mv "$docDir"/docs/crawl.6 "$manDir"/man6
install -m 555 crawl-tiles "$appsDir"/DungeonCrawlStoneSoup install -m 555 crawl-tiles "$appsDir"/DungeonCrawlStoneSoup
install -m 555 crawl "$commandBinDir" install -m 555 crawl "$commandBinDir"

View File

@@ -1,18 +1,18 @@
From 433bd4073dc58492d8005a046079a5c8766f31d3 Mon Sep 17 00:00:00 2001 From dd85f3dde34513315bdcdfb0c6635f90097c6058 Mon Sep 17 00:00:00 2001
From: Crestwave <crest.wave@yahoo.com> From: Crestwave <crest.wave@yahoo.com>
Date: Fri, 6 Aug 2021 19:47:50 +0800 Date: Sat, 7 Aug 2021 09:22:11 +0800
Subject: [PATCH] fix: add support for Haiku Subject: [PATCH] fix: add support for Haiku
--- ---
source/Makefile | 2 ++ source/Makefile | 6 ++++++
source/crash.cc | 2 ++ source/crash.cc | 2 ++
source/endianness.h | 4 ++++ source/endianness.h | 4 ++++
source/files.cc | 17 ++++++++++++++++- source/files.cc | 30 +++++++++++++++++++++++++++++-
source/initfile.cc | 18 ++++++++++++++++++ source/initfile.cc | 18 ++++++++++++++++++
5 files changed, 42 insertions(+), 1 deletion(-) 5 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/source/Makefile b/source/Makefile diff --git a/source/Makefile b/source/Makefile
index eb65f6d..1918e6e 100644 index eb65f6d..29e9342 100644
--- a/source/Makefile --- a/source/Makefile
+++ b/source/Makefile +++ b/source/Makefile
@@ -382,9 +382,11 @@ ifdef WIN32 @@ -382,9 +382,11 @@ ifdef WIN32
@@ -27,6 +27,17 @@ index eb65f6d..1918e6e 100644
ifndef TILES ifndef TILES
ifdef NEED_LIBW32C ifdef NEED_LIBW32C
@@ -799,6 +801,10 @@ ifneq ($(SRC_BRANCH),$(filter master release stone_soup-%, $(SRC_BRANCH)))
endif
endif
+ifdef HAIKU_HYBRID_SECONDARY
+DEFINES_L += -DHAIKU_HYBRID_SECONDARY="\"$(HAIKU_HYBRID_SECONDARY)\""
+endif
+
#
# Figure out the build settings for this type of build
#
diff --git a/source/crash.cc b/source/crash.cc diff --git a/source/crash.cc b/source/crash.cc
index 7b4f65d..76a5fc6 100644 index 7b4f65d..76a5fc6 100644
--- a/source/crash.cc --- a/source/crash.cc
@@ -58,7 +69,7 @@ index 30b8644..881a78c 100644
#if BYTE_ORDER == LITTLE_ENDIAN #if BYTE_ORDER == LITTLE_ENDIAN
#define htole32(x) (x) #define htole32(x) (x)
diff --git a/source/files.cc b/source/files.cc diff --git a/source/files.cc b/source/files.cc
index 9f7a2e6..da1377d 100644 index 9f7a2e6..14b33bc 100644
--- a/source/files.cc --- a/source/files.cc
+++ b/source/files.cc +++ b/source/files.cc
@@ -105,6 +105,10 @@ @@ -105,6 +105,10 @@
@@ -81,28 +92,41 @@ index 9f7a2e6..da1377d 100644
return dir_exists(dir); return dir_exists(dir);
return false; return false;
} }
@@ -417,6 +421,14 @@ string canonicalise_file_separator(const string &path) @@ -417,6 +421,22 @@ string canonicalise_file_separator(const string &path)
static vector<string> _get_base_dirs() static vector<string> _get_base_dirs()
{ {
+#ifdef __HAIKU__ +#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH]; + char data_path[B_PATH_NAME_LENGTH];
+ char docs_path[B_PATH_NAME_LENGTH];
+
+ find_path(B_APP_IMAGE_SYMBOL, + find_path(B_APP_IMAGE_SYMBOL,
+ B_FIND_PATH_DATA_DIRECTORY, + B_FIND_PATH_DATA_DIRECTORY,
+ "crawl/", + "crawl/",
+ path, + data_path,
+ B_PATH_NAME_LENGTH);
+
+ find_path(B_APP_IMAGE_SYMBOL,
+ B_FIND_PATH_DOCUMENTATION_DIRECTORY,
+ "packages/crawl",
+ docs_path,
+ B_PATH_NAME_LENGTH); + B_PATH_NAME_LENGTH);
+#endif +#endif
const string rawbases[] = const string rawbases[] =
{ {
#ifdef DATA_DIR_PATH #ifdef DATA_DIR_PATH
@@ -431,6 +443,9 @@ static vector<string> _get_base_dirs() @@ -431,6 +451,14 @@ static vector<string> _get_base_dirs()
#ifdef __ANDROID__ #ifdef __ANDROID__
ANDROID_ASSETS, ANDROID_ASSETS,
"/sdcard/Android/data/org.develz.crawl/files/", "/sdcard/Android/data/org.develz.crawl/files/",
+#endif +#endif
+#ifdef __HAIKU__ +#ifdef __HAIKU__
+ std::string(path), + std::string(data_path),
+#ifdef HAIKU_HYBRID_SECONDARY
+ std::string(docs_path) + "_" + HAIKU_HYBRID_SECONDARY + FILE_SEPARATOR,
+#else
+ std::string(docs_path) + FILE_SEPARATOR,
+#endif
#endif #endif
}; };