# ChangeLog for app-admin/conky
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/ChangeLog,v 1.168 2011/10/28 17:25:21 billie Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/ChangeLog,v 1.169 2011/11/16 19:50:34 billie Exp $
+
+*conky-1.8.1-r5 (16 Nov 2011)
+
+ 16 Nov 2011; Daniel Pielmeier <billie@gentoo.org> +conky-1.8.1-r5.ebuild,
+ +files/conky-1.8.1-utf8-scroll.patch:
+ Fix scroll variable for utf8. This fixes bug #390215. Thanks to Amadeusz
+ Żołnowski for the report and the patch.
*conky-1.8.1-r4 (28 Oct 2011)
AUX conky-1.8.1-maxinterfaces.patch 1605 RMD160 f4b6f51cd2ab6172f6aac9982eccc02c5c0d4f0b SHA1 9b9282e1f3866e9b1c6c7a379c67450f360375cc SHA256 34f1e53fb145fb252e1f91bcd60803870f12e4e0b31d691accc4cd83dda970ad
AUX conky-1.8.1-nvidia-x.patch 883 RMD160 f6e85e117ba5b895ba23db0d6e4160a0c0141c21 SHA1 1e3dc3f2a8e44d62e25ab2ab22726e0e91ecf666 SHA256 290ffdf4094167715bf11b86ee2cf73574a3af32ffb50fa09517d89c56bc0853
AUX conky-1.8.1-secunia-SA43225.patch 1620 RMD160 3206a288819bc33048d9eee2444308b04b25fc1b SHA1 7c88144711911a6b38465311c7cf8cf6b0e6d45f SHA256 61c2d204796f51d0d51cd62e9a37a9f4f318e8fe8f955278ef86b64d5b2ff99f
+AUX conky-1.8.1-utf8-scroll.patch 2814 RMD160 edd1436b440f80717cfb85ca69b8bd6942cd0f9f SHA1 630f8e85eb22f9348e04b5dfefb2984c5d723f7d SHA256 ee622cda243c7265915c858b264fc4750a329f5c7e9a29323421a777291acfb7
AUX conky-1.8.1-xmms2.patch 1190 RMD160 6ec093e08f55c198b5b2321acc7f3d1d7f74e267 SHA1 0e05fe363521145bde14eca99d3aebc28e258833 SHA256 1b64047f04239dbf24b3171fcd8d5c950e9f8aa6af5e94cd4836cd14c70e2bdc
DIST conky-1.8.1.tar.bz2 612481 RMD160 f3203131e2d8f3756eb29f5c5a9034b9c269fdc6 SHA1 9581419b1a53a8a7e37b0291cd4e55ab166d221a SHA256 f85a278f2869596b1fd68b6d26d58c93af8dcc39d5186bbcfd587d4c545e5e43
EBUILD conky-1.8.1-r4.ebuild 4080 RMD160 604af025c5392aa76a138578c3835b6d497ff547 SHA1 e87f7f6a5d6e7b41be0e21e93f8e0af904226cf9 SHA256 d731a91fb3fdf989cb9d952d61757177f5271bd4d0338df01adc6464f1b6e355
-MISC ChangeLog 25935 RMD160 7998ed7cb854b5c200cfe0ac78ddf1d74b9e0928 SHA1 fb803addb6069a3752a2b6f914310ea8f4efb49a SHA256 1024c37e24d60b779eee5c6b928f6db81ac07e5f4b5773fae49de733de6ab397
+EBUILD conky-1.8.1-r5.ebuild 4127 RMD160 af8c81106b934a3342138d24440fb2691c647dfb SHA1 2d2f9c94c3686aee4ad3f820ea82766268415517 SHA256 809b370b8404692adbc503c993cfc5c02d2197a197dd8f45a1ee9b343dbe5b7c
+MISC ChangeLog 26202 RMD160 f77850ad0f37a54f88653061900706a9a7f43e88 SHA1 69323b469dd61b4552018f21e799434862aa337c SHA256 8e15706014ca4fa7f140c60fbdf85b4c74c4af44490bba50f1e1f316507c7aea
MISC metadata.xml 2035 RMD160 c4c5aca3e9d74df22ceec820eab9b1f25798cdb0 SHA1 791f5991269e7d531c11c3f9eeb784607a3730b0 SHA256 7629c0d86a74d086f1b9934919881b5ee82c285e94d58d4a802694633ea11302
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEAREIAAYFAk6q5ZAACgkQlcuUeyFa0U2c9wCeO1ZiolpZPL5zNGfRdY9R+tOo
-xdgAoIIe80wvQ+7oPnifjY4Blo6pqsAz
-=g3Wb
+iEYEAREIAAYFAk7EFA8ACgkQlcuUeyFa0U1iEwCfYaw5TpFPwDcHXnDs7e8pQlJ8
+QH0AoJpzuQnii8A3aSkB2kqOQ/VYwGKq
+=Apd4
-----END PGP SIGNATURE-----
--- /dev/null
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.8.1-r5.ebuild,v 1.1 2011/11/16 19:50:34 billie Exp $
+
+EAPI=2
+
+inherit autotools eutils
+
+DESCRIPTION="An advanced, highly configurable system monitor for X"
+HOMEPAGE="http://conky.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3 BSD LGPL-2.1 MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="apcupsd audacious curl debug eve hddtemp imlib iostats lua lua-cairo lua-imlib math moc mpd nano-syntax ncurses nvidia +portmon rss thinkpad truetype vim-syntax weather-metar weather-xoap wifi X xmms2"
+
+DEPEND_COMMON="
+ X? (
+ imlib? ( media-libs/imlib2 )
+ lua-cairo? ( >=dev-lua/toluapp-1.0.93 x11-libs/cairo[X] )
+ lua-imlib? ( >=dev-lua/toluapp-1.0.93 media-libs/imlib2 )
+ nvidia? ( media-video/nvidia-settings )
+ truetype? ( x11-libs/libXft >=media-libs/freetype-2 )
+ x11-libs/libX11
+ x11-libs/libXdamage
+ x11-libs/libXext
+ audacious? ( >=media-sound/audacious-1.5 dev-libs/glib )
+ xmms2? ( media-sound/xmms2 )
+ )
+ curl? ( net-misc/curl )
+ eve? ( net-misc/curl dev-libs/libxml2 )
+ portmon? ( dev-libs/glib )
+ lua? ( >=dev-lang/lua-5.1 )
+ ncurses? ( sys-libs/ncurses )
+ rss? ( dev-libs/libxml2 net-misc/curl dev-libs/glib )
+ wifi? ( net-wireless/wireless-tools )
+ weather-metar? ( net-misc/curl )
+ weather-xoap? ( dev-libs/libxml2 net-misc/curl )
+ virtual/libiconv
+ "
+RDEPEND="
+ ${DEPEND_COMMON}
+ apcupsd? ( sys-power/apcupsd )
+ hddtemp? ( app-admin/hddtemp )
+ moc? ( media-sound/moc )
+ nano-syntax? ( app-editors/nano )
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+ "
+DEPEND="
+ ${DEPEND_COMMON}
+ dev-util/pkgconfig
+ "
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-nvidia-x.patch" \
+ "${FILESDIR}/${P}-xmms2.patch" \
+ "${FILESDIR}/${P}-secunia-SA43225.patch" \
+ "${FILESDIR}/${P}-acpitemp.patch" \
+ "${FILESDIR}/${P}-curl-headers.patch" \
+ "${FILESDIR}/${P}-maxinterfaces.patch" \
+ "${FILESDIR}/${P}-utf8-scroll.patch"
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use X; then
+ myconf="--enable-x11 --enable-double-buffer --enable-xdamage"
+ myconf="${myconf} --enable-argb --enable-own-window"
+ myconf="${myconf} $(use_enable imlib imlib2) $(use_enable lua-cairo)"
+ myconf="${myconf} $(use_enable lua-imlib lua-imlib2)"
+ myconf="${myconf} $(use_enable nvidia) $(use_enable truetype xft)"
+ myconf="${myconf} $(use_enable audacious) $(use_enable xmms2)"
+ else
+ myconf="--disable-x11 --disable-own-window --disable-argb"
+ myconf="${myconf} --disable-lua-cairo --disable-nvidia --disable-xft"
+ myconf="${myconf} --disable-audacious --disable-xmms2"
+ fi
+
+ econf \
+ ${myconf} \
+ $(use_enable apcupsd) \
+ $(use_enable curl) \
+ $(use_enable debug) \
+ $(use_enable eve) \
+ $(use_enable hddtemp) \
+ $(use_enable iostats) \
+ $(use_enable lua) \
+ $(use_enable thinkpad ibm) \
+ $(use_enable math) \
+ $(use_enable moc) \
+ $(use_enable mpd) \
+ $(use_enable ncurses) \
+ $(use_enable portmon) \
+ $(use_enable rss) \
+ $(use_enable weather-metar) \
+ $(use_enable weather-xoap) \
+ $(use_enable wifi wlan)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc ChangeLog AUTHORS TODO || die
+ dohtml doc/docs.html doc/config_settings.html doc/variables.html || die
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles/ftdetect
+ doins "${S}"/extras/vim/ftdetect/conkyrc.vim || die
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins "${S}"/extras/vim/syntax/conkyrc.vim || die
+ fi
+
+ if use nano-syntax; then
+ insinto /usr/share/nano/
+ doins "${S}"/extras/nano/conky.nanorc || die
+ fi
+}
+
+pkg_postinst() {
+ elog "You can find a sample configuration file at ${ROOT%/}/etc/conky/conky.conf."
+ elog "To customize, copy it to ~/.conkyrc and edit it to your liking."
+ elog
+ elog "For more info on Conky's features please look at the Changelog in"
+ elog "${ROOT%/}/usr/share/doc/${PF}. There are also pretty html docs available"
+ elog "on Conky's site or in ${ROOT%/}/usr/share/doc/${PF}/html."
+ elog
+ elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
+ elog
+}
--- /dev/null
+From b1f6a30bcce020b3c377434137de9856a09b899a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
+Date: Fri, 11 Nov 2011 11:27:43 +0100
+Subject: [PATCH] Make scroll UTF-8 aware. Fixes bug #3134941.
+
+---
+ src/scroll.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 42 insertions(+), 2 deletions(-)
+
+diff --git a/src/scroll.c b/src/scroll.c
+index f78f807..738db0d 100644
+--- a/src/scroll.c
++++ b/src/scroll.c
+@@ -34,12 +34,33 @@
+
+ struct scroll_data {
+ char *text;
++ unsigned int show_orig;
+ unsigned int show;
+ unsigned int step;
+ unsigned int start;
+ long resetcolor;
+ };
+
++int utf8_charlen(char c) {
++ unsigned char uc = (unsigned char) c;
++ int len = 0;
++
++ if ((uc & 0x80) == 0)
++ return 1;
++
++ while ((uc & 0x80) != 0) {
++ ++len;
++ uc <<= 1;
++ }
++
++ return (len > 0 && len <= 4) ? len : -1;
++}
++
++int is_utf8_char_tail(char c) {
++ unsigned char uc = (unsigned char) c;
++ return (uc & 0xc0) == 0x80;
++}
++
+ void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_crash)
+ {
+ struct scroll_data *sd;
+@@ -60,15 +81,18 @@ void parse_scroll_arg(struct text_object *obj, const char *arg, void *free_at_cr
+ sd->step = 1;
+ }
+ sd->text = malloc(strlen(arg + n1) + sd->show + 1);
++ // sd->show value may change when there are UTF-8 chars to be shown, so
++ // save its origin value
++ sd->show_orig = sd->show;
+
+ if (strlen(arg) > sd->show) {
+ for(n2 = 0; (unsigned int) n2 < sd->show; n2++) {
+- sd->text[n2] = ' ';
++ sd->text[n2] = ' ';
+ }
+ sd->text[n2] = 0;
+ }
+ else
+- sd->text[0] = 0;
++ sd->text[0] = 0;
+
+ strcat(sd->text, arg + n1);
+ sd->start = 0;
+@@ -82,9 +106,13 @@ void print_scroll(struct text_object *obj, char *p, int p_max_size, struct infor
+ {
+ struct scroll_data *sd = obj->data.opaque;
+ unsigned int j, colorchanges = 0, frontcolorchanges = 0, visibcolorchanges = 0, strend;
++ int charlen = 0;
++ unsigned int utf8lenfix = 0;
+ char *pwithcolors;
+ char buf[max_user_text];
+
++ sd->show = sd->show_orig;
++
+ if (!sd)
+ return;
+
+@@ -109,6 +137,18 @@ void print_scroll(struct text_object *obj, char *p, int p_max_size, struct infor
+ while(*(buf + sd->start) == SPECIAL_CHAR) {
+ sd->start++;
+ }
++ //skip parts of UTF-8 character which messes up display
++ while(is_utf8_char_tail(*(buf + sd->start))) {
++ sd->start++;
++ }
++ //extend length to be shown for wide characters
++ j = 0;
++ while(j < sd->show + visibcolorchanges + utf8lenfix) {
++ charlen = utf8_charlen(*(buf + sd->start + j));
++ utf8lenfix += (charlen > 1 ? charlen - 1 : 0);
++ j += charlen;
++ }
++ sd->show = sd->show_orig + utf8lenfix;
+ //place all chars that should be visible in p, including colorchanges
+ for(j=0; j < sd->show + visibcolorchanges; j++) {
+ p[j] = *(buf + sd->start + j);
+--
+1.7.8.rc1
+