{"id":319,"date":"2008-06-22T01:09:03","date_gmt":"2008-06-21T22:09:03","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=319"},"modified":"2009-05-03T13:14:40","modified_gmt":"2009-05-03T10:14:40","slug":"the-quest-for-a-better-rxvt-unicode-on-gentoo","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2008\/06\/22\/the-quest-for-a-better-rxvt-unicode-on-gentoo\/","title":{"rendered":"The quest for a better rxvt-unicode on Gentoo"},"content":{"rendered":"<p>Today, while studying I decided to manually run a <a href=\"http:\/\/www.gentoo.org\/doc\/en\/prelink-howto.xml\">prelink<\/a> on my system. For no good reason. Just boredom I guess. The results were pretty interesting though.<\/p>\n<p>Among the output there was a line that made a very big impression to me.<br \/>\n<code>prelink: \/usr\/bin\/urxvt: Cannot prelink against non-PIC shared library \/\/usr\/\/lib\/opengl\/nvidia\/lib\/libGL.so.1<\/code><br \/>\nWhy oh why is libGL.so.1 inside the shared libraries of a terminal ???<br \/>\n<!--more--><br \/>\nI decided to take a closer look to the urxvt executable.<br \/>\n<code># ldd \/usr\/bin\/urxvt<br \/>\n\tlinux-gate.so.1 =>  (0xffffe000)<br \/>\n\tlibXft.so.2 => \/usr\/lib\/libXft.so.2 (0x45df1000)<br \/>\n\tlibXrender.so.1 => \/usr\/lib\/libXrender.so.1 (0x43839000)<br \/>\n\tlibfontconfig.so.1 => \/usr\/lib\/libfontconfig.so.1 (0x45f4b000)<br \/>\n\tlibX11.so.6 => \/usr\/lib\/libX11.so.6 (0x4b995000)<br \/>\n\tlibAfterImage.so.0 => \/usr\/lib\/libAfterImage.so.0 (0x4f62d000)<br \/>\n\tlibperl.so.1 => \/usr\/lib\/libperl.so.1 (0x43a60000)<br \/>\n\tlibpthread.so.0 => \/lib\/libpthread.so.0 (0x4c408000)<br \/>\n\tlibdl.so.2 => \/lib\/libdl.so.2 (0x4c2f4000)<br \/>\n\tlibc.so.6 => \/lib\/libc.so.6 (0x4c19a000)<br \/>\n\t\/lib\/ld-linux.so.2 (0x4c17c000)<br \/>\n\tlibgcc_s.so.1 => \/usr\/lib\/gcc\/i686-pc-linux-gnu\/4.1.2\/libgcc_s.so.1 (0x4c52f000)<br \/>\n\tlibfreetype.so.6 => \/usr\/lib\/libfreetype.so.6 (0x46414000)<br \/>\n\tlibz.so.1 => \/lib\/libz.so.1 (0x4368c000)<br \/>\n\tlibexpat.so.1 => \/usr\/lib\/libexpat.so.1 (0x4c4b1000)<br \/>\n\tlibXau.so.6 => \/usr\/lib\/libXau.so.6 (0x4cda8000)<br \/>\n\tlibXdmcp.so.6 => \/usr\/lib\/libXdmcp.so.6 (0x4c401000)<br \/>\n\tlibrsvg-2.so.2 => \/usr\/lib\/librsvg-2.so.2 (0x4bb34000)<br \/>\n\tlibgdk_pixbuf-2.0.so.0 => \/usr\/lib\/libgdk_pixbuf-2.0.so.0 (0x4afc4000)<br \/>\n\tlibgobject-2.0.so.0 => \/usr\/lib\/libgobject-2.0.so.0 (0x4af3a000)<br \/>\n\tlibGL.so.1 => \/\/usr\/\/lib\/opengl\/nvidia\/lib\/libGL.so.1 (0x4bbb8000)<br \/>\n\tlibm.so.6 => \/lib\/libm.so.6 (0x4c2cc000)<br \/>\n\tlibnsl.so.1 => \/lib\/libnsl.so.1 (0x4cc4e000)<br \/>\n\tlibcrypt.so.1 => \/lib\/libcrypt.so.1 (0x4cc8c000)<br \/>\n\tlibutil.so.1 => \/lib\/libutil.so.1 (0x4cc67000)<br \/>\n\tlibgsf-1.so.114 => \/usr\/lib\/libgsf-1.so.114 (0x4baff000)<br \/>\n\tlibcroco-0.6.so.3 => \/usr\/lib\/libcroco-0.6.so.3 (0x4bac7000)<br \/>\n\tlibxml2.so.2 => \/usr\/lib\/libxml2.so.2 (0x43f9e000)<br \/>\n\tlibpangoft2-1.0.so.0 => \/usr\/lib\/libpangoft2-1.0.so.0 (0x4afde000)<br \/>\n\tlibpangocairo-1.0.so.0 => \/usr\/lib\/libpangocairo-1.0.so.0 (0x4b009000)<br \/>\n\tlibpango-1.0.so.0 => \/usr\/lib\/libpango-1.0.so.0 (0x4af85000)<br \/>\n\tlibgmodule-2.0.so.0 => \/usr\/lib\/libgmodule-2.0.so.0 (0x4af77000)<br \/>\n\tlibglib-2.0.so.0 => \/usr\/lib\/libglib-2.0.so.0 (0x4ae68000)<br \/>\n\tlibcairo.so.2 => \/usr\/lib\/libcairo.so.2 (0x475c9000)<br \/>\n\tlibpng12.so.0 => \/usr\/lib\/libpng12.so.0 (0x43750000)<br \/>\n\tlibGLcore.so.1 => \/\/usr\/\/lib\/opengl\/nvidia\/lib\/libGLcore.so.1 (0x4b1e8000)<br \/>\n\tlibnvidia-tls.so.1 => \/\/usr\/\/lib\/opengl\/nvidia\/lib\/libnvidia-tls.so.1 (0x4b991000)<br \/>\n\tlibXext.so.6 => \/usr\/lib\/libXext.so.6 (0x4ba86000)<br \/>\n\tlibbz2.so.1 => \/lib\/libbz2.so.1 (0x4db01000)<br \/>\n\tlibpixman-1.so.0 => \/usr\/lib\/libpixman-1.so.0 (0x4762f000)<br \/>\n# ldd \/usr\/bin\/urxvt | wc -l<br \/>\n40<br \/>\n<\/code><br \/>\nThat&#8217;s the time when someone can scream! <strong>40 shared libraries for jsut a terminal ??? Why why why?<\/strong><\/p>\n<p>Ok it was time to check on the dependencies of the rxvt-unicode ebuild<br \/>\n<a href=\"http:\/\/sources.gentoo.org\/viewcvs.py\/gentoo-x86\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r1.ebuild?view=markup\">From http:\/\/sources.gentoo.org\/viewcvs.py\/gentoo-x86\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r1.ebuild?view=markup<\/a><br \/>\n<code>IUSE=\"truetype perl iso14755\"<br \/>\n# see bug #115992 for modular x deps<br \/>\nRDEPEND=\"x11-libs\/libX11<br \/>\n\tx11-libs\/libXft<br \/>\n\tmedia-libs\/libafterimage<br \/>\n\tx11-libs\/libXrender<br \/>\n\tperl? ( dev-lang\/perl )\"<br \/>\nDEPEND=\"${RDEPEND}<br \/>\n\tdev-util\/pkgconfig<br \/>\n\tx11-proto\/xproto\"<br \/>\n<\/code><\/p>\n<p>Now what&#8217;s that libaferimage ?<\/p>\n<p><code># eix libafterimage<br \/>\n[I] media-libs\/libafterimage<br \/>\n     Available versions:  ~1.07 1.15 {examples gif jpeg mmx nls png tiff}<br \/>\n     Installed versions:  1.15(00:35:13 06\/22\/08)(mmx -examples -gif -jpeg -nls -png -tiff)<br \/>\n     Homepage:            http:\/\/www.afterstep.org\/afterimage\/index.php<br \/>\n     Description:         Afterstep's standalone generic image manipulation library<br \/>\n<\/code><\/p>\n<p>I don&#8217;t use any images on my terminal, so why am I not given the option not to have that dependency as a USE flag ? Without losing any more time I copied the \/usr\/portage\/x11-terms\/rxvt-unicode\/ to my \/usr\/local\/portage\/ directory, and modified the ebuild a bit:<br \/>\n<code>diff -uN \/usr\/portage\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r1.ebuild \/usr\/local\/portage\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r2.ebuild<br \/>\n--- \/usr\/portage\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r1.ebuild\t2008-05-05 23:39:36.000000000 +0300<br \/>\n+++ \/usr\/local\/portage\/x11-terms\/rxvt-unicode\/rxvt-unicode-9.02-r2.ebuild\t2008-06-22 00:55:04.000000000 +0300<br \/>\n@@ -11,18 +11,16 @@<br \/>\n LICENSE=\"GPL-2\"<br \/>\n SLOT=\"0\"<br \/>\n KEYWORDS=\"alpha amd64 hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd\"<br \/>\n-IUSE=\"truetype perl iso14755\"<br \/>\n-<br \/>\n+IUSE=\"afterimage truetype perl iso14755\"<br \/>\n # see bug #115992 for modular x deps<br \/>\n RDEPEND=\"x11-libs\/libX11<br \/>\n \tx11-libs\/libXft<br \/>\n-\tmedia-libs\/libafterimage<br \/>\n+\tafterimage? (media-libs\/libafterimage)<br \/>\n \tx11-libs\/libXrender<br \/>\n \tperl? ( dev-lang\/perl )\"<br \/>\n DEPEND=\"${RDEPEND}<br \/>\n \tdev-util\/pkgconfig<br \/>\n \tx11-proto\/xproto\"<br \/>\n-<br \/>\n src_unpack() {<br \/>\n \tunpack ${A}<br \/>\n \tcd \"${S}\"<br \/>\n@@ -35,14 +33,12 @@<br \/>\n \t\t\"s~@TIC@ \\(\\$(srcdir)\/etc\/rxvt\\)~@TIC@ -o ${D}\/${tdir} \\1~\" \\<br \/>\n \t\tdoc\/Makefile.in<br \/>\n }<br \/>\n-<br \/>\n src_compile() {<br \/>\n \tmyconf=''<br \/>\n-<br \/>\n \tuse iso14755 || myconf='--disable-iso14755'<br \/>\n-<br \/>\n \teconf \\<br \/>\n \t\t--enable-everything \\<br \/>\n+\t\t$(use_enable afterimage afterimage) \\<br \/>\n \t\t$(use_enable truetype xft) \\<br \/>\n \t\t$(use_enable perl) \\<br \/>\n \t\t--disable-text-blink \\<br \/>\n<\/code><\/p>\n<p>I re-emerged urxvt using the new ebuild from my local portage and I was shocked at the results:<br \/>\n<code># ldd \/usr\/bin\/urxvt<br \/>\n\tlinux-gate.so.1 =>  (0xffffe000)<br \/>\n\tlibXft.so.2 => \/usr\/lib\/libXft.so.2 (0x45df1000)<br \/>\n\tlibXrender.so.1 => \/usr\/lib\/libXrender.so.1 (0x43839000)<br \/>\n\tlibfontconfig.so.1 => \/usr\/lib\/libfontconfig.so.1 (0x45f4b000)<br \/>\n\tlibX11.so.6 => \/usr\/lib\/libX11.so.6 (0x4b995000)<br \/>\n\tlibperl.so.1 => \/usr\/lib\/libperl.so.1 (0x43a60000)<br \/>\n\tlibpthread.so.0 => \/lib\/libpthread.so.0 (0x4c408000)<br \/>\n\tlibdl.so.2 => \/lib\/libdl.so.2 (0x4c2f4000)<br \/>\n\tlibc.so.6 => \/lib\/libc.so.6 (0x4c19a000)<br \/>\n\t\/lib\/ld-linux.so.2 (0x4c17c000)<br \/>\n\tlibgcc_s.so.1 => \/usr\/lib\/gcc\/i686-pc-linux-gnu\/4.1.2\/libgcc_s.so.1 (0x4c52f000)<br \/>\n\tlibfreetype.so.6 => \/usr\/lib\/libfreetype.so.6 (0x46414000)<br \/>\n\tlibz.so.1 => \/lib\/libz.so.1 (0x4368c000)<br \/>\n\tlibexpat.so.1 => \/usr\/lib\/libexpat.so.1 (0x4c4b1000)<br \/>\n\tlibXau.so.6 => \/usr\/lib\/libXau.so.6 (0x4cda8000)<br \/>\n\tlibXdmcp.so.6 => \/usr\/lib\/libXdmcp.so.6 (0x4c401000)<br \/>\n\tlibnsl.so.1 => \/lib\/libnsl.so.1 (0x4cc4e000)<br \/>\n\tlibm.so.6 => \/lib\/libm.so.6 (0x4c2cc000)<br \/>\n\tlibcrypt.so.1 => \/lib\/libcrypt.so.1 (0x4cc8c000)<br \/>\n\tlibutil.so.1 => \/lib\/libutil.so.1 (0x4cc67000)<br \/>\n# ldd \/usr\/bin\/urxvt | wc -l<br \/>\n20<br \/>\n<\/code><br \/>\n<strong>100% less shared libraries!!!<\/strong><\/p>\n<p>What about memory usage ? I had not closed my 4 previously opened urxvt terms so a &#8220;ps auxww | grep urxvt&#8221; was just enough to check the differences:<br \/>\n<code>user    3594  0.0  0.8  25920 10796 ?        Ss   19:02   0:00 urxvt<br \/>\nuser    6416  0.0  0.8  26820 11564 ?        Ss   18:12   0:00 urxvt<br \/>\nuser    6519  0.1  0.9  27132 12040 ?        Ss   18:13   0:08 urxvt<br \/>\nuser   15484  0.0  0.7  25356 10332 ?        S    19:42   0:00 urxvt -fn xft:Dejavu Sans Mono:size=9:style=book -b 0 -embed 10485763 -name yeahconsole<br \/>\n<strong>user   27957  1.0  0.4   9628  5652 ?        Ss   19:50   0:00 urxvt<\/strong><\/code><\/p>\n<p>Amazing ? Almost 1\/3 VSZ and 1\/2 of RSS!! For someone who has constantly more than 4-5 terms open the benefits are more than great \ud83d\ude00<br \/>\nThis is going to be a great improvement for the next version of <a href=\"http:\/\/ilug.gr\/iloog\/\">iloog<\/a> too.<\/p>\n<p>Being more than happy with my resource savings I decided to take a look at the Gentoo bugzilla to see if someone else had the same &#8220;problem&#8221; with me. Apparently I am not the only one asking for that USE flag since there&#8217;s already an open bug. <a href=\"http:\/\/bugs.gentoo.org\/show_bug.cgi?id=221835\">http:\/\/bugs.gentoo.org\/show_bug.cgi?id=221835<\/a><\/p>\n<p>One lesson learned. When bumping into a problem with a Gentoo ebuild next time I&#8217;ll take a look at the Gentoo bugzilla before doing anything else by myself since there&#8217;s always some other crazy guy who has probably already bumped into the same bug and has already reported it. \ud83d\ude42<\/p>\n<p>*Update*<br \/>\nThe USE flag has been enabled in the latest rxvt-unicode ebuild for version 9.05. That happened just yesterday. Take a look at: <a href=\"http:\/\/bugs.gentoo.org\/show_bug.cgi?id=198944\">http:\/\/bugs.gentoo.org\/show_bug.cgi?id=198944<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, while studying I decided to manually run a prelink on my system. For no good reason. Just boredom I guess. The results were pretty interesting though. Among the output there was a line that made a very big impression to me. prelink: \/usr\/bin\/urxvt: Cannot prelink against non-PIC shared library \/\/usr\/\/lib\/opengl\/nvidia\/lib\/libGL.so.1 Why oh why is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[12,3],"tags":[],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-gentoo","category-linux"],"aioseo_notices":[],"views":11704,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":1,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":491,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions\/491"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}