1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 GENTOO_DEPEND_ON_PERL=no
7 PYTHON_COMPAT=( python2_7 )
9 inherit autotools flag-o-matic gnome2 toolchain-funcs multilib perl-module python-single-r1 xdg-utils
11 DESCRIPTION="GTK Instant Messenger client"
12 HOMEPAGE="http://pidgin.im/"
14 mirror://sourceforge/${PN}/${P}.tar.bz2
15 https://dev.gentoo.org/~polynomial-c/${PN}-eds-3.6.patch.bz2
16 https://gist.githubusercontent.com/imcleod/77f38d11af11b2413ada/raw/46e9d6cb4d2f839832dad2d697bb141a88028e04/pidgin-irc-join-sleep.patch -> ${PN}-2.10.9-irc_join_sleep.patch"
19 SLOT="0/2" # libpurple version
20 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-macos"
21 IUSE="dbus debug doc eds gadu gnutls +gstreamer +gtk idn meanwhile pie"
22 IUSE+=" networkmanager nls perl tcl tk spell sasl ncurses"
23 IUSE+=" groupwise prediction python +xscreensaver zephyr zeroconf" # mono"
26 # dbus requires python to generate C code for dbus bindings (thus DEPEND only).
27 # finch uses libgnt that links with libpython - {R,}DEPEND. But still there is
28 # no way to build dbus and avoid libgnt linkage with python. If you want this
29 # send patch upstream.
30 # purple-url-handler and purple-remote require dbus-python thus in reality we
31 # rdepend on python if dbus enabled. But it is possible to separate this dep.
34 >=dev-libs/libxml2-2.6.18
36 sys-libs/ncurses:0=[unicode]
37 dbus? ( ${PYTHON_DEPS} )
38 python? ( ${PYTHON_DEPS} )
41 >=x11-libs/gtk+-2.10:2[aqua=]
43 >=x11-libs/pango-1.4.0
44 xscreensaver? ( x11-libs/libXScrnSaver )
45 spell? ( >=app-text/gtkspell-2.0.2:2 )
46 eds? ( >=gnome-extra/evolution-data-server-3.6:= )
47 prediction? ( >=dev-db/sqlite-3.3:3 )
50 media-libs/gstreamer:1.0
51 media-libs/gst-plugins-base:1.0
52 >=net-libs/farstream-0.2.7:0.2
54 zeroconf? ( net-dns/avahi[dbus] )
56 >=dev-libs/dbus-glib-0.71
58 dev-python/dbus-python
60 perl? ( >=dev-lang/perl-5.16:= )
63 >=net-libs/libgadu-1.11.0[ssl,gnutls]
64 >=net-libs/libgadu-1.11.0[-ssl]
67 gnutls? ( net-libs/gnutls )
72 meanwhile? ( net-libs/meanwhile )
73 tcl? ( dev-lang/tcl:0= )
74 tk? ( dev-lang/tk:0= )
75 sasl? ( dev-libs/cyrus-sasl:2 )
76 networkmanager? ( net-misc/networkmanager )
77 idn? ( net-dns/libidn:= )
78 !<x11-plugins/pidgin-facebookchat-1.69-r1"
79 # Mono support crashes pidgin
80 #mono? ( dev-lang/mono )"
82 # We want nls in case gtk is enabled, bug #
83 NLS_DEPEND=">=dev-util/intltool-0.41.1 sys-devel/gettext"
93 dbus? ( ${PYTHON_DEPS} )
94 doc? ( app-doc/doxygen )
95 !gtk? ( nls? ( ${NLS_DEPEND} ) )"
97 DOCS=( AUTHORS HACKING NEWS README ChangeLog )
100 dbus? ( ${PYTHON_REQUIRED_USE} )
101 networkmanager? ( dbus )
102 python? ( ${PYTHON_REQUIRED_USE} )
105 # Enable Default protocols
106 DYNAMIC_PRPLS="irc,jabber,oscar,simple"
109 # app-accessibility/pidgin-festival
111 # x11-plugins/guifications
112 # x11-plugins/msn-pecan
113 # x11-plugins/pidgin-encryption
114 # x11-plugins/pidgin-extprefs
115 # x11-plugins/pidgin-hotkeys
116 # x11-plugins/pidgin-latex
117 # x11-plugins/pidgintex
118 # x11-plugins/pidgin-libnotify
119 # x11-plugins/pidgin-mbpurple
120 # x11-plugins/pidgin-bot-sentry
121 # x11-plugins/pidgin-otr
122 # x11-plugins/pidgin-rhythmbox
123 # x11-plugins/purple-plugin_pack
124 # x11-themes/pidgin-smileys
125 # x11-plugins/pidgin-knotify
126 # Plugins in Sunrise:
127 # x11-plugins/pidgin-audacious-remote
128 # x11-plugins/pidgin-autoanswer
129 # x11-plugins/pidgin-birthday-reminder
130 # x11-plugins/pidgin-blinklight
131 # x11-plugins/pidgin-convreverse
132 # x11-plugins/pidgin-embeddedvideo
133 # x11-plugins/pidgin-extended-blist-sort
134 # x11-plugins/pidgin-gfire
135 # x11-plugins/pidgin-lastfm
136 # x11-plugins/pidgin-sendscreenshot
137 # x11-plugins/pidgimpd
140 "${FILESDIR}/${PN}-2.10.0-gold.patch"
141 "${WORKDIR}/${PN}-eds-3.6.patch"
142 "${FILESDIR}/${PN}-2.10.9-fix-gtkmedia.patch"
143 "${FILESDIR}/${PN}-2.10.10-eds-3.6-configure.ac.patch"
144 "${FILESDIR}/${PN}-2.10.11-tinfo.patch"
145 "${DISTDIR}/${PN}-2.10.9-irc_join_sleep.patch" # 577286
146 "${FILESDIR}/${PN}-2.13.0-disable-one-jid-test.patch" # 593338
150 if ! use gtk && ! use ncurses ; then
151 elog "You did not pick the ncurses or gtk use flags, only libpurple"
152 elog "will be built."
154 if use python || use dbus ; then
155 python-single-r1_pkg_setup
158 # dbus is enabled, no way to disable linkage with python => python is enabled
159 #REQUIRED_USE="gtk? ( nls ) dbus? ( python )"
160 if use gtk && ! use nls; then
161 ewarn "gtk build => nls is enabled!"
163 if use dbus && ! use python; then
164 elog "dbus is enabled, no way to disable linkage with python => python is enabled"
174 # Stabilize things, for your own good
176 replace-flags -O? -O2
177 use pie && append-cflags -fPIE -pie
179 use gadu && DYNAMIC_PRPLS+=",gg"
180 use groupwise && DYNAMIC_PRPLS+=",novell"
181 use meanwhile && DYNAMIC_PRPLS+=",sametime"
182 use zephyr && DYNAMIC_PRPLS+=",zephyr"
183 use zeroconf && DYNAMIC_PRPLS+=",bonjour"
187 --with-dynamic-prpls="${DYNAMIC_PRPLS}"
188 --with-system-ssl-certs="${EPREFIX}/etc/ssl/certs/"
189 --x-includes="${EPREFIX}"/usr/include/X11
190 $(use_enable ncurses consoleui)
191 $(use_enable gtk gtkui)
193 $(usex gtk '--enable-nls' "$(use_enable nls)")
194 $(use gtk && use_enable xscreensaver screensaver)
195 $(use gtk && use_enable prediction cap)
196 $(use gtk && use_enable eds gevolution)
197 $(use gtk && use_enable spell gtkspell)
203 $(use_enable meanwhile)
204 $(use_enable gstreamer)
205 $(use_with gstreamer gstreamer 1.0)
206 $(use_enable gstreamer farstream)
207 $(use_enable gstreamer vv)
208 $(use_enable sasl cyrus-sasl )
209 $(use_enable doc doxygen)
210 $(use_enable networkmanager nm)
211 $(use_enable zeroconf avahi)
216 einfo "Disabling NSS, using GnuTLS"
217 myconf+=( --enable-nss=no --enable-gnutls=yes )
218 myconf+=( --with-gnutls-includes="${EPREFIX}/usr/include/gnutls" )
219 myconf+=( --with-gnutls-libs="${EPREFIX}/usr/$(get_libdir)" )
221 einfo "Disabling GnuTLS, using NSS"
222 myconf+=( --enable-gnutls=no --enable-nss=yes )
225 if use dbus || { use ncurses && use python ; } ; then
226 myconf+=( --with-python=${PYTHON} )
228 myconf+=( --without-python )
238 # Fix tray paths for e16 (x11-wm/enlightenment) and other
239 # implementations that are not complient with new hicolor theme yet, #323355
241 for d in 16 22 32 48; do
242 pixmapdir=${ED%/}/usr/share/pixmaps/pidgin/tray/hicolor/${d}x${d}/actions
243 mkdir "${pixmapdir}" || die
244 pushd "${pixmapdir}" >/dev/null || die
245 for f in ../status/*; do
248 popd >/dev/null || die
251 use perl && perl_delete_localpod
253 if use python && use dbus ; then
254 python_fix_shebang "${D}"
258 dodoc ${DOCS} finch/plugins/pietray.py
259 docompress -x /usr/share/doc/${PF}/pietray.py
261 find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
265 # make default build logs slightly more useful
266 emake check VERBOSE=1
269 pkg_preinst() { gnome2_icon_savelist; }
272 gnome2_icon_cache_update
273 xdg_desktop_database_update
277 gnome2_icon_cache_update
278 xdg_desktop_database_update