1 |
commit: fb4d262b7f065a1304b7adac35ae19d4c4f4f888 |
2 |
Author: Tim Harder <radhermit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 12 07:46:59 2017 +0000 |
4 |
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 12 07:50:28 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb4d262b |
7 |
|
8 |
dev-vcs/tig: fix segfault with split tinfo lib (bug #614590) |
9 |
|
10 |
dev-vcs/tig/files/tig-2.2.1-termcap-tinfo.patch | 56 +++++++++++++++++++++++ |
11 |
dev-vcs/tig/tig-2.2.1-r1.ebuild | 61 +++++++++++++++++++++++++ |
12 |
2 files changed, 117 insertions(+) |
13 |
|
14 |
diff --git a/dev-vcs/tig/files/tig-2.2.1-termcap-tinfo.patch b/dev-vcs/tig/files/tig-2.2.1-termcap-tinfo.patch |
15 |
new file mode 100644 |
16 |
index 00000000000..4b3df2ee35b |
17 |
--- /dev/null |
18 |
+++ b/dev-vcs/tig/files/tig-2.2.1-termcap-tinfo.patch |
19 |
@@ -0,0 +1,56 @@ |
20 |
+From c4aded6c8f63471b30fe171072e11407929301ac Mon Sep 17 00:00:00 2001 |
21 |
+From: Tim Harder <radhermit@×××××.com> |
22 |
+Date: Tue, 11 Apr 2017 05:17:52 -0400 |
23 |
+Subject: [PATCH] Check for termcap support in split tinfo libs |
24 |
+ |
25 |
+Previously only the main ncurses libs were checked leading to users with |
26 |
+enabled unicode support (ncursesw) and split tinfo libs running into |
27 |
+segfaults since the checks would fallback to setting TERMCAP_LIB=-lcurses. |
28 |
+ |
29 |
+Fixes #568. |
30 |
+--- |
31 |
+ tools/ax_lib_readline.m4 | 16 +++++++++++----- |
32 |
+ 1 file changed, 11 insertions(+), 5 deletions(-) |
33 |
+ |
34 |
+diff --git a/tools/ax_lib_readline.m4 b/tools/ax_lib_readline.m4 |
35 |
+index 1be9125..24ca194 100644 |
36 |
+--- a/tools/ax_lib_readline.m4 |
37 |
++++ b/tools/ax_lib_readline.m4 |
38 |
+@@ -34,16 +34,19 @@ fi |
39 |
+ AC_CACHE_VAL(bash_cv_termcap_lib, |
40 |
+ [AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc, |
41 |
+ if test "$ax_cv_curses_which" = "ncursesw"; then |
42 |
+- [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw)] |
43 |
++ [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw, |
44 |
++ [AC_CHECK_LIB(tinfow, tgetent, bash_cv_termcap_lib=libtinfow)] |
45 |
++ )] |
46 |
+ elif test "$ax_cv_curses_which" = "ncurses"; then |
47 |
+- [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses)] |
48 |
++ [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, |
49 |
++ [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo)] |
50 |
++ )] |
51 |
+ elif test "$ax_cv_curses_which" = "plaincurses"; then |
52 |
+ [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses)] |
53 |
+ else |
54 |
+ [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, |
55 |
+- [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, |
56 |
+- bash_cv_termcap_lib=gnutermcap |
57 |
+- )])] |
58 |
++ bash_cv_termcap_lib=gnutermcap |
59 |
++ )] |
60 |
+ fi |
61 |
+ )]) |
62 |
+ if test "X$_bash_needmsg" = "Xyes"; then |
63 |
+@@ -57,6 +60,9 @@ TERMCAP_DEP="./lib/termcap/libtermcap.a" |
64 |
+ elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then |
65 |
+ TERMCAP_LIB=-ltermcap |
66 |
+ TERMCAP_DEP= |
67 |
++elif test $bash_cv_termcap_lib = libtinfow; then |
68 |
++TERMCAP_LIB=-ltinfow |
69 |
++TERMCAP_DEP= |
70 |
+ elif test $bash_cv_termcap_lib = libtinfo; then |
71 |
+ TERMCAP_LIB=-ltinfo |
72 |
+ TERMCAP_DEP= |
73 |
+-- |
74 |
+2.12.0 |
75 |
+ |
76 |
|
77 |
diff --git a/dev-vcs/tig/tig-2.2.1-r1.ebuild b/dev-vcs/tig/tig-2.2.1-r1.ebuild |
78 |
new file mode 100644 |
79 |
index 00000000000..0947cba842e |
80 |
--- /dev/null |
81 |
+++ b/dev-vcs/tig/tig-2.2.1-r1.ebuild |
82 |
@@ -0,0 +1,61 @@ |
83 |
+# Copyright 1999-2017 Gentoo Foundation |
84 |
+# Distributed under the terms of the GNU General Public License v2 |
85 |
+ |
86 |
+EAPI=6 |
87 |
+ |
88 |
+inherit autotools bash-completion-r1 |
89 |
+ |
90 |
+if [[ ${PV} == "9999" ]] ; then |
91 |
+ EGIT_REPO_URI="https://github.com/jonas/tig.git" |
92 |
+ inherit git-r3 autotools |
93 |
+else |
94 |
+ SRC_URI="https://github.com/jonas/tig/releases/download/${P}/${P}.tar.gz" |
95 |
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" |
96 |
+fi |
97 |
+ |
98 |
+DESCRIPTION="text mode interface for git" |
99 |
+HOMEPAGE="https://jonas.github.io/tig/" |
100 |
+ |
101 |
+LICENSE="GPL-2" |
102 |
+SLOT="0" |
103 |
+IUSE="unicode" |
104 |
+ |
105 |
+DEPEND=" |
106 |
+ sys-libs/ncurses:0=[unicode?] |
107 |
+ sys-libs/readline:0=" |
108 |
+RDEPEND="${DEPEND} |
109 |
+ dev-vcs/git" |
110 |
+[[ ${PV} == "9999" ]] && DEPEND+=" app-text/asciidoc" |
111 |
+ |
112 |
+PATCHES=( |
113 |
+ "${FILESDIR}"/${PN}-2.2.1-tinfo.patch |
114 |
+ "${FILESDIR}"/${PN}-2.2.1-termcap-tinfo.patch |
115 |
+) |
116 |
+ |
117 |
+src_prepare() { |
118 |
+ default |
119 |
+ eautoreconf |
120 |
+} |
121 |
+ |
122 |
+src_configure() { |
123 |
+ econf $(use_with unicode ncursesw) |
124 |
+} |
125 |
+ |
126 |
+src_compile() { |
127 |
+ emake V=1 |
128 |
+ [[ ${PV} == "9999" ]] && emake V=1 doc-man doc-html |
129 |
+} |
130 |
+ |
131 |
+src_test() { |
132 |
+ # workaround parallel test failures |
133 |
+ emake -j1 test |
134 |
+} |
135 |
+ |
136 |
+src_install() { |
137 |
+ emake DESTDIR="${D}" install install-doc-man |
138 |
+ dodoc doc/manual.html README.html NEWS.html |
139 |
+ newbashcomp contrib/tig-completion.bash ${PN} |
140 |
+ |
141 |
+ docinto examples |
142 |
+ dodoc contrib/*.tigrc |
143 |
+} |