Add ebuild for net-irc/xchat-2.8.8.
[overlay.git] / net-irc / xchat / xchat-2.8.8.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-2.8.8.ebuild,v 1.1 2010/06/01 08:13:55 polynomial-c Exp $
4
5 EAPI=2
6
7 inherit eutils versionator gnome2 autotools
8
9 DESCRIPTION="Graphical IRC client"
10 SRC_URI="http://www.xchat.org/files/source/$(get_version_component_range 1-2)/${P}.tar.bz2
11         mirror://sourceforge/${PN}/${P}.tar.bz2
12         xchatdccserver? ( mirror://gentoo/${PN}-dccserver-0.6.patch.bz2 )"
13 HOMEPAGE="http://www.xchat.org/"
14
15 LICENSE="GPL-2"
16 SLOT="2"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
18 IUSE="dbus ipv6 libnotify mmx nls ntlm perl python spell ssl tcl xchatnogtk xchatdccserver xft"
19
20 RDEPEND=">=dev-libs/glib-2.6.0
21         !xchatnogtk? ( >=x11-libs/gtk+-2.10.0 )
22         ssl? ( >=dev-libs/openssl-0.9.6d )
23         perl? ( >=dev-lang/perl-5.8.0 )
24         python? ( >=dev-lang/python-2.2 )
25         tcl? ( dev-lang/tcl )
26         dbus? ( >=dev-libs/dbus-glib-0.71 )
27         spell? ( app-text/gtkspell )
28         libnotify? ( x11-libs/libnotify )
29         ntlm? ( net-libs/libntlm )
30         !<net-irc/xchat-gnome-0.9"
31
32 DEPEND="${RDEPEND}
33         >=dev-util/pkgconfig-0.16
34         nls? ( sys-devel/gettext )"
35
36 pkg_setup() {
37         # Added for to fix a sparc seg fault issue by Jason Wever <weeve@gentoo.org>
38         if [[ ${ARCH} = sparc ]] ; then
39                 replace-flags "-O[3-9]" "-O2"
40         fi
41 }
42
43 src_prepare() {
44         use xchatdccserver && epatch "${DISTDIR}"/xchat-dccserver-0.6.patch.bz2
45
46         # use libdir/xchat/plugins as the plugin directory
47         if [ $(get_libdir) != "lib" ] ; then
48                 sed -i -e 's:${prefix}/lib/xchat:${libdir}/xchat:' \
49                         "${S}"/configure.in || die
50         fi
51
52         epatch "${FILESDIR}"/xchat-2.8.6-nickcompletion_without_space.diff
53
54         # xchat sourcecode ships with po/Makefile.in.in from gettext-0.17
55         # which fails with >=gettext-0.18
56         cp /usr/share/gettext/po/Makefile.in.in "${S}"/po/ || die
57
58         eautoreconf
59 }
60
61 src_configure() {
62         # xchat's configure script uses sys.path to find library path
63         # instead of python-config (#25943)
64         unset PYTHONPATH
65
66         econf \
67                 --enable-shm \
68                 $(use_enable dbus) \
69                 $(use_enable ipv6) \
70                 $(use_enable mmx) \
71                 $(use_enable nls) \
72                 $(use_enable ntlm) \
73                 $(use_enable perl) \
74                 $(use_enable python) \
75                 $(use_enable spell spell gtkspell) \
76                 $(use_enable ssl openssl) \
77                 $(use_enable tcl) \
78                 $(use_enable !xchatnogtk gtkfe) \
79                 $(use_enable xft)
80 }
81
82 src_install() {
83         USE_DESTDIR=1 gnome2_src_install || die "make install failed"
84
85         # install plugin development header
86         insinto /usr/include/xchat
87         doins src/common/xchat-plugin.h || die "doins failed"
88
89         dodoc ChangeLog README* || die "dodoc failed"
90 }
91
92 pkg_postinst() {
93         elog
94         elog "XChat binary has been renamed from xchat-2 to xchat."
95         elog
96
97         if has_version net-irc/xchat-systray
98         then
99                 elog "XChat now includes it's own systray icon, you may want to remove net-irc/xchat-systray."
100                 elog
101         fi
102 }