net-libs/qxmpp: Sync live with latest release ebuild, drop USE=qt4,qt5
[gentoo.git] / net-libs / qxmpp / qxmpp-9999.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 EGIT_REPO_URI="https://github.com/qxmpp-project/qxmpp"
7
8 inherit git-r3 qmake-utils
9
10 DESCRIPTION="A cross-platform C++ XMPP client library based on the Qt framework"
11 HOMEPAGE="https://github.com/qxmpp-project/qxmpp/"
12
13 LICENSE="LGPL-2.1"
14 SLOT="0"
15 KEYWORDS=""
16 IUSE="debug doc opus +speex test theora vpx"
17
18 RDEPEND="
19         dev-qt/qtcore:5
20         dev-qt/qtnetwork:5[ssl]
21         dev-qt/qtxml:5
22         opus? ( media-libs/opus )
23         speex? ( media-libs/speex )
24         theora? ( media-libs/libtheora )
25         vpx? ( media-libs/libvpx )
26 "
27 DEPEND="${RDEPEND}
28         test? ( dev-qt/qttest:5 )
29 "
30
31 src_prepare(){
32         if ! use doc; then
33                 sed -i \
34                         -e '/SUBDIRS/s/doc//' \
35                         -e '/INSTALLS/d' \
36                         qxmpp.pro || die "sed for removing docs failed"
37         fi
38         if ! use test; then
39                 sed -i -e '/SUBDIRS/s/tests//' \
40                         qxmpp.pro || die "sed for removing tests failed"
41         fi
42         # There is no point in building examples. Also, they require dev-qt/qtgui
43         sed -i -e '/SUBDIRS/s/examples//' \
44                         qxmpp.pro || die "sed for removing examples failed"
45         default_src_prepare
46 }
47
48 src_configure(){
49         local conf_speex
50         local conf_theora
51         local conf_vpx
52
53         use opus && conf_opus="QXMPP_USE_OPUS=1"
54         use speex && conf_speex="QXMPP_USE_SPEEX=1"
55         use theora && conf_theora="QXMPP_USE_THEORA=1"
56         use vpx && conf_vpx="QXMPP_USE_VPX=1"
57
58         eqmake5 "${S}"/qxmpp.pro "PREFIX=${EPREFIX}/usr" "LIBDIR=$(get_libdir)" "${conf_opus}" "${conf_speex}" "${conf_theora}" "${conf_vpx}"
59 }
60
61 src_install() {
62         emake INSTALL_ROOT="${D}" install
63         einstalldocs
64         if use doc; then
65                 # Use proper path for documentation
66                 mv "${ED}"/usr/share/doc/${PN} "${ED}"/usr/share/doc/${PF} || die "doc mv failed"
67         fi
68 }
69
70 src_test() {
71         MAKEOPTS="-j1" # random tests fail otherwise
72         default_src_test
73 }