summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2011-01-30 09:51:43 +0000
committerLars Wendler <polynomial-c@gentoo.org>2011-01-30 09:51:43 +0000
commitaaa23349e9c71bf1009f892de4a597e04fd2434e (patch)
treebcd81010cb41d8cd32dea3451f1be975e9ad3ca6 /net-irc
parentFix building with x11-libs/libnotify >= 0.7. (diff)
downloadgentoo-2-aaa23349e9c71bf1009f892de4a597e04fd2434e.tar.gz
gentoo-2-aaa23349e9c71bf1009f892de4a597e04fd2434e.tar.bz2
gentoo-2-aaa23349e9c71bf1009f892de4a597e04fd2434e.zip
Better patch for >=libnotify-0.7
(Portage version: 2.2.0_alpha19/cvs/Linux x86_64)
Diffstat (limited to 'net-irc')
-rw-r--r--net-irc/xchat/ChangeLog9
-rw-r--r--net-irc/xchat/files/xchat-2.8.8-libnotify07.patch61
-rw-r--r--net-irc/xchat/xchat-2.8.8-r1.ebuild3
-rw-r--r--net-irc/xchat/xchat-2.8.8-r2.ebuild104
4 files changed, 157 insertions, 20 deletions
diff --git a/net-irc/xchat/ChangeLog b/net-irc/xchat/ChangeLog
index a0cf9e287ae3..bc9968181da8 100644
--- a/net-irc/xchat/ChangeLog
+++ b/net-irc/xchat/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-irc/xchat
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/ChangeLog,v 1.293 2011/01/30 09:32:21 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/ChangeLog,v 1.294 2011/01/30 09:51:43 polynomial-c Exp $
+
+*xchat-2.8.8-r2 (30 Jan 2011)
+
+ 30 Jan 2011; Lars Wendler <polynomial-c@gentoo.org> xchat-2.8.8-r1.ebuild,
+ +xchat-2.8.8-r2.ebuild, files/xchat-2.8.8-libnotify07.patch:
+ Better patch for >=libnotify-0.7. Don't impose this to stable users yet so
+ moving this to -r2.
30 Jan 2011; Lars Wendler <polynomial-c@gentoo.org> xchat-2.8.8-r1.ebuild,
+files/xchat-2.8.8-libnotify07.patch:
diff --git a/net-irc/xchat/files/xchat-2.8.8-libnotify07.patch b/net-irc/xchat/files/xchat-2.8.8-libnotify07.patch
index 2a6dce9a268d..af80a65acec4 100644
--- a/net-irc/xchat/files/xchat-2.8.8-libnotify07.patch
+++ b/net-irc/xchat/files/xchat-2.8.8-libnotify07.patch
@@ -1,24 +1,51 @@
-diff -up xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotify07 xchat-2.8.8/src/fe-gtk/plugin-tray.c
---- xchat-2.8.8/src/fe-gtk/plugin-tray.c.libnotify07 2010-11-15 17:32:15.708325783 -0500
-+++ xchat-2.8.8/src/fe-gtk/plugin-tray.c 2010-11-15 18:05:17.322141789 -0500
-@@ -125,8 +125,9 @@ static void *nn_mod = NULL;
- /* prototypes */
- static gboolean (*nn_init) (char *);
- static void (*nn_uninit) (void);
--static void *(*nn_new_with_status_icon) (const gchar *summary, const gchar *message, const gchar *icon, GtkStatusIcon *status_icon);
--static void *(*nn_new) (const gchar *summary, const gchar *message, const gchar *icon, GtkWidget *attach);
-+/* recent versions of libnotify don't take the fourth GtkWidget argument, but passing an
-+ * extra NULL argument will be fine */
-+static void *(*nn_new) (const gchar *summary, const gchar *message, const gchar *icon, gpointer dummy);
- static gboolean (*nn_show) (void *noti, GError **error);
- static void (*nn_set_timeout) (void *noti, gint timeout);
+Port libnotify support to 0.7
+
+* Forwards/backwards-compatible, don't need a recompile when upgrading libnotify
+* Haven't tested with older libnotify, but should work fine
+* nn_new() takes the same no. of arguments because everything except the first
+ argument is optional, and the last argument passed is supposed to be NULL.
+
+---
+--- a/src/fe-gtk/plugin-tray.c
++++ b/src/fe-gtk/plugin-tray.c
+@@ -145,6 +145,7 @@
+ libnotify_notify_new (const char *title, const char *text, GtkStatusIcon *icon)
+ {
+ void *noti;
++ int libnotify_version = 0;
-@@ -160,8 +161,6 @@ libnotify_notify_new (const char *title,
- goto bad;
+ if (!nn_mod)
+ {
+@@ -152,8 +153,13 @@
+ if (!nn_mod)
+ {
+ nn_mod = g_module_open ("libnotify.so.1", G_MODULE_BIND_LAZY);
+- if (!nn_mod)
+- return FALSE;
++ if (!nn_mod) {
++ nn_mod = g_module_open ("libnotify.so.4", G_MODULE_BIND_LAZY);
++ if (!nn_mod)
++ return FALSE;
++ libnotify_version = 4;
++ }
++ libnotify_version = 1;
+ }
+
+ if (!g_module_symbol (nn_mod, "notify_init", (gpointer)&nn_init))
+@@ -161,7 +167,15 @@
if (!g_module_symbol (nn_mod, "notify_uninit", (gpointer)&nn_uninit))
goto bad;
-- if (!g_module_symbol (nn_mod, "notify_notification_new_with_status_icon", (gpointer)&nn_new_with_status_icon))
+ if (!g_module_symbol (nn_mod, "notify_notification_new_with_status_icon", (gpointer)&nn_new_with_status_icon))
- goto bad;
++ if (libnotify_version == 1)
++ /* We know we're using API version 1, but something is wrong */
++ goto bad;
++ else
++ /* It's probably API version 4, aka libnotify-0.7 */
++ libnotify_version = 4;
++ else
++ /* Only this API version has notify_notification_new_with_status_icon */
++ libnotify_version = 1;
if (!g_module_symbol (nn_mod, "notify_notification_new", (gpointer)&nn_new))
goto bad;
if (!g_module_symbol (nn_mod, "notify_notification_show", (gpointer)&nn_show))
diff --git a/net-irc/xchat/xchat-2.8.8-r1.ebuild b/net-irc/xchat/xchat-2.8.8-r1.ebuild
index 903caf72c62e..11b82dbd8cbd 100644
--- a/net-irc/xchat/xchat-2.8.8-r1.ebuild
+++ b/net-irc/xchat/xchat-2.8.8-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-2.8.8-r1.ebuild,v 1.4 2011/01/30 09:32:21 polynomial-c Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-2.8.8-r1.ebuild,v 1.5 2011/01/30 09:51:43 polynomial-c Exp $
EAPI=2
@@ -43,7 +43,6 @@ pkg_setup() {
src_prepare() {
epatch "${FILESDIR}"/${PN}-input-box4.patch
- epatch "${FILESDIR}"/${P}-libnotify07.patch
use xchatdccserver && epatch "${DISTDIR}"/xchat-dccserver-0.6.patch.bz2
diff --git a/net-irc/xchat/xchat-2.8.8-r2.ebuild b/net-irc/xchat/xchat-2.8.8-r2.ebuild
new file mode 100644
index 000000000000..8d205eab5cc6
--- /dev/null
+++ b/net-irc/xchat/xchat-2.8.8-r2.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-2.8.8-r2.ebuild,v 1.1 2011/01/30 09:51:43 polynomial-c Exp $
+
+EAPI=2
+
+inherit eutils versionator gnome2 autotools
+
+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 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="dbus fastscroll +gtk ipv6 libnotify mmx nls ntlm perl python spell ssl tcl xchatdccserver"
+
+RDEPEND=">=dev-libs/glib-2.6.0
+ gtk? ( >=x11-libs/gtk+-2.10.0 )
+ ssl? ( >=dev-libs/openssl-0.9.6d )
+ perl? ( >=dev-lang/perl-5.8.0 )
+ 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 )
+ ntlm? ( net-libs/libntlm )
+ x11-libs/pango
+ !<net-irc/xchat-gnome-0.9"
+
+DEPEND="${RDEPEND}
+ >=dev-util/pkgconfig-0.16
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ # Added for to fix a sparc seg fault issue by Jason Wever <weeve@gentoo.org>
+ if [[ ${ARCH} = sparc ]] ; then
+ replace-flags "-O[3-9]" "-O2"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-input-box4.patch
+ epatch "${FILESDIR}"/${P}-libnotify07.patch
+
+ use xchatdccserver && epatch "${DISTDIR}"/xchat-dccserver-0.6.patch.bz2
+
+ # use libdir/xchat/plugins as the plugin directory
+ if [ $(get_libdir) != "lib" ] ; then
+ sed -i -e 's:${prefix}/lib/xchat:${libdir}/xchat:' \
+ "${S}"/configure.in || die
+ fi
+
+ # xchat sourcecode ships with po/Makefile.in.in from gettext-0.17
+ # which fails with >=gettext-0.18
+ cp /usr/share/gettext/po/Makefile.in.in "${S}"/po/ || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # xchat's configure script uses sys.path to find library path
+ # instead of python-config (#25943)
+ unset PYTHONPATH
+
+ econf \
+ --enable-shm \
+ $(use_enable dbus) \
+ $(use_enable ipv6) \
+ $(use_enable mmx) \
+ $(use_enable nls) \
+ $(use_enable ntlm) \
+ $(use_enable perl) \
+ $(use_enable python) \
+ $(use_enable spell spell gtkspell) \
+ $(use_enable ssl openssl) \
+ $(use_enable tcl) \
+ $(use_enable gtk gtkfe) \
+ $(use_enable fastscroll xft)
+}
+
+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
+}