Use https by default
[gentoo.git] / net-im / pidgin / pidgin-2.10.11.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 GENTOO_DEPEND_ON_PERL=no
8 PYTHON_COMPAT=( python2_7 python3_{3,4} )
9
10 inherit autotools flag-o-matic eutils toolchain-funcs multilib perl-app gnome2 python-single-r1
11
12 DESCRIPTION="GTK Instant Messenger client"
13 HOMEPAGE="http://pidgin.im/"
14 SRC_URI="
15         mirror://sourceforge/${PN}/${P}.tar.bz2
16         https://dev.gentoo.org/~polynomial-c/${PN}-eds-3.6.patch.bz2"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="alpha amd64 arm hppa ~ia64 ppc ppc64 sparc x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos"
21 IUSE="dbus debug doc eds gadu gnutls +gstreamer +gtk idn meanwhile mxit"
22 IUSE+=" networkmanager nls perl silc 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? ( sys-libs/ncurses[unicode]
36                 dbus? ( ${PYTHON_DEPS} )
37                 python? ( ${PYTHON_DEPS} ) )
38         gtk? (
39                 >=x11-libs/gtk+-2.10:2[aqua=]
40                 x11-libs/libSM
41                 xscreensaver? ( x11-libs/libXScrnSaver )
42                 spell? ( >=app-text/gtkspell-2.0.2:2 )
43                 eds? ( >=gnome-extra/evolution-data-server-3.6:= )
44                 prediction? ( >=dev-db/sqlite-3.3:3 ) )
45         gstreamer? ( =media-libs/gstreamer-0.10*
46                 =media-libs/gst-plugins-good-0.10*
47                 net-libs/farstream:0.1
48                 media-plugins/gst-plugins-meta:0.10
49                 media-plugins/gst-plugins-gconf:0.10 )
50         zeroconf? ( net-dns/avahi[dbus] )
51         dbus? ( >=dev-libs/dbus-glib-0.71
52                 >=sys-apps/dbus-0.90
53                 dev-python/dbus-python )
54         perl? ( >=dev-lang/perl-5.16:= )
55         gadu? ( || ( >=net-libs/libgadu-1.11.0[ssl,gnutls]
56                 >=net-libs/libgadu-1.11.0[-ssl] ) )
57         gnutls? ( net-libs/gnutls )
58         !gnutls? ( >=dev-libs/nss-3.15.4 )
59         meanwhile? ( net-libs/meanwhile )
60         silc? ( >=net-im/silc-toolkit-1.0.1 )
61         tcl? ( dev-lang/tcl:0= )
62         tk? ( dev-lang/tk:0= )
63         sasl? ( dev-libs/cyrus-sasl:2 )
64         networkmanager? ( net-misc/networkmanager )
65         idn? ( net-dns/libidn )
66         !<x11-plugins/pidgin-facebookchat-1.69-r1"
67         # Mono support crashes pidgin
68         #mono? ( dev-lang/mono )"
69
70 # We want nls in case gtk is enabled, bug #
71 NLS_DEPEND=">=dev-util/intltool-0.41.1 sys-devel/gettext"
72
73 DEPEND="$RDEPEND
74         dev-lang/perl
75         dev-perl/XML-Parser
76         virtual/pkgconfig
77         gtk? ( x11-proto/scrnsaverproto
78                 ${NLS_DEPEND} )
79         dbus? ( ${PYTHON_DEPS} )
80         doc? ( app-doc/doxygen )
81         !gtk? ( nls? ( ${NLS_DEPEND} ) )"
82
83 DOCS="AUTHORS HACKING NEWS README ChangeLog"
84
85 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
86                 dbus? ( ${PYTHON_REQUIRED_USE} )"
87
88 # Enable Default protocols
89 DYNAMIC_PRPLS="irc,jabber,oscar,yahoo,simple,msn,myspace"
90
91 # List of plugins
92 #   app-accessibility/pidgin-festival
93 #   net-im/librvp
94 #   x11-plugins/guifications
95 #       x11-plugins/msn-pecan
96 #   x11-plugins/pidgin-encryption
97 #   x11-plugins/pidgin-extprefs
98 #   x11-plugins/pidgin-hotkeys
99 #   x11-plugins/pidgin-latex
100 #   x11-plugins/pidgintex
101 #   x11-plugins/pidgin-libnotify
102 #       x11-plugins/pidgin-mbpurple
103 #       x11-plugins/pidgin-bot-sentry
104 #   x11-plugins/pidgin-otr
105 #   x11-plugins/pidgin-rhythmbox
106 #   x11-plugins/purple-plugin_pack
107 #   x11-themes/pidgin-smileys
108 #       x11-plugins/pidgin-knotify
109 # Plugins in Sunrise:
110 #       x11-plugins/pidgin-audacious-remote
111 #       x11-plugins/pidgin-autoanswer
112 #       x11-plugins/pidgin-birthday-reminder
113 #       x11-plugins/pidgin-blinklight
114 #       x11-plugins/pidgin-convreverse
115 #       x11-plugins/pidgin-embeddedvideo
116 #       x11-plugins/pidgin-extended-blist-sort
117 #       x11-plugins/pidgin-gfire
118 #       x11-plugins/pidgin-lastfm
119 #       x11-plugins/pidgin-sendscreenshot
120 #       x11-plugins/pidgimpd
121
122 pkg_setup() {
123         if ! use gtk && ! use ncurses ; then
124                 elog "You did not pick the ncurses or gtk use flags, only libpurple"
125                 elog "will be built."
126         fi
127         if use python || use dbus ; then
128                 python-single-r1_pkg_setup
129         fi
130
131         # dbus is enabled, no way to disable linkage with python => python is enabled
132         #REQUIRED_USE="gtk? ( nls ) dbus? ( python )"
133         if use gtk && ! use nls; then
134                 ewarn "gtk build => nls is enabled!"
135         fi
136         if use dbus && ! use python; then
137                 elog "dbus is enabled, no way to disable linkage with python => python is enabled"
138         fi
139 }
140
141 src_prepare() {
142         epatch \
143                 "${FILESDIR}"/${PN}-2.10.0-gold.patch \
144                 "${WORKDIR}"/${PN}-eds-3.6.patch \
145                 "${FILESDIR}"/${PN}-2.10.9-fix-gtkmedia.patch \
146                 "${FILESDIR}"/${PN}-2.10.10-eds-3.6-configure.ac.patch \
147                 "${FILESDIR}"/${P}-tinfo.patch
148         epatch_user
149
150         eautoreconf
151 }
152
153 src_configure() {
154         # Stabilize things, for your own good
155         strip-flags
156         replace-flags -O? -O2
157
158         local myconf
159
160         if use gadu; then
161                 DYNAMIC_PRPLS="${DYNAMIC_PRPLS},gg"
162                         myconf="${myconf} --with-gadu-includes=."
163                         myconf="${myconf} --with-gadu-libs=."
164         fi
165
166         use groupwise && DYNAMIC_PRPLS+=",novell"
167         use silc && DYNAMIC_PRPLS+=",silc"
168         use meanwhile && DYNAMIC_PRPLS+=",sametime"
169         use mxit && DYNAMIC_PRPLS+=",mxit"
170         use zephyr && DYNAMIC_PRPLS+=",zephyr"
171         use zeroconf && DYNAMIC_PRPLS+=",bonjour"
172
173         if use gnutls; then
174                 einfo "Disabling NSS, using GnuTLS"
175                 myconf+=" --enable-nss=no --enable-gnutls=yes"
176                 myconf+=" --with-gnutls-includes=${EPREFIX}/usr/include/gnutls"
177                 myconf+=" --with-gnutls-libs=${EPREFIX}/usr/$(get_libdir)"
178         else
179                 einfo "Disabling GnuTLS, using NSS"
180                 myconf+=" --enable-gnutls=no --enable-nss=yes"
181         fi
182
183         if use dbus || { use ncurses && use python; }; then
184                 myconf+=" --with-python=${PYTHON}"
185         else
186                 myconf+=" --without-python"
187         fi
188
189         econf \
190                 $(use_enable ncurses consoleui) \
191                 $(use_enable gtk gtkui) \
192                 $(use_enable gtk sm) \
193                 $(use gtk || use_enable nls) \
194                 $(use gtk && echo "--enable-nls") \
195                 $(use gtk && use_enable xscreensaver screensaver) \
196                 $(use gtk && use_enable prediction cap) \
197                 $(use gtk && use_enable eds gevolution) \
198                 $(use gtk && use_enable spell gtkspell) \
199                 $(use_enable perl) \
200                 $(use_enable tk) \
201                 $(use_enable tcl) \
202                 $(use_enable debug) \
203                 $(use_enable dbus) \
204                 $(use_enable meanwhile) \
205                 $(use_enable gstreamer) \
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                 --with-system-ssl-certs="${EPREFIX}/etc/ssl/certs/" \
214                 --with-dynamic-prpls="${DYNAMIC_PRPLS}" \
215                 --disable-mono \
216                 --x-includes="${EPREFIX}"/usr/include/X11 \
217                 ${myconf}
218                 #$(use_enable mono) \
219 }
220
221 src_install() {
222         gnome2_src_install
223         if use gtk; then
224                 # Fix tray pathes for kde-3.5, e16 (x11-wm/enlightenment) and other
225                 # implementations that are not complient with new hicolor theme yet, #323355
226                 local pixmapdir
227                 for d in 16 22 32 48; do
228                         pixmapdir=${ED}/usr/share/pixmaps/pidgin/tray/hicolor/${d}x${d}/actions
229                         mkdir "${pixmapdir}" || die
230                         pushd "${pixmapdir}" >/dev/null || die
231                         for f in ../status/*; do
232                                 ln -s ${f} || die
233                         done
234                         popd >/dev/null
235                 done
236         fi
237         use perl && perl_delete_localpod
238
239         if use python || use dbus ; then
240                 python_fix_shebang "${D}"
241                 python_optimize
242         fi
243
244         dodoc finch/plugins/pietray.py
245         docompress -x /usr/share/doc/${PF}/pietray.py
246
247         prune_libtool_files --all
248 }