Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 453396

Summary: net-irc/irssi with sys-libs/ncurses[tinfo] - .../work/irssi-0.8.15/src/fe-text/terminfo-core.c:281: undefined reference to `tputs'
Product: Gentoo Linux Reporter: Ben Longbons <b.r.longbons>
Component: Current packagesAssignee: Sven Wegener <swegener>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, gienah, jer, monsieurp, net-irc
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 457530    
Attachments: build.log from net-irc/irssi
irssi-0.8.15-tinfo.patch
diff -wc irssi-0.8.15-r1.ebuild irssi-0.8.15-r2.ebuild
irssi-0.8.15-tinfo.patch
irssi-0.8.15-tinfo.patch that does not use pkg-config
idea for ebuild that uses tinfo flag
patch that uses $PKG_CONFIG --libs-only-l ncursesw
ebuild like comment 13
patch that uses $PKG_CONFIG --libs-only-l ncursesw (with AC_CHECK_LIB tinfow)
should be tinfo? in RDEPEND="sys-libs/ncurses[tinfo?]

Description Ben Longbons 2013-01-21 19:22:41 UTC
Created attachment 336382 [details]
build.log from net-irc/irssi

By inspecting the build.log, this appears to be the known side effect of fixing bug 452532

$ emerge -pv sys-libs/ncurses net-irc/irssi
These are the packages that would be merged, in order:

Calculating dependencies  .... done!
[ebuild   R    ] sys-libs/ncurses-5.9-r2:5  USE="cxx gpm tinfo unicode -ada -debug -doc -minimal -profile -static-libs -trace" 0 kB
[ebuild   R    ] net-irc/irssi-0.8.15-r1  USE="ipv6 perl ssl -socks5" 0 kB

Total: 2 packages (2 reinstalls), Size of downloads: 0 kB


$ emerge --info net-irc/irssi

Portage 2.1.11.47 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.16.0, 3.5.4-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.5.4-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-gentoo-2.2
KiB Mem:     3088812 total,    570224 free
KiB Swap:    8000364 total,   7909792 free
Timestamp of tree: Mon, 21 Jan 2013 10:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p42
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.6.8-r1, 2.7.3-r3, 3.2.3-r2, 3.3.0
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.3.6-r1, 4.4.7, 4.5.4, 4.6.0, 4.6.1-r1, 4.6.2, 4.6.3, 4.7.0, 4.7.1, 4.7.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo o11c toolchain games gamerlay qt sunrise
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -ggdb -Wno-c++0x-compat "
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --quiet-build y --with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.osuosl.org/ ftp://ftp.wallawalla.edu/pub/mirrors/ftp.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --bwlimit=50"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/toolchain /var/lib/layman/games /var/lib/layman/gamerlay /var/lib/layman/qt /var/lib/layman/sunrise"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 avahi bash-completion berkdb bzip2 clang cli consolekit cracklib crypt cups cxx dbus dri ffmpeg flac gdbm gpm gtk hal hscolour iconv icu ipv6 jpeg kde midi mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nptl ogg opengl openmp pam pcre png qt3support qt4 readline sdl session sql sse sse2 ssl svg tcpd threads tiff timidity truetype unicode usb vorbis webkit wxwidgets xinerama zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_6 python2_7 python3_2 pypy1_9" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.6 2.7 3.2 2.7-pypy-1.9"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

net-irc/irssi-0.8.15-r1 was built with the following:
USE="ipv6 (multilib) perl ssl -socks5"
Comment 1 Paul Osmialowski 2013-02-04 04:48:22 UTC
Same problem here: I can rebuild irssi on hosts where I've got ncurses built with USE flag "-tinfo" while it is not possible on hosts where USE flag "tinfo" is set for ncurses due to CUDA toolkit requirements.
Comment 2 Paul Osmialowski 2013-02-04 07:44:05 UTC
Seems like it touches more packages:

checking for unistd.h... yes
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for setupterm in -lncursesw... no
checking for setupterm in -lncurses... no
checking for setupterm in -lcurses... no
configure: error: curses library not found, so this package cannot be built
See `config.log' for more details.
 * ERROR: dev-haskell/terminfo-0.3.2.3 failed (configure phase):
 *   setup configure failed

