1 |
commit: db10e3436ac9082a9e29d09cdf408651a17544bb |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 14 07:35:53 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 14 07:35:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db10e343 |
7 |
|
8 |
sys-libs/readline: Introduced "unicode" USE flag |
9 |
|
10 |
in order to avoid linking against libtinfo _and_ libtinfow in some |
11 |
applications. |
12 |
|
13 |
Thanks-to: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
Closes: https://bugs.gentoo.org/669214 |
15 |
Package-Manager: Portage-2.3.76, Repoman-2.3.17 |
16 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
17 |
|
18 |
sys-libs/readline/readline-8.0_p1-r1.ebuild | 175 ++++++++++++++++++++++++++++ |
19 |
1 file changed, 175 insertions(+) |
20 |
|
21 |
diff --git a/sys-libs/readline/readline-8.0_p1-r1.ebuild b/sys-libs/readline/readline-8.0_p1-r1.ebuild |
22 |
new file mode 100644 |
23 |
index 00000000000..6b36ff730e5 |
24 |
--- /dev/null |
25 |
+++ b/sys-libs/readline/readline-8.0_p1-r1.ebuild |
26 |
@@ -0,0 +1,175 @@ |
27 |
+# Copyright 1999-2019 Gentoo Authors |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+ |
30 |
+EAPI=7 |
31 |
+ |
32 |
+inherit flag-o-matic multilib-minimal preserve-libs toolchain-funcs usr-ldscript |
33 |
+ |
34 |
+# Official patches |
35 |
+# See ftp://ftp.cwru.edu/pub/bash/readline-7.0-patches/ |
36 |
+PLEVEL="${PV##*_p}" |
37 |
+MY_PV="${PV/_p*}" |
38 |
+MY_PV="${MY_PV/_/-}" |
39 |
+MY_P="${PN}-${MY_PV}" |
40 |
+[[ ${PV} != *_p* ]] && PLEVEL=0 |
41 |
+patches() { |
42 |
+ [[ ${PLEVEL} -eq 0 ]] && return 1 |
43 |
+ local opt=$1 |
44 |
+ eval set -- {1..${PLEVEL}} |
45 |
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@") |
46 |
+ if [[ ${opt} == -s ]] ; then |
47 |
+ echo "${@/#/${DISTDIR}/}" |
48 |
+ else |
49 |
+ local u |
50 |
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do |
51 |
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@" |
52 |
+ done |
53 |
+ fi |
54 |
+} |
55 |
+ |
56 |
+DESCRIPTION="Another cute console display library" |
57 |
+HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html" |
58 |
+ |
59 |
+case ${PV} in |
60 |
+ *_alpha*|*_beta*|*_rc*) |
61 |
+ SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
62 |
+ ;; |
63 |
+ *) |
64 |
+ SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)" |
65 |
+ ;; |
66 |
+esac |
67 |
+ |
68 |
+LICENSE="GPL-3" |
69 |
+SLOT="0/8" # subslot matches SONAME major |
70 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" |
71 |
+IUSE="static-libs +unicode utils" |
72 |
+ |
73 |
+RDEPEND=">=sys-libs/ncurses-5.9-r3:0=[static-libs?,unicode?,${MULTILIB_USEDEP}]" |
74 |
+DEPEND="${RDEPEND}" |
75 |
+BDEPEND=" |
76 |
+ virtual/pkgconfig |
77 |
+" |
78 |
+ |
79 |
+S="${WORKDIR}/${MY_P}" |
80 |
+ |
81 |
+PATCHES=( |
82 |
+ "${FILESDIR}"/${PN}-5.0-no_rpath.patch |
83 |
+ "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091 |
84 |
+ "${FILESDIR}"/${PN}-7.0-headers.patch |
85 |
+ "${FILESDIR}"/${PN}-8.0-headers.patch |
86 |
+) |
87 |
+ |
88 |
+# Needed because we don't want the patches being unpacked |
89 |
+# (which emits annoying and useless error messages) |
90 |
+src_unpack() { |
91 |
+ unpack ${MY_P}.tar.gz |
92 |
+} |
93 |
+ |
94 |
+src_prepare() { |
95 |
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
96 |
+ default |
97 |
+ |
98 |
+ # Force ncurses linking. #71420 |
99 |
+ # Use pkg-config to get the right values. #457558 |
100 |
+ local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses$(usex unicode w '') --libs) |
101 |
+ sed -i \ |
102 |
+ -e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \ |
103 |
+ support/shobj-conf || die |
104 |
+ sed -i \ |
105 |
+ -e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \ |
106 |
+ examples/rlfe/configure || die |
107 |
+ |
108 |
+ # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated |
109 |
+ # objformat for years, so we don't want to rely on that. |
110 |
+ sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die |
111 |
+ |
112 |
+ ln -s ../.. examples/rlfe/readline || die # for local readline headers |
113 |
+} |
114 |
+ |
115 |
+src_configure() { |
116 |
+ # fix implicit decls with widechar funcs |
117 |
+ append-cppflags -D_GNU_SOURCE |
118 |
+ # https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html |
119 |
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free |
120 |
+ |
121 |
+ # Make sure configure picks a better ar than `ar`. #484866 |
122 |
+ export ac_cv_prog_AR=$(tc-getAR) |
123 |
+ |
124 |
+ # Force the test since we used sed above to force it. |
125 |
+ export bash_cv_termcap_lib=ncurses |
126 |
+ |
127 |
+ # Control cross-compiling cases when we know the right answer. |
128 |
+ # In cases where the C library doesn't support wide characters, readline |
129 |
+ # itself won't work correctly, so forcing the answer below should be OK. |
130 |
+ if tc-is-cross-compiler ; then |
131 |
+ use kernel_Winnt || export bash_cv_func_sigsetjmp='present' |
132 |
+ export bash_cv_func_ctype_nonascii='yes' |
133 |
+ export bash_cv_wcwidth_broken='no' #503312 |
134 |
+ fi |
135 |
+ |
136 |
+ # This is for rlfe, but we need to make sure LDFLAGS doesn't change |
137 |
+ # so we can re-use the config cache file between the two. |
138 |
+ append-ldflags -L. |
139 |
+ |
140 |
+ multilib-minimal_src_configure |
141 |
+} |
142 |
+ |
143 |
+multilib_src_configure() { |
144 |
+ local myeconfargs=( |
145 |
+ --cache-file="${BUILD_DIR}"/config.cache |
146 |
+ --with-curses |
147 |
+ $(use_enable static-libs static) |
148 |
+ ) |
149 |
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" |
150 |
+ |
151 |
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then |
152 |
+ # code is full of AC_TRY_RUN() |
153 |
+ mkdir -p examples/rlfe || die |
154 |
+ cd examples/rlfe || die |
155 |
+ ECONF_SOURCE="${S}"/examples/rlfe \ |
156 |
+ econf --cache-file="${BUILD_DIR}"/config.cache |
157 |
+ fi |
158 |
+} |
159 |
+ |
160 |
+multilib_src_compile() { |
161 |
+ emake |
162 |
+ |
163 |
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then |
164 |
+ # code is full of AC_TRY_RUN() |
165 |
+ cd examples/rlfe || die |
166 |
+ local l |
167 |
+ for l in readline history ; do |
168 |
+ ln -s ../../shlib/lib${l}$(get_libname)* lib${l}$(get_libname) || die |
169 |
+ ln -s ../../lib${l}.a lib${l}.a || die |
170 |
+ done |
171 |
+ emake |
172 |
+ fi |
173 |
+} |
174 |
+ |
175 |
+multilib_src_install() { |
176 |
+ default |
177 |
+ |
178 |
+ if multilib_is_native_abi ; then |
179 |
+ gen_usr_ldscript -a readline history #4411 |
180 |
+ |
181 |
+ if use utils && ! tc-is-cross-compiler; then |
182 |
+ dobin examples/rlfe/rlfe |
183 |
+ fi |
184 |
+ fi |
185 |
+} |
186 |
+ |
187 |
+multilib_src_install_all() { |
188 |
+ HTML_DOCS="doc/history.html doc/readline.html doc/rluserman.html" einstalldocs |
189 |
+ dodoc USAGE |
190 |
+ docinto ps |
191 |
+ dodoc doc/*.ps |
192 |
+} |
193 |
+pkg_preinst() { |
194 |
+ # bug #29865 |
195 |
+ # Reappeared in #595324 with paludis so keeping this for now... |
196 |
+ preserve_old_lib /$(get_libdir)/lib{history,readline}.so.{4,5,6,7} |
197 |
+} |
198 |
+ |
199 |
+pkg_postinst() { |
200 |
+ preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.{4,5,6,7} |
201 |
+} |