--- /usr/portage/app-shells/bash/bash-4.3_p30-r1.ebuild 2014-11-09 18:41:28.000000000 -0200 +++ /home/amadio/gentoo/overlays/prefix/app-shells/bash/bash-4.3_p30-r1.ebuild 2014-12-04 20:34:17.331421301 -0200 @@ -1,10 +1,9 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.3_p30-r1.ebuild,v 1.1 2014/11/09 20:41:28 mgorny Exp $ EAPI="4" -inherit eutils flag-o-matic toolchain-funcs multilib +inherit eutils flag-o-matic toolchain-funcs multilib prefix # Official patchlevel # See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/ @@ -38,7 +37,7 @@ LICENSE="GPL-3" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +KEYWORDS="~amd64-linux" IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla" DEPEND=">=sys-libs/ncurses-5.2-r2 @@ -88,6 +87,33 @@ epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch epatch "${FILESDIR}"/${PN}-4.3-term-cleanup.patch + # this adds additional prefixes + epatch "${FILESDIR}"/${PN}-4.0-configs-prefix.patch + eprefixify pathnames.h.in + + epatch "${FILESDIR}"/${PN}-4.0-bashintl-in-siglist.patch + + # Fix not to reference a disabled symbol if USE=-readline, breaks + # Darwin, bug #500932 +# if use !readline ; then +# sed -i -e 's/enable_hostname_completion//' builtins/shopt.def || die +# fi + + # Nasty trick to set bashbug's shebang to bash instead of sh. We don't have + # sh while bootstrapping for the first time, This works around bug 309825 + sed -i -e '1s:sh:bash:' support/bashbug.sh || die + + # modify the bashrc-r1 file for prefix + pushd "${T}" > /dev/null || die + cp "${FILESDIR}"/bashrc-r1 . + epatch "${FILESDIR}"/bashrc-prefix-r1.patch + eprefixify bashrc-r1 + popd > /dev/null + + # DON'T YOU EVER PUT eautoreconf OR SIMILAR HERE! THIS IS A CRITICAL + # PACKAGE THAT MUST NOT RELY ON AUTOTOOLS, USE A SELF-SUFFICIENT PATCH + # INSTEAD!!! + epatch_user } @@ -96,6 +122,16 @@ # For descriptions of these, see config-top.h # bashrc/#26952 bash_logout/#90488 ssh/#24762 + if use prefix ; then + append-cppflags \ + -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \ + -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin:/bin:/usr/bin:/sbin:/usr/sbin\"\' \ + -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \ + -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \ + -DNON_INTERACTIVE_LOGIN_SHELLS \ + -DSSH_SOURCE_BASHRC \ + $(use bashlogger && echo -DSYSLOG_HISTORY) + else append-cppflags \ -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \ -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \ @@ -104,6 +140,27 @@ -DNON_INTERACTIVE_LOGIN_SHELLS \ -DSSH_SOURCE_BASHRC \ $(use bashlogger && echo -DSYSLOG_HISTORY) + fi + + # IRIX's MIPSpro produces garbage with >= -O2, bug #209137 + [[ ${CHOST} == mips-sgi-irix* ]] && replace-flags -O? -O1 + + if [[ ${CHOST} == *-aix* ]] || [[ ${CHOST} == *-hpux* ]] ; then + # Avoid finding tgetent() in anything else but ncurses library, + # as is provided by ncurses, even during bootstrap + # on AIX and HP-UX, and we would get undefined symbols like + # BC, PC, UP if linking against something else. + # The bash-bug is that it doesn't check for provider, + # and unfortunately {,n}curses is checked last. + # Even if ncurses provides libcurses.so->libncurses.so symlink, + # it feels more clean to link against libncurses.so directly. + # (all configure-variables for tgetent() are shown here) + export ac_cv_func_tgetent=no + export ac_cv_lib_termcap_tgetent=no # found on HP-UX + export ac_cv_lib_tinfo_tgetent=no + export ac_cv_lib_curses_tgetent=no # found on AIX + #export ac_cv_lib_ncurses_tgetent=no + fi # Don't even think about building this statically without # reading Bug 7714 first. If you still build it statically, @@ -131,7 +188,12 @@ fi if use plugins; then - append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash + case ${CHOST} in + *-linux-gnu | *-solaris* | *-freebsd* ) + append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash + ;; + # Darwin doesn't need an rpath here (in fact doesn't grok the argument) + esac else # Disable the plugins logic by hand since bash doesn't # provide a way of doing it. @@ -176,7 +238,7 @@ insinto /etc/bash doins "${FILESDIR}"/bash_logout - newins "${FILESDIR}"/bashrc-r1 bashrc + newins "${T}"/bashrc-r1 bashrc keepdir /etc/bash/bashrc.d insinto /etc/skel for f in bash{_logout,_profile,rc} ; do