...as a result, dev-vcs/darcs cannot be built either.
Comment 3 Paul Osmialowski 2013-02-04 07:52:17 UTC
WORKAROUND:

1. for irrsi:
LDFLAGS="-ltinfo" LIBS="-ltinfo" emerge irssi

2. for darcs:
LDFLAGS="-ltinfo" LIBS="-ltinfo" emerge terminfo
emerge darcs
Comment 4 Paul Osmialowski 2013-02-13 07:11:13 UTC
Same goes to dev-ml/findlib, workaroud involves ocaml rebuild:

LDFLAGS="-ltinfo" LIBS="-ltinfo" emerge dev-lang/ocaml
emerge dev-ml/findlib

I'm not sure if these flags need to be passed to ocaml rebuild - I didn't see "-ltinfo" through build output, it might replace missing functions with its own replacements or stubs or something.
Comment 5 Paul Osmialowski 2013-02-13 07:14:32 UTC
Regarding ocaml/findlib, one more thing: I examined /usr/lib/ocaml/Makefile config and I found this:

$ cat /usr/lib/ocaml/Makefile.config |grep tinfo
BYTECCLINKOPTS=-ltinfo  -Wl,-E
NATDYNLINKOPTS=-ltinfo -Wl,-E
NATIVECCLINKOPTS=-ltinfo 
MKDLL=i686-pc-linux-gnu-gcc -shared -ltinfo
MKMAINDLL=i686-pc-linux-gnu-gcc -shared -ltinfo

