dev-libs/dbus-glib: [QA] inherit ltprune.eclass directly
[gentoo.git] / dev-libs / dbus-glib / dbus-glib-0.110.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit bash-completion-r1 eutils ltprune multilib-minimal
6
7 DESCRIPTION="D-Bus bindings for glib"
8 HOMEPAGE="https://dbus.freedesktop.org/"
9 SRC_URI="https://dbus.freedesktop.org/releases/${PN}/${P}.tar.gz"
10
11 LICENSE="|| ( GPL-2 AFL-2.1 )"
12 SLOT="0"
13 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x86-solaris"
14 IUSE="debug static-libs test"
15 RESTRICT="!test? ( test )"
16
17 CDEPEND="
18         >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
19         >=dev-libs/glib-2.40:2[${MULTILIB_USEDEP}]
20         >=sys-apps/dbus-1.8[${MULTILIB_USEDEP}]
21 "
22 DEPEND="${CDEPEND}
23         >=dev-util/glib-utils-2.40
24         >=dev-util/gtk-doc-am-1.14
25         virtual/pkgconfig
26 "
27 RDEPEND="${CDEPEND}"
28
29 DOCS=( AUTHORS ChangeLog HACKING NEWS README )
30
31 set_TBD() {
32         # out of sources build dir for make check
33         export TBD="${BUILD_DIR}-tests"
34 }
35
36 multilib_src_configure() {
37         local myconf=(
38                 --localstatedir="${EPREFIX}"/var
39                 --enable-bash-completion
40                 --disable-gtk-doc
41                 $(use_enable debug asserts)
42                 $(use_enable static-libs static)
43         )
44
45         ECONF_SOURCE="${S}" econf "${myconf[@]}"
46
47         ln -s "${S}"/doc/reference/html doc/reference/html || die #460042
48
49         if use test; then
50                 set_TBD
51                 mkdir "${TBD}" || die
52                 cd "${TBD}" || die
53                 einfo "Running configure in ${TBD}"
54                 ECONF_SOURCE="${S}" econf \
55                         "${myconf[@]}" \
56                         $(use_enable test checks) \
57                         $(use_enable test tests) \
58                         $(use_enable test asserts)
59         fi
60 }
61
62 multilib_src_compile() {
63         emake
64
65         if use test; then
66                 set_TBD
67                 cd "${TBD}" || die
68                 einfo "Running make in ${TBD}"
69                 emake
70         fi
71 }
72
73 multilib_src_test() {
74         set_TBD
75         cd "${TBD}" || die
76         emake check
77 }
78
79 multilib_src_install_all() {
80         einstalldocs
81
82         newbashcomp "${ED}"/etc/bash_completion.d/dbus-bash-completion.sh dbus-send
83         rm -rf "${ED}"/etc/bash_completion.d || die
84
85         prune_libtool_files
86 }