*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / net-irc / hexchat / hexchat-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7,8} )
7
8 inherit meson mono-env python-single-r1 xdg
9
10 DESCRIPTION="Graphical IRC client based on XChat"
11 HOMEPAGE="https://hexchat.github.io/"
12
13 if [[ "${PV}" == "9999" ]] ; then
14         inherit git-r3
15         SRC_URI=""
16         EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
17 else
18         SRC_URI="https://dl.hexchat.net/${PN}/${P}.tar.xz"
19         KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux"
20 fi
21
22 LICENSE="GPL-2 plugin-fishlim? ( MIT )"
23 SLOT="0"
24 IUSE="dbus debug +gtk libcanberra libnotify libproxy libressl lua perl plugin-checksum plugin-fishlim plugin-sysinfo python ssl theme-manager"
25 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26
27 RDEPEND="
28         dev-libs/glib:2
29         dbus? ( dev-libs/dbus-glib )
30         gtk? (
31                 x11-libs/gdk-pixbuf:2
32                 x11-libs/gtk+:2
33                 x11-libs/libX11
34                 x11-libs/pango
35         )
36         libcanberra? ( media-libs/libcanberra )
37         libproxy? ( net-libs/libproxy )
38         libnotify? ( x11-libs/libnotify )
39         lua? ( dev-lang/lua:= )
40         perl? ( dev-lang/perl:= )
41         plugin-sysinfo? ( sys-apps/pciutils )
42         python? ( ${PYTHON_DEPS} )
43         ssl? (
44                 !libressl? ( dev-libs/openssl:0= )
45                 libressl? ( dev-libs/libressl:0= )
46         )
47         theme-manager? (
48                 || (
49                         ( dev-lang/mono[minimal] dev-dotnet/libgdiplus )
50                         dev-lang/mono[-minimal]
51                 )
52         )"
53
54 DEPEND="${RDEPEND}"
55 BDEPEND="
56         dev-util/glib-utils
57         app-arch/xz-utils
58         app-text/iso-codes
59         sys-devel/gettext
60         virtual/pkgconfig
61 "
62
63 pkg_setup() {
64         use python && python-single-r1_pkg_setup
65         if use theme-manager ; then
66                 mono-env_pkg_setup
67                 export XDG_CACHE_HOME="${T}/.cache"
68         fi
69 }
70
71 src_configure() {
72         local emesonargs=(
73                 -Dwith-gtk="$(usex gtk true false)"
74                 -Dwith-text="$(usex gtk false true)"
75                 -Dwith-ssl="$(usex ssl true false)"
76                 -Dwith-plugin=true
77                 -Dwith-dbus="$(usex dbus true false)"
78                 -Dwith-libproxy="$(usex libproxy true false)"
79                 -Dwith-libnotify="$(usex libnotify true false)"
80                 -Dwith-libcanberra="$(usex libcanberra true false)"
81                 -Dwith-theme-manager="$(usex theme-manager true false)"
82                 -Ddbus-service-use-appid=false
83                 -Dwith-checksum="$(usex plugin-checksum true false)"
84                 -Dwith-fishlim="$(usex plugin-fishlim true false)"
85                 -Dwith-lua="$(usex lua lua false)"
86                 -Dwith-perl="$(usex perl "${EPREFIX}"/usr/bin/perl false)"
87                 -Dwith-python="$(usex python "${EPYTHON/.*}" false)"
88                 -Dwith-sysinfo="$(usex plugin-sysinfo true false)"
89                 -Dwith-appdata=false
90         )
91         meson_src_configure
92 }
93
94 src_install() {
95         meson_src_install
96         dodoc readme.md
97         find "${D}" -name '*.la' -delete || die
98 }
99
100 pkg_preinst() {
101         if use gtk ; then
102                 xdg_pkg_preinst
103         fi
104 }
105
106 pkg_postinst() {
107         if use gtk ; then
108                 xdg_pkg_postinst
109         else
110                 elog "You have disabled the gtk USE flag. This means you don't have"
111                 elog "the GTK-GUI for HexChat but only a text interface called \"hexchat-text\"."
112         fi
113
114         if use theme-manager ; then
115                 elog "Themes are available at:"
116                 elog "  https://hexchat.github.io/themes.html"
117         fi
118
119         elog
120         elog "optional dependencies:"
121         elog "  media-sound/sox (sound playback if you don't have libcanberra"
122         elog "    enabled)"
123         elog "  x11-plugins/hexchat-javascript (javascript support)"
124         elog "  x11-themes/sound-theme-freedesktop (default BEEP sound,"
125         elog "    needs libcanberra enabled)"
126 }
127
128 pkg_postrm() {
129         if use gtk ; then
130                 xdg_pkg_postrm
131         fi
132 }