sys-libs/ncurses: Apply CoreOS changes

Add a symlink-usr USE flag for keeping a minimal set of terminfo
files in /usr/share/terminfo.

Also allow writes to /dev/ptmx, which sometimes causes the sandbox
to fail Jenkins builds.
This commit is contained in:
David Michael 2018-04-20 13:26:06 -04:00 committed by David Michael
parent 9dcfd7fc52
commit 89ff6feaf2

View File

@ -16,7 +16,7 @@ LICENSE="MIT"
# The subslot reflects the SONAME. # The subslot reflects the SONAME.
SLOT="0/6" SLOT="0/6"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd" KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
IUSE="ada +cxx debug doc gpm minimal profile static-libs test threads tinfo trace unicode" IUSE="ada +cxx debug doc gpm minimal profile static-libs symlink-usr test threads tinfo trace unicode"
DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )" DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
# berkdb? ( sys-libs/db )" # berkdb? ( sys-libs/db )"
@ -30,6 +30,12 @@ RDEPEND="${DEPEND}
S=${WORKDIR}/${MY_P} S=${WORKDIR}/${MY_P}
MINIMAL_TERMINFO=(
ansi console dumb linux rxvt rxvt-256color rxvt-unicode rxvt-unicode-256color
screen screen-16color screen-256color sun vt{52,100,102,200,220}
xterm xterm-color xterm-256color xterm-xfree86
)
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-6.0-gfbsd.patch" "${FILESDIR}/${PN}-6.0-gfbsd.patch"
"${FILESDIR}/${PN}-5.7-nongnu.patch" "${FILESDIR}/${PN}-5.7-nongnu.patch"
@ -100,6 +106,8 @@ multilib_src_configure() {
} }
do_configure() { do_configure() {
addwrite /dev/ptmx
local target=$1 local target=$1
shift shift
@ -251,12 +259,11 @@ multilib_src_install() {
} }
multilib_src_install_all() { multilib_src_install_all() {
# if ! use berkdb ; then if ! use symlink-usr ; then
# We need the basic terminfo files in /etc, bug #37026 # We need the basic terminfo files in /etc, bug #37026
einfo "Installing basic terminfo files in /etc..." einfo "Installing basic terminfo files in /etc..."
local x local x
for x in ansi console dumb linux rxvt rxvt-unicode screen{,-256color} vt{52,100,102,200,220} \ for x in "${MINIMAL_TERMINFO[@]}"
xterm xterm-{,256}color
do do
local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null) local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
local basedir=$(basename $(dirname "${termfile}")) local basedir=$(basename $(dirname "${termfile}"))
@ -268,14 +275,20 @@ multilib_src_install_all() {
/usr/share/terminfo/${basedir}/${x} /usr/share/terminfo/${basedir}/${x}
fi fi
done done
# fi
echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses
doenvd "${T}"/50ncurses doenvd "${T}"/50ncurses
use minimal && rm -r "${ED}"/usr/share/terminfo* use minimal && rm -r "${ED}"/usr/share/terminfo*
# Because ncurses5-config --terminfo returns the directory we keep it # Because ncurses5-config --terminfo returns the directory we keep it
keepdir /usr/share/terminfo #245374 keepdir /usr/share/terminfo #245374
elif use minimal; then
# prune all files and symlinks not listed in MINIMAL_TERMINFO
find "${D}"/usr/share/terminfo ! -type d \
${MINIMAL_TERMINFO[@]/#/! -name } \
-delete || die
find "${D}"/usr/share/terminfo -type d -empty -delete || die
fi
cd "${S}" cd "${S}"
dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc