Skip to content

Commit

Permalink
games-board/natch: Fixed build with sys-libs/ncurses[tinfo]
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/690078
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <[email protected]>
  • Loading branch information
Lars Wendler committed Jul 17, 2019
1 parent b385144 commit dcbb79e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
39 changes: 39 additions & 0 deletions games-board/natch/files/natch-2.4-tinfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
https://bugs.gentoo.org/690078

--- Natch-2.4/configure.in
+++ Natch-2.4/configure.in
@@ -25,17 +25,19 @@
dnl Checks for programs.
AC_PROG_CC
AC_PATH_PROGS(GENGETOPT, gengetopt)
+PKG_PROG_PKG_CONFIG

dnl for txtc (Text-to-C compiler)
AC_PROG_AWK
LF_PROG_TXTC

dnl Checks for libraries.
-AC_SEARCH_LIBS(
- initscr,
- ncurses curses,
+PKG_CHECK_MODULES(NCURSES, ncurses,[
AC_DEFINE(HAVE_LIBNCURSES,,
- Define if you have curses library for visual mode. ), )
+ Define if you have curses library for visual mode. )
+ ],[
+ AC_MSG_ERROR([Cannot find ncurses lib])
+])

dnl Replace `main' with a function in -lpc:
dnl AC_CHECK_LIB(pc, main)
--- Natch-2.4/src/Makefile.am
+++ Natch-2.4/src/Makefile.am
@@ -29,7 +29,7 @@

Natch_SOURCES = main.c main.h types.h cmdline.c cmdline.h distance.c distance.h dis_type.h pcpj.c pcpj.h distimmo.c distimmo.h pcpj_deb.c pcpj_deb.h pcpjcapt.c pcpjcapt.h trajet.c trajet.h explorat.c explorat.h expltype.h pcpjcoup.c pcpjcoup.h hash.c hash.h pcpjtool.c pcpjtool.h myHashTable.c myHashTable.h langues.c langues.h screen.c screen.h common.h moves_order.c moves_order.h test_moves_order.c test_moves_order.h twin_squares.c twin_squares.h precise_trajectories.c precise_trajectories.h captInitSquare.c captInitSquare.h piece.c piece.h reportbugs.text copyright.text

-Natch_LDADD = @LIBOBJS@
+Natch_LDADD = @LIBOBJS@ $(NCURSES_LIBS)

AM_CFLAGS = -Wall -fshort-enums -DNDEBUG -O3
#AM_CFLAGS = -Wall -fshort-enums
20 changes: 14 additions & 6 deletions games-board/natch/natch-2.4-r1.ebuild
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
inherit eutils
EAPI=7

inherit autotools

MY_P="Natch-${PV}"
DESCRIPTION="A program to solve chess proof games"
Expand All @@ -14,15 +15,22 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

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

S=${WORKDIR}/${MY_P}
S="${WORKDIR}/${MY_P}"

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

src_prepare() {
default
eautoreconf
}

src_install() {
newbin src/Natch natch
dodoc AUTHORS ChangeLog NEWS README THANKS example.txt
Expand Down

0 comments on commit dcbb79e

Please sign in to comment.