herdstat-1.1.91 fails to compile with USE=readline with the following error:
/bin/sh ../libtool --silent --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -O2
-pipe -march=athlon64 -msse3 -pedantic -ansi -W -Wextra -Wall -Wold-style-cast
-Woverloaded-virtual -Wredundant-decls -o herdstat options.o common.o
xmlinit.o formatter.o cache.o package_cache.o metadata_cache.o
overlay_display.o query.o herdstat.o io/libio.la action/libaction.la -lherdstat
io/.libs/libio.a(handler.o):(.bss+0x0): multiple definition of `lhp'
io/.libs/libio.a(readline_completion_hooks.o):(.bss+0x0): first defined here
collect2: ld returned 1 exit status
make[3]: *** [herdstat] Error 1
make[3]: Leaving directory
`/var/tmp/portage/app-portage/herdstat-1.1.91/work/herdstat-1.1.91/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/var/tmp/portage/app-portage/herdstat-1.1.91/work/herdstat-1.1.91/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/app-portage/herdstat-1.1.91/work/herdstat-1.1.91'
make: *** [all] Error 2
With USE=-readline it compiles fine
Reproducible: Always
Steps to Reproduce:
USE=readline emerge herdstat
Portage 2.1.2-r9 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0,
2.6.20-gentoo x86_64)
=================================================================
System uname: 2.6.20-gentoo x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor
4200+
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 10 Feb 2007 11:20:01 +0000
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python: 2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox: 1.2.18.1
sys-devel/autoconf: 2.13, 2.61
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool: 1.5.22
virtual/os-headers: 2.6.20
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon64 -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf
/etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo
/etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=athlon64 -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo/ "
LINGUAS="en it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 arts bash-completion berkdb bitmap-fonts
cairo cdr cli cracklib crypt cups dbus dlloader doc dri dvd dvdr eds emboss
encode examples fam fbcon firefox flac fortran gdbm gif gpm gstreamer gtk2 hal
iconv ieee1394 isdnlog jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility
libg++ lm_sensors mad midi mikmod mmap mng mp3 mpeg ncurses nls nptl nptlonly
nsplugin offensive ogg opengl oss pam pcre perl png ppds pppd python qt3 qt4
quicktime readline reflection sasl sdl session speex spell spl ssl svg tcpd
theora threads tiff truetype truetype-fonts type1-fonts udev unicode vim-syntax
vorbis xcomposite xml xorg xpm xv zlib" ALSA_CARDS="emu10k1"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file
hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route
share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev"
KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001
mtxorb ncurses text" LINGUAS="en it" USERLAND="GNU" VIDEO_CARDS="nvidia nv
vesa"
Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Yes, I noticed that too. The herdstat-1.1.91-undefined-lhp.patch is applied
regardless of the readline USE flag but it is only required when
USE="-readline". Otherwise, lhp is defined twice.
Fix:
src_unpack() {
unpack ${A}
cd ${S}
if ! use readline ; then
epatch ${FILESDIR}/${PN}-1.1.91-undefined-lhp.patch
fi
}