dev-lang/php: Drop old
[gentoo.git] / net-irc / hexchat / hexchat-2.12.4-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
7 inherit autotools fdo-mime gnome2-utils mono-env python-single-r1
8
9 DESCRIPTION="Graphical IRC client based on XChat"
10 HOMEPAGE="https://hexchat.github.io/"
11
12 if [[ "${PV}" == "9999" ]] ; then
13         inherit git-r3
14         SRC_URI=""
15         EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
16 else
17         SRC_URI="https://dl.hexchat.net/${PN}/${P}.tar.xz"
18         KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-linux"
19 fi
20
21 LICENSE="GPL-2 plugin-fishlim? ( MIT )"
22 SLOT="0"
23 IUSE="dbus debug +gtk libcanberra libnotify libproxy libressl lua nls perl plugin-checksum plugin-fishlim plugin-sysinfo python spell ssl theme-manager"
24 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
25
26 COMMON_DEPEND="dev-libs/glib:2
27         dbus? ( sys-apps/dbus )
28         gtk? ( x11-libs/gtk+:2 )
29         libcanberra? ( media-libs/libcanberra )
30         libproxy? ( net-libs/libproxy )
31         libnotify? ( x11-libs/libnotify )
32         lua? ( dev-lang/lua:= )
33         nls? ( virtual/libintl )
34         perl? ( dev-lang/perl )
35         plugin-sysinfo? ( sys-apps/pciutils )
36         python? ( ${PYTHON_DEPS} )
37         spell? ( app-text/iso-codes )
38         ssl? (
39                 !libressl? ( dev-libs/openssl:0= )
40                 libressl? ( dev-libs/libressl:0= )
41         )
42         theme-manager? (
43                 || (
44                         ( dev-lang/mono[minimal] dev-dotnet/libgdiplus )
45                         dev-lang/mono[-minimal]
46                 )
47         )"
48
49 RDEPEND="${COMMON_DEPEND}
50         spell? ( app-text/enchant )"
51 DEPEND="${COMMON_DEPEND}
52         app-arch/xz-utils
53         virtual/pkgconfig
54         dev-util/intltool
55         sys-devel/autoconf-archive
56         theme-manager? ( dev-util/monodevelop )"
57
58 PATCHES=(
59         "${FILESDIR}/hexchat-2.12.2-configure.ac-remove-werror.patch"
60         "${FILESDIR}/hexchat-2.12.4-libressl.patch"
61 )
62
63 src_prepare() {
64         default
65         eautoreconf
66 }
67
68 pkg_setup() {
69         use python && python-single-r1_pkg_setup
70         if use theme-manager ; then
71                 mono-env_pkg_setup
72                 export XDG_CACHE_HOME="${T}/.cache"
73         fi
74 }
75
76 src_configure() {
77         econf \
78                 --enable-plugin \
79                 $(use_enable nls) \
80                 $(use_enable ssl openssl) \
81                 $(use_enable gtk gtkfe) \
82                 $(use_enable !gtk textfe) \
83                 $(use_enable python python "${EPYTHON}") \
84                 $(use_enable perl) \
85                 $(use_enable plugin-checksum checksum) \
86                 $(use_enable plugin-fishlim fishlim) \
87                 $(use_enable plugin-sysinfo sysinfo) \
88                 $(use_enable dbus) \
89                 $(use_enable lua) \
90                 $(use_enable libnotify) \
91                 $(use_enable libcanberra) \
92                 $(use_enable libproxy) \
93                 $(use_enable spell isocodes) \
94                 $(use_enable debug) \
95                 $(use_with theme-manager)
96 }
97
98 src_install() {
99         emake DESTDIR="${D}" \
100                 UPDATE_ICON_CACHE=true \
101                 UPDATE_MIME_DATABASE=true \
102                 UPDATE_DESKTOP_DATABASE=true \
103                 install
104         dodoc readme.md
105         find "${D}" -name '*.la' -delete || die
106 }
107
108 pkg_preinst() {
109         if use gtk ; then
110                 gnome2_icon_savelist
111         fi
112 }
113
114 pkg_postinst() {
115         if use gtk ; then
116                 gnome2_icon_cache_update
117         else
118                 elog "You have disabled the gtk USE flag. This means you don't have"
119                 elog "the GTK-GUI for HexChat but only a text interface called \"hexchat-text\"."
120         fi
121
122         if use theme-manager ; then
123                 fdo-mime_desktop_database_update
124                 fdo-mime_mime_database_update
125                 elog "Themes are available at:"
126                 elog "  https://hexchat.github.io/themes.html"
127         fi
128
129         elog
130         elog "optional dependencies:"
131         elog "  media-sound/sox (sound playback if you don't have libcanberra"
132         elog "    enabled)"
133         elog "  x11-plugins/hexchat-javascript (javascript support)"
134         elog "  x11-themes/sound-theme-freedesktop (default BEEP sound,"
135         elog "    needs libcanberra enabled)"
136 }
137
138 pkg_postrm() {
139         if use gtk ; then
140                 gnome2_icon_cache_update
141         fi
142
143         if use theme-manager ; then
144                 fdo-mime_desktop_database_update
145                 fdo-mime_mime_database_update
146         fi
147 }