Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/tig/files/, dev-vcs/tig/
Date: Sat, 26 Nov 2016 12:55:07
Message-Id: 1480164899.6e17e19c703e2e3e99c0f4c776252197ae3a5e7a.jlec@gentoo
1 commit: 6e17e19c703e2e3e99c0f4c776252197ae3a5e7a
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 26 12:24:16 2016 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 26 12:54:59 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e17e19c
7
8 dev-vcs/tig: Add patch for ncurses[tinfo] support
9
10 Package-Manager: portage-2.3.2
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 dev-vcs/tig/files/tig-2.2.1-tinfo.patch | 303 ++++++++++++++++++++++++++++++++
14 dev-vcs/tig/tig-2.2.1.ebuild | 6 +-
15 2 files changed, 307 insertions(+), 2 deletions(-)
16
17 diff --git a/dev-vcs/tig/files/tig-2.2.1-tinfo.patch b/dev-vcs/tig/files/tig-2.2.1-tinfo.patch
18 new file mode 100644
19 index 00000000..1cb30e7
20 --- /dev/null
21 +++ b/dev-vcs/tig/files/tig-2.2.1-tinfo.patch
22 @@ -0,0 +1,303 @@
23 +commit 585e5d60fb85eff2e7709d63d80c320049393694
24 +Author: Justin Lecher <jlec@g.o>
25 +Date: Sat Nov 26 12:55:42 2016 +0100
26 +
27 + Update ax_with_curses.m4 to support pkg-config
28 +
29 + Latest version of ax_with_curses.m4 supports pkg-config. This is important
30 + as libcurses is split into libcurses.so and libtinfo.so on many distros
31 + and linking against libcurses.so is not sufficiant. Pkg-config allows
32 + proper detection of necessary libs.
33 +
34 + Signed-off-by: Justin Lecher <jlec@g.o>
35 +
36 +diff --git a/config.make.in b/config.make.in
37 +index bf41d85..a7c9ce3 100644
38 +--- a/config.make.in
39 ++++ b/config.make.in
40 +@@ -12,7 +12,7 @@ CC = @CC@
41 + CFLAGS = @CFLAGS@ @COVERAGE_CFLAGS@
42 + CPPFLAGS = @CPPFLAGS@ -DHAVE_CONFIG_H
43 + LDFLAGS = @LDFLAGS@
44 +-LDLIBS = @LIBS@ @CURSES_LIB@
45 ++LDLIBS = @LIBS@ @CURSES_LIBS@
46 +
47 + ASCIIDOC = @ASCIIDOC@
48 + XMLTO = @XMLTO@
49 +diff --git a/configure.ac b/configure.ac
50 +index 0bcfb3f..d58e2f2 100644
51 +--- a/configure.ac
52 ++++ b/configure.ac
53 +@@ -21,15 +21,23 @@ AC_CHECK_FUNCS([mkstemps], [AC_SUBST([NO_MKSTEMPS], ["#"])])
54 + AC_CHECK_FUNCS([setenv], [AC_SUBST([NO_SETENV], ["#"])])
55 + AC_CHECK_FUNCS([strndup], [AC_SUBST([NO_STRNDUP], ["#"])])
56 +
57 +-AX_WITH_CURSES
58 +-case "$ax_cv_ncurses" in "no")
59 +- AC_MSG_ERROR([ncurses not found])
60 +-esac
61 +-case "$ax_cv_ncursesw" in "no")
62 +- AC_MSG_WARN([The found ncurses library does not support wide-char.])
63 +- AC_MSG_WARN([This means that tig will not correctly render UTF-8.])
64 +-esac
65 +-AC_SUBST(CURSES_LIB)
66 ++PKG_CHECK_MODULES([CURSES], [ncursesw],
67 ++ [AC_SUBST(CURSES_LIBS)], [
68 ++ PKG_CHECK_MODULES([CURSES], [ncurses],
69 ++ [AC_SUBST(CURSES_LIBS)
70 ++ AC_MSG_WARN([The found ncurses library does not support wide-char.])
71 ++ AC_MSG_WARN([This means that tig will not correctly render UTF-8.])],[
72 ++ AX_WITH_CURSES
73 ++ case "$ax_cv_ncurses" in "no")
74 ++ AC_MSG_ERROR([ncurses not found])
75 ++ esac
76 ++ case "$ax_cv_ncursesw" in "no")
77 ++ AC_MSG_WARN([The found ncurses library does not support wide-char.])
78 ++ AC_MSG_WARN([This means that tig will not correctly render UTF-8.])
79 ++ esac
80 ++ AC_SUBST(CURSES_LIBS)
81 ++ ])
82 ++ ])
83 +
84 + AX_LIB_READLINE(6.2)
85 +
86 +diff --git a/tools/ax_with_curses.m4 b/tools/ax_with_curses.m4
87 +index 33a37ac..9461eef 100644
88 +--- a/tools/ax_with_curses.m4
89 ++++ b/tools/ax_with_curses.m4
90 +@@ -12,7 +12,9 @@
91 + # present, along with the associated header file. The NcursesW
92 + # (wide-character) library is searched for first, followed by Ncurses,
93 + # then the system-default plain Curses. The first library found is the
94 +-# one returned.
95 ++# one returned. Finding libraries will first be attempted by using
96 ++# pkg-config, and should the pkg-config files not be available, will
97 ++# fallback to combinations of known flags itself.
98 + #
99 + # The following options are understood: --with-ncursesw, --with-ncurses,
100 + # --without-ncursesw, --without-ncurses. The "--with" options force the
101 +@@ -52,23 +54,29 @@
102 + #
103 + # (These preprocessor symbols are discussed later in this document.)
104 + #
105 +-# The following output variable is defined by this macro; it is precious
106 +-# and may be overridden on the ./configure command line:
107 ++# The following output variables are defined by this macro; they are
108 ++# precious and may be overridden on the ./configure command line:
109 + #
110 +-# CURSES_LIB - library to add to xxx_LDADD
111 ++# CURSES_LIBS - library to add to xxx_LDADD
112 ++# CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS
113 + #
114 +-# The library listed in CURSES_LIB is NOT added to LIBS by default. You
115 +-# need to add CURSES_LIB to the appropriate xxx_LDADD line in your
116 +-# Makefile.am. For example:
117 ++# In previous versions of this macro, the flags CURSES_LIB and
118 ++# CURSES_CPPFLAGS were defined. These have been renamed, in keeping with
119 ++# AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should
120 ++# eventually supersede the use of AX_WITH_CURSES. Neither the library
121 ++# listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS,
122 ++# respectively CPPFLAGS, by default. You need to add both to the
123 ++# appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For
124 ++# example:
125 + #
126 +-# prog_LDADD = @CURSES_LIB@
127 ++# prog_LDADD = @CURSES_LIBS@
128 ++# prog_CPPFLAGS = @CURSES_CFLAGS@
129 + #
130 +-# If CURSES_LIB is set on the configure command line (such as by running
131 +-# "./configure CURSES_LIB=-lmycurses"), then the only header searched for
132 +-# is <curses.h>. The user may use the CPPFLAGS precious variable to
133 +-# override the standard #include search path. If the user needs to
134 +-# specify an alternative path for a library (such as for a non-standard
135 +-# NcurseW), the user should use the LDFLAGS variable.
136 ++# If CURSES_LIBS is set on the configure command line (such as by running
137 ++# "./configure CURSES_LIBS=-lmycurses"), then the only header searched for
138 ++# is <curses.h>. If the user needs to specify an alternative path for a
139 ++# library (such as for a non-standard NcurseW), the user should use the
140 ++# LDFLAGS variable.
141 + #
142 + # The following shell variables may be defined by this macro:
143 + #
144 +@@ -88,7 +96,7 @@
145 + #
146 + # AX_WITH_CURSES
147 + # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
148 +-# AX_MSG_ERROR([requires either NcursesW or Ncurses library])
149 ++# AC_MSG_ERROR([requires either NcursesW or Ncurses library])
150 + # fi
151 + #
152 + # If any Curses library will do (but one must be present and must support
153 +@@ -182,11 +190,66 @@
154 + # modified version of the Autoconf Macro, you may extend this special
155 + # exception to the GPL to apply to your modified version as well.
156 +
157 +-#serial 13
158 ++#serial 17
159 ++
160 ++# internal function to factorize common code that is used by both ncurses
161 ++# and ncursesw
162 ++AC_DEFUN([_FIND_CURSES_FLAGS], [
163 ++ AC_MSG_CHECKING([for $1 via pkg-config])
164 ++
165 ++ AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS])
166 ++ _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1])
167 ++ _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1])
168 ++
169 ++ AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[
170 ++ AC_MSG_RESULT([no])
171 ++ # No suitable .pc file found, have to find flags via fallback
172 ++ AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [
173 ++ AS_ECHO()
174 ++ pkg_cv__ax_cv_$1_libs="-l$1"
175 ++ pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS"
176 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
177 ++ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
178 ++
179 ++ AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs])
180 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
181 ++ [
182 ++ AC_MSG_RESULT([yes])
183 ++ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
184 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
185 ++ ax_cv_$1=yes
186 ++ ],[
187 ++ AC_MSG_RESULT([no])
188 ++ m4_if(
189 ++ [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"],
190 ++ [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"]
191 ++ )
192 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
193 ++
194 ++ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
195 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
196 ++ ax_cv_$1=yes
197 ++ ],[
198 ++ ax_cv_$1=no
199 ++ ])
200 ++ ])
201 ++ ],[
202 ++ ax_cv_$1=no
203 ++ ])
204 ++ ])
205 ++ ],[
206 ++ AC_MSG_RESULT([yes])
207 ++ # Found .pc file, using its information
208 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
209 ++ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
210 ++ ax_cv_$1=yes
211 ++ ])
212 ++])
213 +
214 + AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
215 + AC_DEFUN([AX_WITH_CURSES], [
216 +- AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses])
217 ++ AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses])
218 ++ AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw])
219 + AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
220 + [force the use of Ncurses or NcursesW])],
221 + [], [with_ncurses=check])
222 +@@ -195,20 +258,17 @@ AC_DEFUN([AX_WITH_CURSES], [
223 + [], [with_ncursesw=check])
224 +
225 + ax_saved_LIBS=$LIBS
226 ++ ax_saved_CPPFLAGS=$CPPFLAGS
227 ++
228 + AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
229 + [ax_with_plaincurses=no], [ax_with_plaincurses=check])
230 +
231 + ax_cv_curses_which=no
232 +
233 + # Test for NcursesW
234 ++ AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [
235 ++ _FIND_CURSES_FLAGS([ncursesw])
236 +
237 +- AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [
238 +- LIBS="$ax_saved_LIBS -lncursesw"
239 +-
240 +- AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [
241 +- AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
242 +- [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no])
243 +- ])
244 + AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
245 + AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
246 + ])
247 +@@ -216,7 +276,8 @@ AC_DEFUN([AX_WITH_CURSES], [
248 + AS_IF([test "x$ax_cv_ncursesw" = xyes], [
249 + ax_cv_curses=yes
250 + ax_cv_curses_which=ncursesw
251 +- CURSES_LIB="-lncursesw"
252 ++ CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs"
253 ++ CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags"
254 + AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
255 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
256 +
257 +@@ -318,16 +379,13 @@ AC_DEFUN([AX_WITH_CURSES], [
258 + ])
259 + ])
260 + ])
261 ++ unset pkg_cv__ax_cv_ncursesw_libs
262 ++ unset pkg_cv__ax_cv_ncursesw_cppflags
263 +
264 + # Test for Ncurses
265 ++ AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
266 ++ _FIND_CURSES_FLAGS([ncurses])
267 +
268 +- AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
269 +- LIBS="$ax_saved_LIBS -lncurses"
270 +-
271 +- AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [
272 +- AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
273 +- [ax_cv_ncurses=yes], [ax_cv_ncurses=no])
274 +- ])
275 + AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
276 + AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
277 + ])
278 +@@ -335,7 +393,8 @@ AC_DEFUN([AX_WITH_CURSES], [
279 + AS_IF([test "x$ax_cv_ncurses" = xyes], [
280 + ax_cv_curses=yes
281 + ax_cv_curses_which=ncurses
282 +- CURSES_LIB="-lncurses"
283 ++ CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs"
284 ++ CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags"
285 + AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
286 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
287 +
288 +@@ -390,12 +449,13 @@ AC_DEFUN([AX_WITH_CURSES], [
289 + ])
290 + ])
291 + ])
292 ++ unset pkg_cv__ax_cv_ncurses_libs
293 ++ unset pkg_cv__ax_cv_ncurses_cppflags
294 +
295 +- # Test for plain Curses (or if CURSES_LIB was set by user)
296 +-
297 ++ # Test for plain Curses (or if CURSES_LIBS was set by user)
298 + AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
299 +- AS_IF([test "x$CURSES_LIB" != x], [
300 +- LIBS="$ax_saved_LIBS $CURSES_LIB"
301 ++ AS_IF([test "x$CURSES_LIBS" != x], [
302 ++ LIBS="$ax_saved_LIBS $CURSES_LIBS"
303 + ], [
304 + LIBS="$ax_saved_LIBS -lcurses"
305 + ])
306 +@@ -408,8 +468,8 @@ AC_DEFUN([AX_WITH_CURSES], [
307 + AS_IF([test "x$ax_cv_plaincurses" = xyes], [
308 + ax_cv_curses=yes
309 + ax_cv_curses_which=plaincurses
310 +- AS_IF([test "x$CURSES_LIB" = x], [
311 +- CURSES_LIB="-lcurses"
312 ++ AS_IF([test "x$CURSES_LIBS" = x], [
313 ++ CURSES_LIBS="-lcurses"
314 + ])
315 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
316 +
317 +@@ -515,4 +575,8 @@ AC_DEFUN([AX_WITH_CURSES], [
318 + AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
319 +
320 + LIBS=$ax_saved_LIBS
321 ++ CPPFLAGS=$ax_saved_CPPFLAGS
322 ++
323 ++ unset ax_saved_LIBS
324 ++ unset ax_saved_CPPFLAGS
325 + ])dnl
326
327 diff --git a/dev-vcs/tig/tig-2.2.1.ebuild b/dev-vcs/tig/tig-2.2.1.ebuild
328 index 0e75b06..e672042 100644
329 --- a/dev-vcs/tig/tig-2.2.1.ebuild
330 +++ b/dev-vcs/tig/tig-2.2.1.ebuild
331 @@ -4,7 +4,7 @@
332
333 EAPI=6
334
335 -inherit bash-completion-r1
336 +inherit autotools bash-completion-r1
337
338 if [[ ${PV} == "9999" ]] ; then
339 EGIT_REPO_URI="https://github.com/jonas/tig.git"
340 @@ -28,9 +28,11 @@ RDEPEND="${DEPEND}
341 dev-vcs/git"
342 [[ ${PV} == "9999" ]] && DEPEND+=" app-text/asciidoc"
343
344 +PATCHES=( "${FILESDIR}"/${P}-tinfo.patch )
345 +
346 src_prepare() {
347 default
348 - [[ ${PV} == "9999" ]] && eautoreconf
349 + eautoreconf
350 }
351
352 src_configure() {