net-im/pidgin: Remove USE="silc"
[gentoo.git] / net-im / pidgin / pidgin-2.13.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 GENTOO_DEPEND_ON_PERL=no
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit autotools flag-o-matic gnome2 toolchain-funcs multilib perl-module python-single-r1 xdg-utils
10
11 DESCRIPTION="GTK Instant Messenger client"
12 HOMEPAGE="http://pidgin.im/"
13 SRC_URI="
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"
17
18 LICENSE="GPL-2"
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"
24 IUSE+=" aqua"
25
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.
32 RDEPEND="
33         >=dev-libs/glib-2.16
34         >=dev-libs/libxml2-2.6.18
35         ncurses? (
36                 sys-libs/ncurses:0=[unicode]
37                 dbus? ( ${PYTHON_DEPS} )
38                 python? ( ${PYTHON_DEPS} )
39         )
40         gtk? (
41                 >=x11-libs/gtk+-2.10:2[aqua=]
42                 x11-libs/libSM
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 )
48         )
49         gstreamer? (
50                 media-libs/gstreamer:1.0
51                 media-libs/gst-plugins-base:1.0
52                 >=net-libs/farstream-0.2.7:0.2
53         )
54         zeroconf? ( net-dns/avahi[dbus] )
55         dbus? (
56                 >=dev-libs/dbus-glib-0.71
57                 >=sys-apps/dbus-0.90
58                 dev-python/dbus-python
59         )
60         perl? ( >=dev-lang/perl-5.16:= )
61         gadu? (
62                 || (
63                         >=net-libs/libgadu-1.11.0[ssl,gnutls]
64                         >=net-libs/libgadu-1.11.0[-ssl]
65                 )
66         )
67         gnutls? ( net-libs/gnutls )
68         !gnutls? (
69                 dev-libs/nspr
70                 dev-libs/nss
71         )
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 )"
81
82 # We want nls in case gtk is enabled, bug #
83 NLS_DEPEND=">=dev-util/intltool-0.41.1 sys-devel/gettext"
84
85 DEPEND="$RDEPEND
86         dev-lang/perl
87         dev-perl/XML-Parser
88         virtual/pkgconfig
89         gtk? (
90                 x11-base/xorg-proto
91                 ${NLS_DEPEND}
92         )
93         dbus? ( ${PYTHON_DEPS} )
94         doc? ( app-doc/doxygen )
95         !gtk? ( nls? ( ${NLS_DEPEND} ) )"
96
97 DOCS=( AUTHORS HACKING NEWS README ChangeLog )
98
99 REQUIRED_USE="
100         dbus? ( ${PYTHON_REQUIRED_USE} )
101         networkmanager? ( dbus )
102         python? ( ${PYTHON_REQUIRED_USE} )
103 "
104
105 # Enable Default protocols
106 DYNAMIC_PRPLS="irc,jabber,oscar,simple"
107
108 # List of plugins
109 #   app-accessibility/pidgin-festival
110 #   net-im/librvp
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
138
139 PATCHES=(
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
147 )
148
149 pkg_setup() {
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."
153         fi
154         if use python || use dbus ; then
155                 python-single-r1_pkg_setup
156         fi
157
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!"
162         fi
163         if use dbus && ! use python; then
164                 elog "dbus is enabled, no way to disable linkage with python => python is enabled"
165         fi
166 }
167
168 src_prepare() {
169         default
170         eautoreconf
171 }
172
173 src_configure() {
174         # Stabilize things, for your own good
175         strip-flags
176         replace-flags -O? -O2
177         use pie && append-cflags -fPIE -pie
178
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"
184
185         local myconf=(
186                 --disable-mono
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)
192                 $(use_enable gtk sm)
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)
198                 $(use_enable perl)
199                 $(use_enable tk)
200                 $(use_enable tcl)
201                 $(use_enable debug)
202                 $(use_enable dbus)
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)
212                 $(use_enable idn)
213         )
214
215         if use gnutls; then
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)" )
220         else
221                 einfo "Disabling GnuTLS, using NSS"
222                 myconf+=( --enable-gnutls=no --enable-nss=yes )
223         fi
224
225         if use dbus || { use ncurses && use python ; } ; then
226                 myconf+=( --with-python=${PYTHON} )
227         else
228                 myconf+=( --without-python )
229         fi
230
231         econf "${myconf[@]}"
232 }
233
234 src_install() {
235         gnome2_src_install
236
237         if use gtk; then
238                 # Fix tray paths for e16 (x11-wm/enlightenment) and other
239                 # implementations that are not complient with new hicolor theme yet, #323355
240                 local pixmapdir
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
246                                 ln -s ${f} || die
247                         done
248                         popd >/dev/null || die
249                 done
250         fi
251         use perl && perl_delete_localpod
252
253         if use python && use dbus ; then
254                 python_fix_shebang "${D}"
255                 python_optimize
256         fi
257
258         dodoc ${DOCS} finch/plugins/pietray.py
259         docompress -x /usr/share/doc/${PF}/pietray.py
260
261         find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
262 }
263
264 src_test() {
265         # make default build logs slightly more useful
266         emake check VERBOSE=1
267 }
268
269 pkg_preinst() { gnome2_icon_savelist; }
270
271 pkg_postinst() {
272         gnome2_icon_cache_update
273         xdg_desktop_database_update
274 }
275
276 pkg_postrm() {
277         gnome2_icon_cache_update
278         xdg_desktop_database_update
279 }