diff options
Diffstat (limited to 'app-shells/bash/bash-4.3_p48-r2.ebuild')
-rw-r--r-- | app-shells/bash/bash-4.3_p48-r2.ebuild | 72 |
1 files changed, 49 insertions, 23 deletions
diff --git a/app-shells/bash/bash-4.3_p48-r2.ebuild b/app-shells/bash/bash-4.3_p48-r2.ebuild index 14f08b6aed1d..6315ebdb8789 100644 --- a/app-shells/bash/bash-4.3_p48-r2.ebuild +++ b/app-shells/bash/bash-4.3_p48-r2.ebuild @@ -1,9 +1,13 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit flag-o-matic toolchain-funcs multilib +inherit flag-o-matic toolchain-funcs + +# Uncomment if we have a patchset +GENTOO_PATCH_DEV="sam" +GENTOO_PATCH_VER="${PV}-r2" # Official patchlevel # See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/ @@ -31,10 +35,14 @@ patches() { READLINE_VER="6.3" DESCRIPTION="The standard GNU Bourne again shell" -HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" +HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html" SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" [[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" +if [[ -n ${GENTOO_PATCH_VER} ]] ; then + SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz" +fi + LICENSE="GPL-3" SLOT="${MY_PV}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86" @@ -45,24 +53,26 @@ DEPEND=">=sys-libs/ncurses-5.2-r2:0= nls? ( virtual/libintl )" RDEPEND="${DEPEND} !<sys-apps/portage-2.1.6.7_p1" -# we only need yacc when the .y files get patched (bash42-005) -BDEPEND="virtual/yacc" +# We only need bison (yacc) when the .y files get patched (bash42-005) +BDEPEND="sys-devel/bison" PATCHES=( - "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch - "${FILESDIR}"/${PN}-4.3-arrayfunc.patch - "${FILESDIR}"/${PN}-4.3-protos.patch - "${FILESDIR}"/${PN}-4.4-popd-offset-overflow.patch #600174 + "${WORKDIR}"/${P}-r2-patches/${PN}-4.3-mapfile-improper-array-name-validation.patch + "${WORKDIR}"/${P}-r2-patches/${PN}-4.3-arrayfunc.patch + "${WORKDIR}"/${P}-r2-patches/${PN}-4.3-protos.patch + "${WORKDIR}"/${P}-r2-patches/${PN}-4.4-popd-offset-overflow.patch # bug #600174 ) S="${WORKDIR}/${MY_P}" pkg_setup() { - if is-flag -malign-double ; then #7332 + # bug #7332 + if is-flag -malign-double ; then eerror "Detected bad CFLAGS '-malign-double'. Do not use this" eerror "as it breaks LFS (struct stat64) on x86." die "remove -malign-double from your CFLAGS mr ricer" fi + if use bashlogger ; then ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs." ewarn "This will log ALL output you enter into the shell, you have been warned." @@ -71,6 +81,10 @@ pkg_setup() { src_unpack() { unpack ${MY_P}.tar.gz + + if [[ -n ${GENTOO_PATCH_VER} ]] ; then + unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz + fi } src_prepare() { @@ -84,7 +98,7 @@ src_prepare() { sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die fi - # Avoid regenerating docs after patches #407985 + # Avoid regenerating docs after patches, bug #407985 sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die touch -r . doc/* || die @@ -92,10 +106,23 @@ src_prepare() { } src_configure() { + # Upstream only test with Bison and require GNUisms like YYEOF and + # YYERRCODE. The former at least may be in POSIX soon: + # https://www.austingroupbugs.net/view.php?id=1269. + # configure warns on use of non-Bison but doesn't abort. The result + # may misbehave at runtime. + unset YACC + local myconf=( --docdir='$(datarootdir)'/doc/${PF} --htmldir='$(docdir)/html' + + # Force linking with system curses ... the bundled termcap lib + # sucks bad compared to ncurses. For the most part, ncurses + # is here because readline needs it. But bash itself calls + # ncurses in one or two small places :(. --with-curses + $(use_with afs) $(use_enable net net-redirections) --disable-profiling @@ -109,17 +136,17 @@ src_configure() { # For descriptions of these, see config-top.h # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426 append-cppflags \ - -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \ - -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \ - -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \ - -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \ + -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \ + -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \ + -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \ + -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \ -DNON_INTERACTIVE_LOGIN_SHELLS \ -DSSH_SOURCE_BASHRC \ -DUSE_MKTEMP -DUSE_MKSTEMP \ $(use bashlogger && echo -DSYSLOG_HISTORY) # Don't even think about building this statically without - # reading Bug 7714 first. If you still build it statically, + # reading bug #7714 first. If you still build it statically, # don't come crying to us with bugs ;). #use static && export LDFLAGS="${LDFLAGS} -static" use nls || myconf+=( --disable-nls ) @@ -133,28 +160,27 @@ src_configure() { # is at least what's in the DEPEND up above. export ac_cv_rl_version=${READLINE_VER} - # Force linking with system curses ... the bundled termcap lib - # sucks bad compared to ncurses. For the most part, ncurses - # is here because readline needs it. But bash itself calls - # ncurses in one or two small places :(. - if [[ ${PV} != *_rc* ]] ; then # Use system readline only with released versions. myconf+=( --with-installed-readline=. ) fi - if use plugins; then + if use plugins ; then append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash else # Disable the plugins logic by hand since bash doesn't # provide a way of doing it. export ac_cv_func_dl{close,open,sym}=no \ ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no + sed -i \ -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \ configure || die fi - tc-export AR #444070 + + # bug #444070 + tc-export AR + econf "${myconf[@]}" } |