Linux Archive

Linux Archive (
-   Gentoo Alt (
-   -   readline-> (

"Gregory M. Turner" 08-18-2012 01:59 AM

This is pretty much off-topic, but:

o It's kind-of off-topic everywhere
o I've only tested this on prefix
o I've posted too many low-content posts on -dev lately :)

The "inspiration" for this comes from the readline cygport. I had a
similar patch in my overlay tree, where, frankly, I tend to slavishly
imitate cygports, at least until I manage to understand it and can
intelligently gentoo-ize their changes.

Anyhow, it occurred to me that there might be nothing cygwin-specific
about this particular patch, so I tested it on an x86-linux overlay and
"it works" (so far). If there's any interest I could test more

I guess I should say what I'm talking about. The following patches the
readline ebuild so that libreadline will depend on libncursesw instead
of libncurses (if and only if the unicode use-flag is enabled). From
what I can glean from the interweb, some distros do this and some don't.
As for what the actual advantages or disadvantages might be,

I really have no clue.

I have heard some buzz that loading ncurses and ncursesw into the same
process space can cause problems, so there is, purportedly, at least,
some potential for this to trigger a reverse-dependency cascade forcing
ncursesw down the throat of a bunch of different ebuilds (if the unicode
use-flag is set)

Whether that's a bad or a good thing is open for debate.

I'm skeptical, insofar as it fixes something that doesn't seem broken,
but thought I should document, somewhere, that it "works for me," and
see if maybe someone who knows and/or cares more about this than I has
any input.

diff -u a/sys-libs/readline/readline-6.2_p1-r1.ebuild
--- a/sys-libs/readline/readline-6.2_p1-r1.ebuild 2012-05-26
07:44:24.000000000 -0700
+++ b/sys-libs/readline/readline-6.2_p1-r1.ebuild 2012-08-17
16:12:39.704843218 -0700

@@ -2,6 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header:
1.4 2012/04/30 01:36:43 vapier Exp $

inherit eutils multilib toolchain-funcs flag-o-matic

# Official patches
@@ -33,9 +34,9 @@
KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux
~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos
~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris

+IUSE="static-libs unicode"


@@ -45,6 +46,9 @@

cd "${S}"
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+src_prepare() {

epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
epatch "${FILESDIR}"/${PN}-5.2-no-ignore-shlib-errors.patch #216952
@@ -60,8 +64,11 @@
epatch "${FILESDIR}"/${PN}-6.1-aix-expfull.patch
epatch "${FILESDIR}"/${PN}-6.1-aix-soname.patch

+ ncursesw=
+ use unicode && ncursesw=w
# force ncurses linking #71420
- sed -i -e 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses:'
support/shobj-conf || die "sed"
+ sed -i -e "s:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses${ncursesw}:"
support/shobj-conf || die "sed"

# fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
# objformat for years, so we don't want to rely on that.
@@ -73,12 +80,14 @@
ln -s ../.. examples/rlfe/readline # for local readline headers

-src_compile() {
+src_configure() {
# fix implicit decls with widechar funcs
append-cppflags -D_GNU_SOURCE
append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc

+ use unicode && append-cppflags -I/usr/include/ncursesw
# This is for rlfe, but we need to make sure LDFLAGS doesn't change
# so we can re-use the config cache file between the two.
append-ldflags -L.
@@ -86,6 +95,15 @@
$(use_enable static-libs static)
+ if ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ cd examples/rlfe
+ econf --cache-file="${S}"/config.cache
+ fi
+src_compile() {
+ cd "${S}"
emake || die

if ! tc-is-cross-compiler ; then
@@ -96,7 +114,6 @@
ln -s ../../shlib/lib${l}*$(get_libname)*

ln -sf ../../lib${l}.a lib${l}.a
- econf --cache-file="${S}"/config.cache
emake || die

All times are GMT. The time now is 12:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.