Skip to content

Commit

Permalink
sys-apps/pick: fix building against ncurses with split out libtinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Sep 14, 2017
1 parent d8df264 commit bae9e3b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
24 changes: 24 additions & 0 deletions sys-apps/pick/files/pick-1.8.0-tinfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Use pkg-config to determine ncurses libs and cflags to use. Fixes when building
against ncurses with libtinfo split out.

--- pick-1.8.0/configure.ac
+++ pick-1.8.0/configure.ac
@@ -5,13 +5,10 @@
AC_PROG_CC
AM_PROG_CC_C_O
AC_CHECK_FUNCS([pledge reallocarray strtonum])
-AC_SEARCH_LIBS([setupterm], [curses], [],
- [
- AC_SEARCH_LIBS([setupterm], [ncursesw],
- [AC_DEFINE([HAVE_NCURSESW_H], [1], [Define if ncursesw is available])],
- [AC_MSG_ERROR([unable to find setupterm function])]
- )
- ]
-)
+PKG_CHECK_MODULES([NCURSES], [ncursesw],
+ [AC_DEFINE([HAVE_NCURSESW_H], [1], [Define if ncursesw is available])],
+ [PKG_CHECK_MODULES([NCURSES], [ncurses])])
+CFLAGS="$CFLAGS $NCURSES_CFLAGS"
+LIBS="$LIBS $NCURSES_LIBS"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
10 changes: 7 additions & 3 deletions sys-apps/pick/pick-1.8.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="sys-libs/ncurses:0="
RDEPEND="${DEPEND}"
RDEPEND="sys-libs/ncurses:0="
DEPEND="${RDEPEND}
virtual/pkgconfig"

PATCHES=( "${FILESDIR}"/${P}-cflags.patch )
PATCHES=(
"${FILESDIR}"/${P}-cflags.patch
"${FILESDIR}"/${P}-tinfo.patch
)

src_prepare() {
default
Expand Down

0 comments on commit bae9e3b

Please sign in to comment.