3 |
3 |
|
4 |
4 |
EAPI=7
|
5 |
5 |
|
|
6 |
# There's no standard way of versioning the point releases upstream
|
|
7 |
# make anyway, so while this was added for RC versions, it's fine
|
|
8 |
# in general.
|
|
9 |
QA_PKGCONFIG_VERSION=$(ver_cut 1-2)
|
6 |
10 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
|
7 |
11 |
inherit flag-o-matic multilib multilib-minimal preserve-libs toolchain-funcs usr-ldscript verify-sig
|
8 |
12 |
|
... | ... | |
14 |
18 |
MY_P="${PN}-${MY_PV}"
|
15 |
19 |
MY_PATCHES=()
|
16 |
20 |
|
|
21 |
is_release() {
|
|
22 |
case ${PV} in
|
|
23 |
9999|*_alpha*|*_beta*|*_rc*)
|
|
24 |
return 1
|
|
25 |
;;
|
|
26 |
*)
|
|
27 |
return 0
|
|
28 |
;;
|
|
29 |
esac
|
|
30 |
}
|
|
31 |
|
17 |
32 |
[[ ${PV} != *_p* ]] && PLEVEL=0
|
18 |
33 |
|
19 |
34 |
DESCRIPTION="Another cute console display library"
|
20 |
|
HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html"
|
21 |
|
|
22 |
|
case ${PV} in
|
23 |
|
*_alpha*|*_beta*|*_rc*)
|
24 |
|
SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
|
25 |
|
SRC_URI+=" verify-sig? ( ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
|
26 |
|
;;
|
27 |
|
|
28 |
|
*)
|
29 |
|
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
|
30 |
|
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig )"
|
31 |
|
|
32 |
|
if [[ ${PLEVEL} -gt 0 ]] ; then
|
33 |
|
# bash-5.1 -> bash51
|
34 |
|
my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
|
|
35 |
HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html https://git.savannah.gnu.org/cgit/readline.git"
|
35 |
36 |
|
36 |
|
patch_url=
|
37 |
|
my_patch_index=
|
|
37 |
if [[ ${PV} == 9999 ]] ; then
|
|
38 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/readline.git"
|
|
39 |
EGIT_BRANCH=devel
|
|
40 |
inherit git-r3
|
|
41 |
elif is_release ; then
|
|
42 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
|
|
43 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig )"
|
|
44 |
|
|
45 |
if [[ ${PLEVEL} -gt 0 ]] ; then
|
|
46 |
# bash-5.1 -> bash51
|
|
47 |
my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
|
|
48 |
|
|
49 |
patch_url=
|
|
50 |
my_patch_index=
|
|
51 |
|
|
52 |
upstream_url_base="mirror://gnu/bash"
|
|
53 |
mirror_url_base="ftp://ftp.cwru.edu/pub/bash"
|
|
54 |
|
|
55 |
for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
|
|
56 |
printf -v mangled_patch_ver ${my_p}-%03d ${my_patch_index}
|
|
57 |
patch_url="${upstream_url_base}/${MY_P}-patches/${mangled_patch_ver}"
|
|
58 |
|
|
59 |
SRC_URI+=" ${patch_url}"
|
|
60 |
SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
|
|
61 |
|
|
62 |
# Add in the mirror URL too.
|
|
63 |
SRC_URI+=" ${patch_url/${upstream_url_base}/${mirror_url_base}}"
|
|
64 |
SRC_URI+=" verify-sig? ( ${patch_url/${upstream_url_base}/${mirror_url_base}} )"
|
38 |
65 |
|
39 |
|
upstream_url_base="mirror://gnu/bash"
|
40 |
|
mirror_url_base="ftp://ftp.cwru.edu/pub/bash"
|
41 |
|
|
42 |
|
for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
|
43 |
|
printf -v mangled_patch_ver ${my_p}-%03d ${my_patch_index}
|
44 |
|
patch_url="${upstream_url_base}/${MY_P}-patches/${mangled_patch_ver}"
|
45 |
|
|
46 |
|
SRC_URI+=" ${patch_url}"
|
47 |
|
SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
|
48 |
|
|
49 |
|
# Add in the mirror URL too.
|
50 |
|
SRC_URI+=" ${patch_url/${upstream_url_base}/${mirror_url_base}}"
|
51 |
|
SRC_URI+=" verify-sig? ( ${patch_url/${upstream_url_base}/${mirror_url_base}} )"
|
52 |
|
|
53 |
|
MY_PATCHES+=( "${DISTDIR}"/${mangled_patch_ver} )
|
54 |
|
done
|
|
66 |
MY_PATCHES+=( "${DISTDIR}"/${mangled_patch_ver} )
|
|
67 |
done
|
55 |
68 |
|
56 |
|
unset my_p patch_url my_patch_index upstream_url_base mirror_url_base
|
57 |
|
fi
|
58 |
|
;;
|
59 |
|
esac
|
|
69 |
unset my_p patch_url my_patch_index upstream_url_base mirror_url_base
|
|
70 |
fi
|
|
71 |
else
|
|
72 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
|
|
73 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
|
|
74 |
fi
|
|
75 |
|
|
76 |
if ! is_release ; then
|
|
77 |
inherit autotools
|
|
78 |
fi
|
60 |
79 |
|
61 |
80 |
LICENSE="GPL-3+"
|
62 |
81 |
SLOT="0/8" # subslot matches SONAME major
|
63 |
|
[[ ${PV} == *_rc* ]] || \
|
64 |
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
|
82 |
if is_release ; then
|
|
83 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
|
84 |
fi
|
65 |
85 |
IUSE="static-libs +unicode utils"
|
66 |
86 |
|
67 |
87 |
RDEPEND=">=sys-libs/ncurses-5.9-r3:=[static-libs?,unicode(+)?,${MULTILIB_USEDEP}]"
|
... | ... | |
73 |
93 |
|
74 |
94 |
PATCHES=(
|
75 |
95 |
"${FILESDIR}"/${PN}-5.0-no_rpath.patch
|
76 |
|
"${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
|
|
96 |
"${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch # bug #385091
|
77 |
97 |
"${FILESDIR}"/${PN}-7.0-headers.patch
|
78 |
98 |
"${FILESDIR}"/${PN}-8.0-headers.patch
|
79 |
|
"${FILESDIR}"/${PN}-8.0-darwin-shlib-versioning.patch
|
80 |
|
"${FILESDIR}"/${PN}-8.1-windows-signals.patch
|
|
99 |
|
|
100 |
# TODO: rebase
|
|
101 |
#"${FILESDIR}"/${PN}-8.0-darwin-shlib-versioning.patch
|
81 |
102 |
)
|
82 |
103 |
|
83 |
|
# Needed because we don't want the patches being unpacked
|
84 |
|
# (which emits annoying and useless error messages)
|
85 |
104 |
src_unpack() {
|
86 |
|
verify-sig_src_unpack
|
87 |
|
|
88 |
|
unpack ${MY_P}.tar.gz
|
|
105 |
if [[ ${PV} == 9999 ]] ; then
|
|
106 |
git-r3_src_unpack
|
|
107 |
else
|
|
108 |
# Needed because we don't want the patches being unpacked
|
|
109 |
# (which emits annoying and useless error messages)
|
|
110 |
verify-sig_src_unpack
|
|
111 |
unpack ${MY_P}.tar.gz
|
|
112 |
fi
|
89 |
113 |
}
|
90 |
114 |
|
91 |
115 |
src_prepare() {
|
... | ... | |
93 |
117 |
|
94 |
118 |
default
|
95 |
119 |
|
|
120 |
is_release || eautoreconf
|
|
121 |
|
96 |
122 |
if use prefix && [[ ! -x "${BROOT}"/usr/bin/pkg-config ]] ; then
|
97 |
123 |
# If we're bootstrapping, make a guess. We don't have pkg-config
|
98 |
124 |
# around yet. bug #818103.
|
... | ... | |
106 |
132 |
ncurses_libs+=" -ltinfo${ncurses_libs_suffix}"
|
107 |
133 |
fi
|
108 |
134 |
else
|
109 |
|
# Force ncurses linking. #71420
|
110 |
|
# Use pkg-config to get the right values. #457558
|
|
135 |
# Force ncurses linking, bug #71420.
|
|
136 |
# Use pkg-config to get the right values, bug #457558.
|
111 |
137 |
local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses$(usex unicode w '') --libs)
|
112 |
138 |
fi
|
113 |
139 |
|
... | ... | |
118 |
144 |
-e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
|
119 |
145 |
examples/rlfe/configure || die
|
120 |
146 |
|
121 |
|
# fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
|
|
147 |
# Fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
|
122 |
148 |
# objformat for years, so we don't want to rely on that.
|
123 |
149 |
sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die
|
124 |
150 |
|
125 |
|
ln -s ../.. examples/rlfe/readline || die # for local readline headers
|
|
151 |
# For local readline headers
|
|
152 |
ln -s ../.. examples/rlfe/readline || die
|
126 |
153 |
}
|
127 |
154 |
|
128 |
155 |
src_configure() {
|
129 |
|
# fix implicit decls with widechar funcs
|
|
156 |
# Fix implicit decls with widechar funcs
|
130 |
157 |
append-cppflags -D_GNU_SOURCE
|
131 |
158 |
# https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
|
132 |
159 |
append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
|
133 |
160 |
|
134 |
|
# Make sure configure picks a better ar than `ar`. #484866
|
135 |
|
export ac_cv_prog_AR=$(tc-getAR)
|
|
161 |
# Make sure configure picks a better ar than `ar`, bug #484866
|
|
162 |
export ac_cv_prog_AR="$(tc-getAR)"
|
136 |
163 |
|
137 |
164 |
# Force the test since we used sed above to force it.
|
138 |
165 |
export bash_cv_termcap_lib=ncurses
|
... | ... | |
141 |
168 |
# In cases where the C library doesn't support wide characters, readline
|
142 |
169 |
# itself won't work correctly, so forcing the answer below should be OK.
|
143 |
170 |
if tc-is-cross-compiler ; then
|
144 |
|
export bash_cv_func_sigsetjmp='present'
|
145 |
|
export bash_cv_func_ctype_nonascii='yes'
|
146 |
|
export bash_cv_wcwidth_broken='no' #503312
|
|
171 |
export bash_cv_func_sigsetjmp="present"
|
|
172 |
export bash_cv_func_ctype_nonascii="yes"
|
|
173 |
# bug #503312
|
|
174 |
export bash_cv_wcwidth_broken="no"
|
147 |
175 |
fi
|
148 |
176 |
|
149 |
177 |
# This is for rlfe, but we need to make sure LDFLAGS doesn't change
|
... | ... | |
159 |
187 |
--with-curses
|
160 |
188 |
$(use_enable static-libs static)
|
161 |
189 |
)
|
|
190 |
|
162 |
191 |
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
163 |
192 |
|
164 |
193 |
if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
|
165 |
|
# code is full of AC_TRY_RUN()
|
|
194 |
# Code is full of AC_TRY_RUN()
|
166 |
195 |
mkdir -p examples/rlfe || die
|
167 |
196 |
cd examples/rlfe || die
|
168 |
|
ECONF_SOURCE="${S}"/examples/rlfe \
|
169 |
|
econf --cache-file="${BUILD_DIR}"/config.cache
|
|
197 |
|
|
198 |
ECONF_SOURCE="${S}"/examples/rlfe econf --cache-file="${BUILD_DIR}"/config.cache
|
170 |
199 |
fi
|
171 |
200 |
}
|
172 |
201 |
|
... | ... | |
174 |
203 |
emake
|
175 |
204 |
|
176 |
205 |
if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
|
177 |
|
# code is full of AC_TRY_RUN()
|
|
206 |
# Code is full of AC_TRY_RUN()
|
178 |
207 |
cd examples/rlfe || die
|
179 |
208 |
local l
|
180 |
209 |
for l in readline history ; do
|
... | ... | |
189 |
218 |
default
|
190 |
219 |
|
191 |
220 |
if multilib_is_native_abi ; then
|
192 |
|
gen_usr_ldscript -a readline history #4411
|
|
221 |
# bug #4411
|
|
222 |
gen_usr_ldscript -a readline history
|
193 |
223 |
|
194 |
224 |
if use utils && ! tc-is-cross-compiler; then
|
195 |
225 |
dobin examples/rlfe/rlfe
|
... | ... | |
199 |
229 |
|
200 |
230 |
multilib_src_install_all() {
|
201 |
231 |
HTML_DOCS="doc/history.html doc/readline.html doc/rluserman.html" einstalldocs
|
|
232 |
|
202 |
233 |
dodoc USAGE
|
203 |
234 |
docinto ps
|
204 |
235 |
dodoc doc/*.ps
|
205 |
236 |
}
|
206 |
237 |
pkg_preinst() {
|
207 |
238 |
# bug #29865
|
208 |
|
# Reappeared in #595324 with paludis so keeping this for now...
|
|
239 |
# Reappeared in bug #595324 with paludis so keeping this for now...
|
209 |
240 |
preserve_old_lib \
|
210 |
241 |
/$(get_libdir)/lib{history,readline}$(get_libname 4) \
|
211 |
242 |
/$(get_libdir)/lib{history,readline}$(get_libname 5) \
|