Gentoo Archives: gentoo-commits

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