Skip to content

Commit

Permalink
games-roguelike/dwarf-fortress: add ncurses-patch
Browse files Browse the repository at this point in the history
libgraphics.so now opens libncursesw.so.6 first before
libncursesw.so.5 and others. DEPEND on ncurses-combat
has been replaced to ncurses.

Bug: https://bugs.gentoo.org/729002
Reviewed-by: James Le Cuirot <chewi@aura-online.co.uk>
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sven Eusewig <sveneusewig@yahoo.de>
  • Loading branch information
sveneusewig committed Dec 31, 2020
1 parent cf30ca8 commit 954787d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
9 changes: 6 additions & 3 deletions games-roguelike/dwarf-fortress/dwarf-fortress-0.47.04.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ RDEPEND="media-libs/glew:0
DEPEND="${RDEPEND}
media-libs/libsndfile
media-libs/openal
sys-libs/ncurses-compat:5[unicode]"
sys-libs/ncurses[unicode]"
BDEPEND="virtual/pkgconfig"

PATCHES=(
"${FILESDIR}/${P}-segfault-fix-729002.patch"
"${FILESDIR}/${P}-ncurses.patch"
)

S=${WORKDIR}/${MY_PN}_linux

gamesdir="/opt/${PN}"
Expand All @@ -44,8 +49,6 @@ src_prepare() {
rm libs/*.so* || die
sed -i -e '1i#include <cmath>' g_src/ttf_manager.cpp || die

eapply "${FILESDIR}/${P}-segfault-fix-729002.patch"

default
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/g_src/renderer_curses.cpp b/g_src/renderer_curses.cpp
index 2d90d9c..a5d6282 100644
--- a/g_src/renderer_curses.cpp
+++ b/g_src/renderer_curses.cpp
@@ -294,6 +294,8 @@ extern "C" {
if (!stub_initialized) {
stub_initialized = true;
// We prefer libncursesw, but we'll accept libncurses if we have to
+ handle = dlopen("libncursesw.so.6", RTLD_LAZY);
+ if (handle) goto opened;
handle = dlopen("libncursesw.so.5", RTLD_LAZY);
if (handle) goto opened;
handle = dlopen("libncursesw.so", RTLD_LAZY);
@@ -302,6 +304,8 @@ extern "C" {
sleep(5);
handle = dlopen("libncurses.dylib", RTLD_LAZY);
if (handle) goto opened;
+ handle = dlopen("libncurses.so.6", RTLD_LAZY);
+ if (handle) goto opened;
handle = dlopen("libncurses.so.5", RTLD_LAZY);
if (handle) goto opened;
handle = dlopen("libncurses.so", RTLD_LAZY);

0 comments on commit 954787d

Please sign in to comment.