so no stubs or replacements, libtinfo is used.
Comment 6 Paul Osmialowski 2013-02-27 05:31:36 UTC
One more troublemaker:
LDFLAGS="-ltinfo" LIBS="-ltinfo" emerge heimdal
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-02-27 20:35:13 UTC
(In reply to comment #6)
> One more troublemaker:

Please file separate bug reports for separate packages and make them block bug #457530. This bug report is about net-irc/irssi.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-02-27 21:03:16 UTC
Created attachment 340414 [details, diff]
irssi-0.8.15-tinfo.patch

This might do it. Please test.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2013-03-03 14:49:37 UTC
(In reply to comment #8)
> Created attachment 340414 [details, diff] [details, diff]
> irssi-0.8.15-tinfo.patch
> 
> This might do it. Please test.

curses.m4 has AC_DEFINEs, like USE_NCURSES and it's then used in the code, for example here:

src/fe-text/term-curses.c:#if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)

(sorry for reCCing you but wanted to inform about the bug in the patch)
Comment 10 Paul Osmialowski 2013-03-13 05:34:26 UTC
Yet another:

LDFLAGS="-ltinfo" LIBS="-ltinfo" emerge zsh

also openrc with ncurses USE flag fails to build the same way.
Maybe a new bug should be opened where all these packages could be listed?
Comment 11 Paul Osmialowski 2013-03-13 05:39:28 UTC
sorry I didn't notice a note about #457530 - I'm not in CC so I wasn't notified.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2013-10-02 13:54:28 UTC
Comment on attachment 340414 [details, diff]
irssi-0.8.15-tinfo.patch

(In reply to Samuli Suominen from comment #9)
> (sorry for reCCing you but wanted to inform about the bug in the patch)

No, that's fine. :)
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-25 19:07:58 UTC
I seem to have found a remarkably simple solution. sys-libs/ncurses[tinfo] simply means a libtinfo compatible library is installed alongside libncurses. irssi has long supported that configuration - setting `econf --with-terminfo --without-ncurses' does exactly that. --with-ncurses, on the other hand, simply means "use libncurses to use its terminfo functions". We don't need that with libtinfo installed separately.

Index: irssi-0.8.15-r1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-irc/irssi/irssi-0.8.15-r1.ebuild,v
retrieving revision 1.12
diff -u -B -r1.12 irssi-0.8.15-r1.ebuild
--- irssi-0.8.15-r1.ebuild      1 Dec 2012 18:28:00 -0000       1.12
+++ irssi-0.8.15-r1.ebuild      25 Dec 2013 19:07:03 -0000
@@ -16,9 +16,9 @@
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="ipv6 +perl ssl socks5"
+IUSE="ipv6 +perl ssl socks5 tinfo"
-RDEPEND="sys-libs/ncurses
+RDEPEND="sys-libs/ncurses[tinfo=]
        >=dev-libs/glib-2.6.0
        ssl? ( dev-libs/openssl )
        perl? ( dev-lang/perl )
@@ -38,7 +39,8 @@
 src_configure() {
        econf \ 
                --with-proxy \
-               --with-ncurses="${EPREFIX}"/usr \
+               $(usex tinfo '--with-terminfo --without-ncurses' \
+                       "--without-terminfo --with-ncurses="${EPREFIX}"/usr") \
                --with-perl-lib=vendor \
                $(use_with perl) \
                $(use_with socks5 socks) \
Index: metadata.xml
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-irc/irssi/metadata.xml,v
retrieving revision 1.4
diff -u -B -r1.4 metadata.xml
--- metadata.xml        19 Feb 2006 20:22:05 -0000      1.4
+++ metadata.xml        25 Dec 2013 19:07:03 -0000
@@ -6,4 +6,9 @@
        <email>swegener@gentoo.org</email>
        <description>Primary Maintainer</description>
 </maintainer>
+<use>
+<flag name='tinfo'>
+       Use only libtinfo from <pkg>sys-libs/ncurses</pkg>
+</flag>
+</use>
 </pkgmetadata>
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-25 19:21:08 UTC
(In reply to Jeroen Roovers from comment #13)
> I seem to have found a remarkably simple solution. sys-libs/ncurses[tinfo]
> simply means a libtinfo compatible library is installed alongside
> libncurses. irssi has long supported that configuration - setting `econf
> --with-terminfo --without-ncurses' does exactly that. --with-ncurses, on the
> other hand, simply means "use libncurses to use its terminfo functions". We
> don't need that with libtinfo installed separately.

The wording is a bit wrong here and there: ncurses has supported a split off libtinfo since forever. irssi has supported that since forever, too. Also:

s|compatible||
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-26 15:57:36 UTC
Fixed in -r2 and 9999.
Comment 16 Zhu Sha Zang 2013-12-28 15:15:33 UTC
Hello there, since net-irc/irssi-0.8.15-r2 update, using UTF-8 (pt_BR) letters like "é", "ê", "ö" and so on are appearing like these ones, just on irssi:

é - MM-)
ê - MM-*
ö - MM-6
ç - MM-'

If I downgrade to r1, things came back to normal.

[ebuild   R    ] net-irc/irssi-0.8.15-r2  USE="ipv6 perl socks5 ssl -tinfo" 0 kB

I disabled "tinfo" because cause more trouble than any other useflag since 2004.

My --info


Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.17, 3.12.5-gentoo-blackhammer x86_64)
=================================================================
System uname: Linux-3.12.5-gentoo-blackhammer-x86_64-AMD_Phenom-tm-_II_X4_960T_Processor-with-gentoo-2.2
KiB Mem:     8181208 total,    657248 free
KiB Swap:    3015932 total,   3004852 free
Timestamp of tree: Sat, 28 Dec 2013 14:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.2.5-r3, 3.3.3
dev-util/cmake:           2.8.12.1-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.14.1
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.12 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -Os -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=amdfam10 -Os -pipe"
DISTDIR="/usr/local/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --keep-going=y --with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pt_BR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8 --load-average"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="3dnow 3dnowext R X Xaw3d a52 aac aacplus aalib acl acpi addressbook adiummessagestyle adobe-cff adplug ads afp aio airplay alisp alsa amd64 android annotations ao apng archive asf ass assistant atmo autoipd autostatus autotools autotrace avahi avatars avcodec avconv avformat avx bazaar bearer berkdb bidi bip bitmap bitsofbinary bl bookmarks branding bs2b bsf bufferevents bugzilla bzip2 c++0x cairo calendar caps captcha captchaforms cdparanoia cg chardet chatzilla chemistry chm clearcase cli clientinfo clock clutter cmake collab color colord commands compress compressed-lumas connectivity console consolekit contacts context contrast contrib corefonts coverage cracklib creds crypt cryptsetup cscope css csv ctype cue curl cvs cxx d daap dap databasedesigner dataforms datastreamsmanager dbus ddate ddcpci debugger declarative designer-plugin desktopglobe devhelp device-mapper dia diff dig dirac djvu downloadorder dri dts dv dvb dvbplayer dvbpsi dvbsetup dvd eap eap-sim ebook ecls edd embedded emoticons emotion emovix encode espeak ethumb evas eve excel exceptions experimental expert-mode extensions extra extras faac faad facebook fakevim fam fastcgi fastscroll fbcon feedback ffmpeg fftw filestreamsmanager filetransfer fits flac fltk fontconfig fontforge foomaticdb fortran fortran2003 ftp fuse g3dvl gajim galago gallery game-engine games gateways gbm gcj gconf gcov gcrypt gd gdbm geoip geolocation geos gflags gfxnvidia ggi gif gimp ginac git gkrellm glade glep gles gles1 gles2 glew glib glpk glut gmail gme gmp gnumeric gnuplot go google googledrive gpg gphoto2 gpm gpu grammar graph graphbrowsing graphics graphite graphviz grilo groupwise growl grp grub gs gsf gsm gstreamer gtalk gtk gts gudev gui guidexml guile gvfs gzip hd hddtemp highlight hog hpcups hpijs html http http-cache httpd httppower hwdb ices iconv icq icu id3 id3tag ide ieee1394 image imaging imap imapc imlib inbandstreams infinality inotify iostats ipv6 ipython iqauth irc jabber jabbersearch jack java jemalloc joystick jpeg kate kde kdepim kdm kdrive kerberos keymap kipi ladspa lame lapack lash lastfm lastfmfingerprint lastfmradio latex lcms libass libatomic libcaca libffi libkms libnotify libproxy libsamplerate libtiger libv4l libv4l2 linsys listen-queue live lm_sensors location logger logrotate logviewer lqr lua lua-cairo lua-imlib luajit luatex lv2 lxml lyx lzma lzo mac mad madde maildir math mathml matplotlib matroska matrox mbox md5 md5sum mdnsresponder-compat meanwhile melt mempool-buddy mempool-chained-pool mempool-fixed-bitmap mempool-one-big mempool-pass-through mercurial messagearchiver messaging minizip mjpeg mlib-update mmap mms mmx mmxext mng moc modules mozdom mp3 mp3tunes mp4 mpd mpeg mpg123 mtp mudflap multilib multimedia multiprocess multislot multitarget multiuser multiuserchat musepack music musicbrainz mysql nano-syntax nas nat-pmp ncurses network network-cron networking nlpsolver nls nntp nova nowlistening npp nptl nsplugin nss ntfs ntlm numpy nut nvidia objc objc++ objc-gc octave odk ofa offensive offlinehelp ofono ofx ogg okteta omxil openal openct openctl opencv openexr opengl openid openmp openrc openssl optimisememory organizer oscar oss otr outputs overlays ovftool pam pango patented pdf pep8 pepmanager perforce perl phonehome pipe player plotutils plugin-autowep plugin-btscan plugin-checksum plugin-doat plugin-dot15d4 plugin-fishlim plugin-ptw plugin-spectools plugin-sysinfo plugin-syslog plugins png pnm policykit pop pop3c postgres postproc ppp privacy privacylists private-headers privatestorage profiler profiling pronounce publishers publishsubscribe pvr pyflakes pyglet pygments pylint pyqt4 pyside python python3 pyx pyzord qalculate qmake qml qpak qrcode qscintilla qt-dbus qt-faststart qt-webkit qt3support qt4 qthelp qtscript quicktime quotes quvi qwt radio readline real recorder reencrypt registration remotecontrol remoteosd reviewboard roaming romio rostersearch rss rtsp s3 samba sandbox sasl scanner schroedinger science scipy screen screenshot script scripts scrobbler sdk sdl sdl-image sdl-sound sdlaudio sdlgfx secure-delete security semantic-desktop sensord sensors servicediscovery serviceframework session sessionnegotiation sha1 sha512 shadow shine shout sid sidebar sip skins skype slp smbsharemodes smbtav2 smi smime smp sms smtp snappy sndfile snmp snmppower sockets socks socks5 socksstreams sound soundcloud sounds source sourceview sox sparse speex spell sphinx sql sqlite sqlite3 sse sse2 sse3 ssl stars startup-notification statistics stats stereo stream strigi subtitles subversion svg swat swig switcher swscale system-sqlite systeminfo t1lib taglib tcl tcpd tcpdump tcpreplay tcpwrapper tellico telnet templates texmacs theme-manager themedesigner themes theora thin-splines threads threadsafe thumbnail thunderbird tiff timerinfo timezone tk tls toolame toolbar tools tor tordns trace traits transcode tray trayicon truetype tslib tv tvtime tweak-mode twitter twolame udev udisks udisks2 ukit uml unicode unlock-notify upcall upower urandom usb utils v4l v8 vaapi valgrind vamp vcard vcd vcdx vdpau verse versit vga video videos vim vim-pager vim-plugin vim-syntax vimeo virtualbox visual visualizer vix vlm vmware-tools vmware_guest_freebsd vmware_guest_linux vmware_guest_netware vmware_guest_solaris vmware_guest_winPre2k vmware_guest_windows vnc vocoder volpack vorbis vpx wad watchdog wav waveout wavpack weather weather-metar weather-xoap webkit webp webpresence wifi winbind wireshark wma wma-fixed wmf wps wxwidgets x11vnc x264 xanim xattr xbase xcb xchatdccserver xcomposite xdg xetex xforward xfs xft xine xinerama xlockrc xls xml xmldoclet xmlpatterns xmlreader xmlrpc xmlsec xmlwriter xmms2 xmp xmpp xmppuriqueries xnest xorg xorgmodule xosd xplanet xpm xprint xrandr xrender xscreensaver xsettings xslt xterm xv xvfb xvid yahoo yahoo-geo yaml yaz youtube yuv4mpeg zfs zip zlib zsh-completion zvbi" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" DVB_CARDS="dibusb-usb1 dibusb-usb2 usb-dib0700" ELIBC="glibc" ENLIGHTENMENT_MODULES="access backlight battery clock comp conf-applications conf-dialogs conf-display conf-edgebindings conf-interaction conf-intl conf-keybindings conf-menus conf-paths conf-performance conf-randr conf-shelves conf-theme conf-window-manipulation conf-window-remembers connman cpufreq dropshadow everything fileman fileman-opinfo gadman ibar ibox illume2 mixer msgbus notification pager quickaccess shot start syscon systray tasks temperature tiling winlist wizard xkbswitch" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer nlpsolver scripting-beanshell scripting-javascript wiki-publisher" LINGUAS="pt_BR de en" LIRC_DEVICES="audio audio_alsa imputlirc irdeo irdeo_remote irlink irman irreal serial udp" NETBEANS_MODULES="apisupport cnd dlight enterprise ergonomics java javacard javafx mobility profiler webcommon websvccommon" NGINX_MODULES_HTTP="access addition auth_basic autoindex browser cache_purge charset dav degradation empty_gif fancyindex fastcgi flv geo geoip gzip gzip_static headers_more image_filter limit_conn limit_req limit_zone lua map memcached mp4 perl proxy push random_index realip referer rewrite scgi secure_link slowfs_cache split_clients ssi stub_status sub upload upload_progress upstream_ip_hash userid uwsgi xslt" NGINX_MODULES_MAIL="imap pop3 smtp" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2 python3_3" QEMU_SOFTMMU_TARGETS="i386 arm" QEMU_USER_TARGETS="i386 arm" RUBY_TARGETS="ruby18 ruby19 ruby20 ruby21" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa vga v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.2 3.3"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-28 16:05:26 UTC
(In reply to Zhu Sha Zang from comment #16)
> Hello there, since net-irc/irssi-0.8.15-r2 update, using UTF-8 (pt_BR)

Confirmed. Obviously it wouldn't support wide char options when ncurses(w) isn't used. So I guess we do (always?) want both libncurses and libtinfo, which requires some PKG_CONFIG_MODULES hackery in configure.in.
Comment 18 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-28 18:08:20 UTC
I have reverted all related commits (except some EPREFIX stuff). Having a separate curses.m4 really messes up anything you might want to fix in there. And though the code in question was borrowed from app-misc/mc, that project no longer uses similar code.
Comment 19 Mark Wright gentoo-dev 2014-03-02 02:17:32 UTC
Created attachment 371532 [details, diff]
diff -wc irssi-0.8.15-r1.ebuild irssi-0.8.15-r2.ebuild

Proposed irssi-0.8.15-r2.ebuild based on irssi-0.8.15-r1.ebuild that
applies my irssi-0.8.15-tinfo.patch
Comment 20 Mark Wright gentoo-dev 2014-03-02 02:20:47 UTC
Created attachment 371534 [details, diff]
irssi-0.8.15-tinfo.patch

Patch by me.  I earlier tried:

PKG_CHECK_MODULES(NCURSES,ncurses)

which failed, so I switched that to just calling:

NCURSES_LIBS=`pkg-config --libs-only-l ncurses`
Comment 21 Mark Wright gentoo-dev 2014-03-04 13:10:18 UTC
Fixed in irssi-0.8.15-r2
Comment 22 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-04 14:09:32 UTC
(In reply to Mark Wright from comment #21)
> Fixed in irssi-0.8.15-r2

And now cross-compiling might fail because you use pkg-config directly.
Comment 23 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-04 14:12:12 UTC
Additionally, it turns out all it ever needed was libtinfo - with --as-needed, libncurses is justly removed again when you've only just added it through pkg-config.
Comment 24 Mark Wright gentoo-dev 2014-03-05 03:22:38 UTC
(In reply to Jeroen Roovers from comment #22)
> And now cross-compiling might fail because you use pkg-config directly.

Thanks for pointing out that problem, in src_prepare I added:

	epatch "${FILESDIR}/${PN}-0.8.15-tinfo.patch"
	sed -e "s@pkg-config@$(tc-getPKG_CONFIG)@g" \
		-i "${S}/curses.m4" \
		|| die "Could not configure pkg-config in curses.m4"

(In reply to Jeroen Roovers from comment #23)
> Additionally, it turns out all it ever needed was libtinfo - with
> --as-needed, libncurses is justly removed again when you've only just added
> it through pkg-config.

In src_configure I added:

	$(test-flag-CC "-Wl,--as-needed") && append-ldflags "-Wl,--as-needed"

after which, it only wants libtinfo.so.5 when built on a machine with
sys-libs/ncurses-5.9-r3 built with the tinfo use flag:

argus ~ # scanelf -n /usr/bin/irssi
 TYPE   NEEDED FILE 
ET_DYN libperl.so.5.16,libgmodule-2.0.so.0,libglib-2.0.so.0,libssl.so.1.0.0,libcrypto.so.1.0.0,libtinfo.so.5,libpthread.so.0,libc.so.6 /usr/bin/irssi 
argus ~ # 

I committed those changes:

'Thanks for jer for reporting in bug 453396 that "And now cross-compiling might fail because you use pkg-config directly." - correct this by using a sed to in src_prepare to change pkg-config to $(tc-getPKG_CONFIG). Add "-Wl,--as-needed" to LDFLAGS, thanks to jer in comment 23 of bug 453396.'

I'm not sure if this is what you had in mind, please comment if there are any
problems or if you have better ideas.
Comment 25 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-05 15:03:41 UTC
(In reply to Mark Wright from comment #24)
> I'm not sure if this is what you had in mind, please comment if there are any
> problems or if you have better ideas.

No, it wasn't what I had in mind, or I would have done that already.

What is happening now is that you patch in "pkg-config" and then replace it with whatever PKG_CONFIG is set to. Surely you could call $PKG_CONFIG in configure and do `tc-export PKG_CONFIG' instead?

Linking to arbitrary libraries and then having --as-needed opportunistically remove them doesn't look like something upstream would warm up to, either.

Ideally, curses.m4 should be adapted (upstream?) to properly identify what it needs to link against. Currently it does none of that - all the logic concerning libtinfo is in configure.
Comment 26 Mark Wright gentoo-dev 2014-03-06 06:43:49 UTC
(In reply to Jeroen Roovers from comment #25)
> (In reply to Mark Wright from comment #24)
> > I'm not sure if this is what you had in mind, please comment if there are any
> > problems or if you have better ideas.
> 
> No, it wasn't what I had in mind, or I would have done that already.
> 
> What is happening now is that you patch in "pkg-config" and then replace it
> with whatever PKG_CONFIG is set to. Surely you could call $PKG_CONFIG in
> configure and do `tc-export PKG_CONFIG' instead?

I could have, I was slightly concerned it may be more difficult to upstream a
change that uses a PKG_CONFIG environment variable.

I looked at trying to use pkg.m4 - that made the configuration complex
and I quickly gave up on that option - it just seemed to be harder
than your suggestion of using the PKG_CONFIG environment variable.

Of course it would have worked to tweak it to use the PKG_CONFIG
environment variable, with your suggestion to tweak curses.m4 I
could see how it could work without pkg-config.

> Linking to arbitrary libraries and then having --as-needed opportunistically
> remove them doesn't look like something upstream would warm up to, either.

Yes, so I tweaked it to use libncurses and libtinfo.

> Ideally, curses.m4 should be adapted (upstream?) to properly identify what
> it needs to link against. Currently it does none of that - all the logic
> concerning libtinfo is in configure.

Thanks for you help.  I committed revision 1.6 that:

1. Removes the pkg-config, and instead replaces it with logic in
files/irssi-0.8.15-tinfo.patch to change curses.m4 to:
 (a) check if tputs is in -lncurses
 (b) and if not to try if its in -ltinfo - if it is,
     CURSES_LIBS='-lncurses -ltinfo'

It also removes the quotes around:
screen_manager=$5
that just avoids this message in build.log

./configure: line 14055: on: command not found

2. Add the --without-terminfo configure flag as without this irssi
defaults to linking with -ltinfo without -lncurses

This makes it link with libncurses and libtinfo:

$ scanelf -n /usr/bin/irssi
 TYPE   NEEDED FILE 
ET_EXEC libgmodule-2.0.so.0,libglib-2.0.so.0,libssl.so.1.0.0,libcrypto.so.1.0.0,libncurses.so.5,libtinfo.so.5,libpthread.so.0,libc.so.6 /usr/bin/irssi 
$
Comment 27 Mark Wright gentoo-dev 2014-03-06 11:46:34 UTC
I think I should not have hardcoded this:

--without-terminfo \

I find in irssi that quote characters (I am guessing ' ` ) are displayed
as ^Y in red and stuff like that when running irssi konsole in a utf-8
locale with:

term_charset = "UTF-8";

in ~/.irssi/config

I think we should have a use flag to control that, like maybe tinfo,
something like:

$(usewith tinfo terminfo)

It would be useful to test something like that and see what you think.
Comment 28 Mark Wright gentoo-dev 2014-03-06 12:22:34 UTC
Created attachment 371854 [details, diff]
irssi-0.8.15-tinfo.patch that does not use pkg-config
Comment 29 Mark Wright gentoo-dev 2014-03-06 12:26:10 UTC
Created attachment 371856 [details]
idea for ebuild that uses tinfo flag

This is an idea, to see what you thing, needs more testing, and would have to be revbumped to introduce a new use flag and/or change EAPI to 5.
Comment 30 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 17:36:10 UTC
(In reply to Mark Wright from comment #29)
> Created attachment 371856 [details]
> idea for ebuild that uses tinfo flag
> 
> This is an idea, to see what you thing, needs more testing, and would have
> to be revbumped to introduce a new use flag and/or change EAPI to 5.

You have arrived at comment #13. Welcome to the club!
Comment 31 Mark Wright gentoo-dev 2014-03-08 12:32:00 UTC
Created attachment 372072 [details, diff]
patch that uses $PKG_CONFIG --libs-only-l ncursesw
Comment 32 Mark Wright gentoo-dev 2014-03-08 12:36:56 UTC
Created attachment 372076 [details]
ebuild like comment 13

(In reply to Jeroen Roovers from comment #30)
> (In reply to Mark Wright from comment #29)
> > Created attachment 371856 [details]
> > idea for ebuild that uses tinfo flag
> > 
> > This is an idea, to see what you thing, needs more testing, and would have
> > to be revbumped to introduce a new use flag and/or change EAPI to 5.
> 
> You have arrived at comment #13. Welcome to the club!

Duh, I read that earlier but obviously forgot.  OK sorry I'm
kind of slow, seems we need wide ncurses. irssi has this bug
that irssi supposedly supports wide ncurses, but does not do
any autotools stuff to support wide ncurses:

http://bugs.irssi.org/index.php?do=details&task_id=792

So I try adding support for detecting wide ncurses.
There is nothing about pkg-config or tinfo in /usr/share/aclocal/ax_with_curses.m4 so that seems useless.
It seems easier to use pkg-config to try to configure
for wide ncurses (yeah I know I'm going around in circles),
so I use your previous advice to tc-export PKG_CONFIG
(which seems fine as I now see that configure already knows
about the PKG_CONFIG environment variables).
Comment 33 Mark Wright gentoo-dev 2014-03-08 12:47:08 UTC
Created attachment 372078 [details, diff]
patch that uses $PKG_CONFIG --libs-only-l ncursesw (with AC_CHECK_LIB tinfow)

Correct copy/paste error:
AC_CHECK_LIB(tinfow    # not tinfo here
Comment 34 Mark Wright gentoo-dev 2014-03-10 14:44:04 UTC
Created attachment 372296 [details]
should be tinfo? in RDEPEND="sys-libs/ncurses[tinfo?]
Comment 35 cilly 2014-04-24 08:29:35 UTC
Had compiled irssi before without the option --without-terminfo, german umlauts worked.

net-irc/irssi-0.8.15-r2

7c7
< inherit autotools-utils eutils flag-o-matic perl-module toolchain-funcs
---
> inherit autotools-utils eutils perl-module
35,37d34
< 	sed -e "s@pkg-config@$(tc-getPKG_CONFIG)@g" \
< 		-i "${S}/curses.m4" \
< 		|| die "Could not configure pkg-config in curses.m4"
43d39
< 	$(test-flag-CC "-Wl,--as-needed") && append-ldflags "-Wl,--as-needed"
46a43
>		--without-terminfo \

after re-emerging with the silent fix and the option --without-terminfo, german umlauts are broken while using irssi in screen session
Comment 36 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-03-22 08:44:34 UTC
This is no longer an issue with recent irssi versions