From f1aa825b8483db57bf28d0772acfa10aeebe83c3 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 27 Aug 2022 02:53:16 +0100 Subject: gentoo auto-resync : 27:08:2022 - 02:53:16 --- sys-libs/readline/readline-9999.ebuild | 90 ++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 36 deletions(-) (limited to 'sys-libs/readline/readline-9999.ebuild') diff --git a/sys-libs/readline/readline-9999.ebuild b/sys-libs/readline/readline-9999.ebuild index 934a8b1ce368..4bc9fb0d90a8 100644 --- a/sys-libs/readline/readline-9999.ebuild +++ b/sys-libs/readline/readline-9999.ebuild @@ -16,28 +16,20 @@ PLEVEL="${PV##*_p}" MY_PV="${PV/_p*}" MY_PV="${MY_PV/_/-}" MY_P="${PN}-${MY_PV}" +MY_PATCHES=() + is_release() { case ${PV} in - 9999|*_alpha*|*_beta*|*_rc*) return 1 ;; - *) return 0 ;; + 9999|*_alpha*|*_beta*|*_rc*) + return 1 + ;; + *) + return 0 + ;; esac } + [[ ${PV} != *_p* ]] && PLEVEL=0 -patches() { - [[ ${PLEVEL} -eq 0 ]] && return 1 - local opt=$1 - eval set -- {1..${PLEVEL}} - set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@") - if [[ ${opt} == -s ]] ; then - echo "${@/#/${DISTDIR}/}" - else - local u - for u in mirror://gnu/${PN} ftp://ftp.cwru.edu/pub/bash ; do - printf "${u}/${PN}-${MY_PV}-patches/%s " "$@" - printf "${u}/${PN}-${MY_PV}-patches/%s.sig " "$@" - done - fi -} DESCRIPTION="Another cute console display library" HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html https://git.savannah.gnu.org/cgit/readline.git" @@ -47,8 +39,28 @@ if [[ ${PV} == 9999 ]] ; then EGIT_BRANCH=devel inherit git-r3 elif is_release ; then - SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)" + SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz" SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig )" + + if [[ ${PLEVEL} -gt 0 ]] ; then + # bash-5.1 -> bash51 + my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) + + patch_url= + my_patch_index= + + for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do + for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do + patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) + SRC_URI+=" ${patch_url}" + SRC_URI+=" verify-sig? ( ${patch_url}.sig )" + done + + MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) + done + + unset my_pn patch_url my_patch_index + fi else SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" @@ -74,7 +86,7 @@ S="${WORKDIR}/${MY_P}" PATCHES=( "${FILESDIR}"/${PN}-5.0-no_rpath.patch - "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091 + "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch # bug #385091 "${FILESDIR}"/${PN}-7.0-headers.patch "${FILESDIR}"/${PN}-8.0-headers.patch @@ -94,7 +106,8 @@ src_unpack() { } src_prepare() { - [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) + [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" + default is_release || eautoreconf @@ -112,8 +125,8 @@ src_prepare() { ncurses_libs+=" -ltinfo${ncurses_libs_suffix}" fi else - # Force ncurses linking. #71420 - # Use pkg-config to get the right values. #457558 + # Force ncurses linking, bug #71420. + # Use pkg-config to get the right values, bug #457558. local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses$(usex unicode w '') --libs) fi @@ -124,21 +137,22 @@ src_prepare() { -e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \ examples/rlfe/configure || die - # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated + # Fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated # objformat for years, so we don't want to rely on that. sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die - ln -s ../.. examples/rlfe/readline || die # for local readline headers + # For local readline headers + ln -s ../.. examples/rlfe/readline || die } src_configure() { - # fix implicit decls with widechar funcs + # Fix implicit decls with widechar funcs append-cppflags -D_GNU_SOURCE # https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free - # Make sure configure picks a better ar than `ar`. #484866 - export ac_cv_prog_AR=$(tc-getAR) + # Make sure configure picks a better ar than `ar`, bug #484866 + export ac_cv_prog_AR="$(tc-getAR)" # Force the test since we used sed above to force it. export bash_cv_termcap_lib=ncurses @@ -147,9 +161,10 @@ src_configure() { # In cases where the C library doesn't support wide characters, readline # itself won't work correctly, so forcing the answer below should be OK. if tc-is-cross-compiler ; then - use kernel_Winnt || export bash_cv_func_sigsetjmp='present' - export bash_cv_func_ctype_nonascii='yes' - export bash_cv_wcwidth_broken='no' #503312 + use kernel_Winnt || export bash_cv_func_sigsetjmp="present" + export bash_cv_func_ctype_nonascii="yes" + # bug #503312 + export bash_cv_wcwidth_broken="no" fi # This is for rlfe, but we need to make sure LDFLAGS doesn't change @@ -165,14 +180,15 @@ multilib_src_configure() { --with-curses $(use_enable static-libs static) ) + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then - # code is full of AC_TRY_RUN() + # Code is full of AC_TRY_RUN() mkdir -p examples/rlfe || die cd examples/rlfe || die - ECONF_SOURCE="${S}"/examples/rlfe \ - econf --cache-file="${BUILD_DIR}"/config.cache + + ECONF_SOURCE="${S}"/examples/rlfe econf --cache-file="${BUILD_DIR}"/config.cache fi } @@ -180,7 +196,7 @@ multilib_src_compile() { emake if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then - # code is full of AC_TRY_RUN() + # Code is full of AC_TRY_RUN() cd examples/rlfe || die local l for l in readline history ; do @@ -195,7 +211,8 @@ multilib_src_install() { default if multilib_is_native_abi ; then - gen_usr_ldscript -a readline history #4411 + # bug #4411 + gen_usr_ldscript -a readline history if use utils && ! tc-is-cross-compiler; then dobin examples/rlfe/rlfe @@ -205,13 +222,14 @@ multilib_src_install() { multilib_src_install_all() { HTML_DOCS="doc/history.html doc/readline.html doc/rluserman.html" einstalldocs + dodoc USAGE docinto ps dodoc doc/*.ps } pkg_preinst() { # bug #29865 - # Reappeared in #595324 with paludis so keeping this for now... + # Reappeared in bug #595324 with paludis so keeping this for now... preserve_old_lib \ /$(get_libdir)/lib{history,readline}$(get_libname 4) \ /$(get_libdir)/lib{history,readline}$(get_libname 5) \ -- cgit v1.2.3