From 510d1349eaf5638193f1e85adb91c38621f801ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 1 Jul 2010 11:04:49 +0200 Subject: [PATCH] Add patch for xchat that removes the space after nick-completed nicknames. --- net-irc/xchat/Manifest | 6 ++ net-irc/xchat/files/xc286-smallfixes.diff | 68 +++++++++++++ .../xchat-2.8.6-nickcompletion_without_space.diff | 10 ++ net-irc/xchat/files/xchat-2.8.6-shm-pixmaps.patch | 106 +++++++++++++++++++++ net-irc/xchat/xchat-2.8.6-r2.ebuild | 101 ++++++++++++++++++++ 5 files changed, 291 insertions(+) create mode 100644 net-irc/xchat/Manifest create mode 100644 net-irc/xchat/files/xc286-smallfixes.diff create mode 100644 net-irc/xchat/files/xchat-2.8.6-nickcompletion_without_space.diff create mode 100644 net-irc/xchat/files/xchat-2.8.6-shm-pixmaps.patch create mode 100644 net-irc/xchat/xchat-2.8.6-r2.ebuild diff --git a/net-irc/xchat/Manifest b/net-irc/xchat/Manifest new file mode 100644 index 0000000..89e3b2f --- /dev/null +++ b/net-irc/xchat/Manifest @@ -0,0 +1,6 @@ +AUX xc286-smallfixes.diff 2020 RMD160 91c654320b7b1f9d6b13f7b226fb4cec26054319 SHA1 b13eb421f6d72fca195b398c606d9413aec57fc4 SHA256 08c31e4d8d792f101047362cb25c529389c9fa254e2139a678491ee4e1fe58ff +AUX xchat-2.8.6-nickcompletion_without_space.diff 460 RMD160 ad9b22c1177aecd9f305c3f0422a4b2963347086 SHA1 c1c6a1355f49a1a71aa9b0e82479e8ffe314bb53 SHA256 1a683f11530d27ddc848571bd2697ea4c1865d05887292469ae9a8dc7fc74aaf +AUX xchat-2.8.6-shm-pixmaps.patch 2711 RMD160 0052d6981752d19cf4876180f00a57b4c503f0c8 SHA1 3731d5c7ac04f053da923406fc73df37ff7802df SHA256 984174ea711fbb7b2d7817e838fb5ad54f4c414ca5f6004994f15bf790279060 +DIST xchat-2.8.6.tar.bz2 1423645 RMD160 bc199e3b58a9db3dfd9f2af6bac7fb6162c53d6e SHA1 7a7463e65cb26c680ed70dd96cec98bcc05435a4 SHA256 8c89dbf36304b99363a7f090d695447653102b4528ca2aa367a2abe5cff1746d +DIST xchat-dccserver-0.6.patch.bz2 49320 RMD160 24cc9bd414b1dd0e7e38ba9a49d12257aeb89e68 SHA1 e7b8b58cf7f647ff8778c7542cd46e9b22987385 SHA256 90a49a8d810380020c507c1a36f02e7d972cf92b5e4802dcd5cc518cba29078f +EBUILD xchat-2.8.6-r2.ebuild 2877 RMD160 4951636387c986afab13f20ce09163e9ea14805d SHA1 c169a5ec5b412726d535f41e8f456f4b313c3ca8 SHA256 5983d7727d415068b13d97dc603a7d38d0ec849fa49839fe7fe452823f58a5a0 diff --git a/net-irc/xchat/files/xc286-smallfixes.diff b/net-irc/xchat/files/xc286-smallfixes.diff new file mode 100644 index 0000000..da90015 --- /dev/null +++ b/net-irc/xchat/files/xc286-smallfixes.diff @@ -0,0 +1,68 @@ +# +# Various small fixes from CVS that are considered safe to apply to 2.8.6. +# +--- xchat-2.8.6/src/common/cfgfiles.c 2008-02-05 21:02:47.000000000 +1100 ++++ xchat-2.8.6p1/src/common/cfgfiles.c 2008-06-15 13:45:43.000000000 +1000 +@@ -886,7 +886,6 @@ + set_showval (session *sess, const struct prefs *var, char *tbuf) + { + int len, dots, j; +- static const char *offon[] = { "OFF", "ON" }; + + len = strlen (var->name); + memcpy (tbuf, var->name, len); +@@ -909,8 +908,10 @@ + *((int *) &prefs + var->offset)); + break; + case TYPE_BOOL: +- sprintf (tbuf + len, "\0033:\017 %s\n", offon[ +- *((int *) &prefs + var->offset)]); ++ if (*((int *) &prefs + var->offset)) ++ sprintf (tbuf + len, "\0033:\017 %s\n", "ON"); ++ else ++ sprintf (tbuf + len, "\0033:\017 %s\n", "OFF"); + break; + } + PrintText (sess, tbuf); +--- xchat-2.8.6/src/common/chanopt.c 2008-06-10 22:00:55.000000000 +1000 ++++ xchat-2.8.6p1/src/common/chanopt.c 2008-06-15 13:48:04.000000000 +1000 +@@ -32,7 +32,7 @@ + + #define S_F(xx) STRUCT_OFFSET_STR(struct session,xx) + +-channel_options chanopt[] = ++static const channel_options chanopt[] = + { + {"alert_beep", "BEEP", S_F(alert_beep)}, + {"alert_taskbar", NULL, S_F(alert_taskbar)}, +--- xchat-2.8.6/src/common/servlist.c 2008-04-01 19:22:34.000000000 +1100 ++++ xchat-2.8.6p1/src/common/servlist.c 2008-06-15 13:57:41.000000000 +1000 +@@ -509,6 +509,8 @@ + list = g_slist_nth (net->servlist, net->selected); + if (!list) + list = net->servlist; ++ if (!list) ++ return; + ircserv = list->data; + + /* incase a protocol switch is added to the servlist gui */ +--- xchat-2.8.6/src/common/text.c 2008-03-28 13:20:04.000000000 +1100 ++++ xchat-2.8.6p1/src/common/text.c 2008-06-15 13:59:59.000000000 +1000 +@@ -216,7 +216,7 @@ + static void + scrollback_save (session *sess, char *text) + { +- char buf[1024]; ++ char buf[512 * 4]; + time_t stamp; + int len; + +@@ -266,7 +266,7 @@ + scrollback_load (session *sess) + { + int fh; +- char buf[1024]; ++ char buf[512 * 4]; + char *text; + time_t stamp; + int lines; diff --git a/net-irc/xchat/files/xchat-2.8.6-nickcompletion_without_space.diff b/net-irc/xchat/files/xchat-2.8.6-nickcompletion_without_space.diff new file mode 100644 index 0000000..d050ac5 --- /dev/null +++ b/net-irc/xchat/files/xchat-2.8.6-nickcompletion_without_space.diff @@ -0,0 +1,10 @@ +--- xchat-2.8.6-orig/src/fe-gtk/fkeys.c 2010-07-01 10:41:26.000000000 +0200 ++++ xchat-2.8.6/src/fe-gtk/fkeys.c 2010-07-01 10:54:22.000000000 +0200 +@@ -1661,7 +1661,6 @@ + strncat (buf, result, COMP_BUF - (prefix_len + 3)); /* make sure nicksuffix and space fits */ + if(!prefix_len && is_nick) + strcat (buf, &prefs.nick_suffix[0]); +- strcat (buf, " "); + cursor_pos = strlen (buf); + if (postfix) + strncat (buf, postfix, COMP_BUF - cursor_pos - 2); diff --git a/net-irc/xchat/files/xchat-2.8.6-shm-pixmaps.patch b/net-irc/xchat/files/xchat-2.8.6-shm-pixmaps.patch new file mode 100644 index 0000000..68f7fbe --- /dev/null +++ b/net-irc/xchat/files/xchat-2.8.6-shm-pixmaps.patch @@ -0,0 +1,106 @@ +diff -ruN xchat-2.8.6.orig/src/fe-gtk/xtext.c xchat-2.8.6/src/fe-gtk/xtext.c +--- xchat-2.8.6.orig/src/fe-gtk/xtext.c 2008-02-24 06:04:30.000000000 +0100 ++++ xchat-2.8.6/src/fe-gtk/xtext.c 2008-10-14 11:04:57.000000000 +0200 +@@ -1350,6 +1350,22 @@ + } + } + ++#ifdef USE_SHM ++static int ++have_shm_pixmaps(Display *dpy) ++{ ++ static int checked = 0, major, minor; ++ static Bool have = FALSE; ++ ++ if (!checked) { ++ XShmQueryVersion(dpy, &major, &minor, &have); ++ checked = 1; ++ } ++ ++ return have; ++} ++#endif ++ + static void + gtk_xtext_paint (GtkWidget *widget, GdkRectangle *area) + { +@@ -1366,8 +1382,12 @@ + { + xtext->last_win_x = x; + xtext->last_win_y = y; +-#if !defined(USE_SHM) && !defined(WIN32) ++#ifndef WIN32 ++#ifdef USE_SHM ++ if (xtext->shaded && !have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf))) ++#else + if (xtext->shaded) ++#endif + { + xtext->recycle = TRUE; + gtk_xtext_load_trans (xtext); +@@ -3559,6 +3579,11 @@ + GC tgc; + Display *xdisplay = GDK_WINDOW_XDISPLAY (xtext->draw_buf); + ++#ifdef USE_SHM ++ int shm_pixmaps; ++ shm_pixmaps = have_shm_pixmaps(xdisplay); ++#endif ++ + XGetGeometry (xdisplay, p, &root, &dummy, &dummy, &width, &height, + &dummy, &depth); + +@@ -3576,18 +3601,20 @@ + XFreeGC (xdisplay, tgc); + + #ifdef USE_SHM +- ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp); +-#else +- ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap); ++ if (shm_pixmaps) ++ ximg = get_image (xtext, xdisplay, &xtext->shminfo, 0, 0, w, h, depth, tmp); ++ else + #endif ++ ximg = XGetImage (xdisplay, tmp, 0, 0, w, h, -1, ZPixmap); + XFreePixmap (xdisplay, tmp); + } else + { + #ifdef USE_SHM +- ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p); +-#else +- ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap); ++ if (shm_pixmaps) ++ ximg = get_image (xtext, xdisplay, &xtext->shminfo, x, y, w, h, depth, p); ++ else + #endif ++ ximg = XGetImage (xdisplay, p, x, y, w, h, -1, ZPixmap); + } + + if (!ximg) +@@ -3612,7 +3639,7 @@ + else + { + #ifdef USE_SHM +- if (xtext->shm) ++ if (xtext->shm && shm_pixmaps) + { + #if (GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION == 0) + shaded_pix = gdk_pixmap_foreign_new ( +@@ -3630,7 +3657,7 @@ + } + + #ifdef USE_SHM +- if (!xtext->shm) ++ if (!xtext->shm || !shm_pixmaps) + #endif + XPutImage (xdisplay, GDK_WINDOW_XWINDOW (shaded_pix), + GDK_GC_XGC (xtext->fgc), ximg, 0, 0, 0, 0, w, h); +@@ -3650,7 +3677,7 @@ + if (xtext->pixmap) + { + #ifdef USE_SHM +- if (xtext->shm) ++ if (xtext->shm && have_shm_pixmaps(GDK_WINDOW_XDISPLAY (xtext->draw_buf))) + { + XFreePixmap (GDK_WINDOW_XDISPLAY (xtext->pixmap), + GDK_WINDOW_XWINDOW (xtext->pixmap)); diff --git a/net-irc/xchat/xchat-2.8.6-r2.ebuild b/net-irc/xchat/xchat-2.8.6-r2.ebuild new file mode 100644 index 0000000..2d81862 --- /dev/null +++ b/net-irc/xchat/xchat-2.8.6-r2.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-2.8.6-r2.ebuild,v 1.3 2009/09/07 13:36:02 armin76 Exp $ + +inherit eutils versionator gnome2 + +DESCRIPTION="Graphical IRC client" +SRC_URI="http://www.xchat.org/files/source/$(get_version_component_range 1-2)/${P}.tar.bz2 + mirror://sourceforge/${PN}/${P}.tar.bz2 + xchatdccserver? ( mirror://gentoo/${PN}-dccserver-0.6.patch.bz2 )" +HOMEPAGE="http://www.xchat.org/" + +LICENSE="GPL-2" +SLOT="2" +KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="perl dbus tcl python ssl mmx ipv6 libnotify nls spell xchatnogtk xchatdccserver xft" + +RDEPEND=">=dev-libs/glib-2.6.0 + !xchatnogtk? ( >=x11-libs/gtk+-2.10.0 ) + ssl? ( >=dev-libs/openssl-0.9.6d ) + perl? ( >=dev-lang/perl-5.6.1 ) + python? ( >=dev-lang/python-2.2 ) + tcl? ( dev-lang/tcl ) + dbus? ( >=dev-libs/dbus-glib-0.71 ) + spell? ( app-text/gtkspell ) + libnotify? ( x11-libs/libnotify ) + ! + if [[ ${ARCH} = sparc ]] ; then + replace-flags "-O[3-9]" "-O2" + fi + + # xchat's configure script uses sys.path to find library path + # instead of python-config (#25943) + unset PYTHONPATH + + econf \ + --enable-shm \ + $(use_enable ssl openssl) \ + $(use_enable perl) \ + $(use_enable python) \ + $(use_enable tcl) \ + $(use_enable mmx) \ + $(use_enable ipv6) \ + $(use_enable nls) \ + $(use_enable dbus) \ + $(use_enable xft) \ + $(use_enable spell spell gtkspell) \ + $(use_enable !xchatnogtk gtkfe) \ + || die "econf failed" + + emake || die "emake failed" +} + +src_install() { + USE_DESTDIR=1 gnome2_src_install || die "make install failed" + + # install plugin development header + insinto /usr/include/xchat + doins src/common/xchat-plugin.h || die "doins failed" + + dodoc ChangeLog README* || die "dodoc failed" +} + +pkg_postinst() { + elog + elog "XChat binary has been renamed from xchat-2 to xchat." + elog + + if has_version net-irc/xchat-systray + then + elog "XChat now includes it's own systray icon, you may want to remove net-irc/xchat-systray." + elog + fi +} -- 2.7.4