From 86f2212ce8866d2894a6bb0231101bc8275edba7 Mon Sep 17 00:00:00 2001 From: Crestwave <35413013+Crestwave@users.noreply.github.com> Date: Sun, 8 Aug 2021 13:40:50 +0800 Subject: [PATCH] crawl: fix docs (#6118) Co-authored-by: Crestwave --- games-roguelike/crawl/crawl-0.27.0.recipe | 14 ++++-- .../crawl/patches/crawl-0.27.0.patchset | 48 ++++++++++++++----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/games-roguelike/crawl/crawl-0.27.0.recipe b/games-roguelike/crawl/crawl-0.27.0.recipe index 5bb5b4d86..6c76c763b 100644 --- a/games-roguelike/crawl/crawl-0.27.0.recipe +++ b/games-roguelike/crawl/crawl-0.27.0.recipe @@ -6,7 +6,7 @@ strategy, and prevail against overwhelming odds." HOMEPAGE="https://crawl.develz.org" COPYRIGHT="1997-2021 Lindley Henzell, the dev team, and the contributors" LICENSE="crawl" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/crawl/crawl/releases/download/$portVersion/stone_soup-$portVersion-nodeps.tar.xz" CHECKSUM_SHA256="d8a6f7419e324a225d95474e7e878d58370a0727f3d436e50fb5375ff1fdf343" SOURCE_FILENAME="crawl-$portVersion.tar.xz" @@ -81,9 +81,13 @@ defineDebugInfoPackage crawl$secondaryArchSuffix \ BUILD() { cd ./source - make $jobArgs TILES=y + if [ -n "$secondaryArchSuffix" ]; then + set HAIKU_HYBRID_SECONDARY="$effectiveTargetArchitecture" + fi + + make $jobArgs TILES=y "$@" mv crawl crawl-tiles - make $jobArgs + make $jobArgs "$@" } INSTALL() @@ -94,8 +98,8 @@ INSTALL() "$docDir" "$manDir"/man6 cp -r dat "$dataDir"/crawl/ - cp -r ../docs/* ../settings "$docDir" - mv "$docDir"/crawl.6 "$manDir"/man6 + cp -r ../docs ../settings "$docDir" + mv "$docDir"/docs/crawl.6 "$manDir"/man6 install -m 555 crawl-tiles "$appsDir"/DungeonCrawlStoneSoup install -m 555 crawl "$commandBinDir" diff --git a/games-roguelike/crawl/patches/crawl-0.27.0.patchset b/games-roguelike/crawl/patches/crawl-0.27.0.patchset index 6cd688213..02c5f7699 100644 --- a/games-roguelike/crawl/patches/crawl-0.27.0.patchset +++ b/games-roguelike/crawl/patches/crawl-0.27.0.patchset @@ -1,18 +1,18 @@ -From 433bd4073dc58492d8005a046079a5c8766f31d3 Mon Sep 17 00:00:00 2001 +From dd85f3dde34513315bdcdfb0c6635f90097c6058 Mon Sep 17 00:00:00 2001 From: Crestwave -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 --- - source/Makefile | 2 ++ + source/Makefile | 6 ++++++ source/crash.cc | 2 ++ source/endianness.h | 4 ++++ - source/files.cc | 17 ++++++++++++++++- + source/files.cc | 30 +++++++++++++++++++++++++++++- 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 -index eb65f6d..1918e6e 100644 +index eb65f6d..29e9342 100644 --- a/source/Makefile +++ b/source/Makefile @@ -382,9 +382,11 @@ ifdef WIN32 @@ -27,6 +27,17 @@ index eb65f6d..1918e6e 100644 ifndef TILES 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 index 7b4f65d..76a5fc6 100644 --- a/source/crash.cc @@ -58,7 +69,7 @@ index 30b8644..881a78c 100644 #if BYTE_ORDER == LITTLE_ENDIAN #define htole32(x) (x) diff --git a/source/files.cc b/source/files.cc -index 9f7a2e6..da1377d 100644 +index 9f7a2e6..14b33bc 100644 --- a/source/files.cc +++ b/source/files.cc @@ -105,6 +105,10 @@ @@ -81,28 +92,41 @@ index 9f7a2e6..da1377d 100644 return dir_exists(dir); 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 _get_base_dirs() { +#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, + B_FIND_PATH_DATA_DIRECTORY, + "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); +#endif const string rawbases[] = { #ifdef DATA_DIR_PATH -@@ -431,6 +443,9 @@ static vector _get_base_dirs() +@@ -431,6 +451,14 @@ static vector _get_base_dirs() #ifdef __ANDROID__ ANDROID_ASSETS, "/sdcard/Android/data/org.develz.crawl/files/", +#endif +#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 };