From 804c829cf3eea96d65e85f6ea2aee8b191b78d5e Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 1 May 2020 17:42:26 +0000
Subject: [PATCH] Use pkg-config for ncursesw if possible. Note, Debian still
 hates you.

---
 src/conio/Common.gmake | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/conio/Common.gmake b/src/conio/Common.gmake
index b05581987e..5734ff717d 100644
--- a/src/conio/Common.gmake
+++ b/src/conio/Common.gmake
@@ -25,13 +25,18 @@ ifeq ($(os),win32)
 endif
 
 ifneq ($(os),win32)
- ifdef USE_SYSTEM_CURSES
-  CIOLIB-MT_LIBS		+=	$(UL_PRE)curses$(UL_SUF)
+ ifeq ($(shell pkg-config ncursesw --exists && echo YES), YES)
+  CIOLIB-MT_LIBS += `pkg-config ncursesw --libs`
+  CIOLIB-MT_CFLAGS += `pkg-config ncursesw --cflags`
  else
-  ifeq ($(os),darwin)
-   CIOLIB-MT_LIBS		+=	$(UL_PRE)ncurses$(UL_SUF) $(UL_PRE)tinfow$(UL_SUF)
+  ifdef USE_SYSTEM_CURSES
+   CIOLIB-MT_LIBS		+=	$(UL_PRE)curses$(UL_SUF)
   else
-   CIOLIB-MT_LIBS		+=	$(UL_PRE)ncursesw$(UL_SUF) $(UL_PRE)tinfow$(UL_SUF)
+   ifeq ($(os),darwin)
+    CIOLIB-MT_LIBS		+=	$(UL_PRE)ncurses$(UL_SUF)
+   else
+    CIOLIB-MT_LIBS		+=	$(UL_PRE)ncursesw$(UL_SUF)
+   endif
   endif
  endif
  ifndef NO_X
-- 
GitLab