From 81ad450962f6876e43436384a6e43c64833660fe Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 14 Apr 2026 01:34:24 +0700 Subject: [PATCH] Fix dcss build --- recipes/wip/games/rpg/dcss/recipe.toml | 31 ++++++++++++++++++++------ recipes/wip/games/rpg/dcss/redox.patch | 15 +++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 recipes/wip/games/rpg/dcss/redox.patch diff --git a/recipes/wip/games/rpg/dcss/recipe.toml b/recipes/wip/games/rpg/dcss/recipe.toml index b47e9814c..46b2efc79 100644 --- a/recipes/wip/games/rpg/dcss/recipe.toml +++ b/recipes/wip/games/rpg/dcss/recipe.toml @@ -1,12 +1,15 @@ -# TODO make this the no tiles variant, may want separate dcss-tiles recipe for tiles -# TODO compilation instructions: https://github.com/crawl/crawl/blob/master/crawl-ref/INSTALL.md#compiling -# TODO see https://gitlab.redox-os.org/redox-os/redox/-/issues/1800 +#TODO: null pointer crash [source] tar = "https://github.com/crawl/crawl/releases/download/0.34.1/stone_soup-0.34.1-nodeps.tar.xz" +patches = [ + "redox.patch" +] + [build] template = "custom" dependencies = [ "lua54", + "luajit", "ncursesw", "pcre", "sqlite3", @@ -18,8 +21,22 @@ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ cd source -"${COOKBOOK_MAKE}" -j"$($NPROC)" - -mkdir -pv "${COOKBOOK_STAGE}/usr/games" -cp -v "${COOKBOOK_BUILD}/crawl" "${COOKBOOK_STAGE}/usr/games" +MAKEFLAGS=( + USE_PCRE=y + USE_LUAJIT=y + EXTERNAL_FLAGS="${CPPFLAGS}" + EXTERNAL_LDFLAGS="${LDFLAGS}" + EXTRA_LIBS="-llua" + NO_TRY_LLD=y + NO_TRY_GOLD=y + V=1 + CC="${CC}" + CXX="${CXX}" + PKGCONFIG="${PKG_CONFIG}" + STRIP="$STRIP" +) +mkdir -pv "${COOKBOOK_STAGE}/usr/games/crawl" +"${COOKBOOK_MAKE}" install install-xdg-data -j"$COOKBOOK_MAKE_JOBS" "${MAKEFLAGS[@]}" DESTDIR="$COOKBOOK_STAGE/usr/games/crawl" +mv "${COOKBOOK_STAGE}/usr/games/crawl/share" "${COOKBOOK_STAGE}/usr/share" +sed -i "s|Exec=|Exec=/usr/games/crawl|g" "${COOKBOOK_STAGE}/usr/share/applications/org.develz.Crawl_console.desktop" """ diff --git a/recipes/wip/games/rpg/dcss/redox.patch b/recipes/wip/games/rpg/dcss/redox.patch new file mode 100644 index 000000000..48a6588d8 --- /dev/null +++ b/recipes/wip/games/rpg/dcss/redox.patch @@ -0,0 +1,15 @@ +diff -ruwN source/source/crash.cc source-new/source/crash.cc +--- source/source/crash.cc 2026-03-15 10:41:36.000000000 +0700 ++++ source-new/source/crash.cc 2026-04-14 00:52:32.396751278 +0700 +@@ -11,9 +11,11 @@ + #include + #include + #ifndef __HAIKU__ ++#ifndef __redox__ + #define BACKTRACE_SUPPORTED + #endif + #endif ++#endif + + #ifdef USE_UNIX_SIGNALS + #include