dev-libs/libinput: Move tools needed for USE="doc" to BDEPEND.
[gentoo.git] / dev-libs / libinput / libinput-1.13.1.ebuild
1 # Copyright 2014-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
6
7 inherit meson python-any-r1 udev
8
9 DESCRIPTION="Library to handle input devices in Wayland"
10 HOMEPAGE="https://www.freedesktop.org/wiki/Software/libinput/ https://gitlab.freedesktop.org/libinput/libinput"
11 SRC_URI="https://www.freedesktop.org/software/${PN}/${P}.tar.xz"
12
13 LICENSE="MIT"
14 SLOT="0/10"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
16 IUSE="doc input_devices_wacom"
17 # Tests require write access to udev rules directory which is a no-no for live system.
18 # Other tests are just about logs, exported symbols and autotest of the test library.
19 RESTRICT="test"
20
21 BDEPEND="
22         virtual/pkgconfig
23         doc? (
24                 $(python_gen_any_dep '
25                         dev-python/commonmark[${PYTHON_USEDEP}]
26                         dev-python/recommonmark[${PYTHON_USEDEP}]
27                         dev-python/sphinx[${PYTHON_USEDEP}]
28                         >=dev-python/sphinx_rtd_theme-0.2.4[${PYTHON_USEDEP}]
29                 ')
30                 >=app-doc/doxygen-1.8.3
31                 >=media-gfx/graphviz-2.38.0
32         )
33 "
34 #       test? ( dev-util/valgrind )
35 RDEPEND="
36         input_devices_wacom? ( >=dev-libs/libwacom-0.20 )
37         >=dev-libs/libevdev-1.3
38         >=sys-libs/mtdev-1.1
39         virtual/libudev:=
40         virtual/udev
41 "
42 DEPEND="${RDEPEND}"
43 #       test? ( >=dev-libs/check-0.9.10 )
44
45 python_check_deps() {
46         has_version "dev-python/commonmark[${PYTHON_USEDEP}]" && \
47         has_version "dev-python/recommonmark[${PYTHON_USEDEP}]" && \
48         has_version "dev-python/sphinx[${PYTHON_USEDEP}]" && \
49         has_version ">=dev-python/sphinx_rtd_theme-0.2.4[${PYTHON_USEDEP}]"
50 }
51
52 pkg_setup() {
53         use doc && python-any-r1_pkg_setup
54 }
55
56 src_configure() {
57         # gui can be built but will not be installed
58         local emesonargs=(
59                 -Ddebug-gui=false
60                 $(meson_use doc documentation)
61                 $(meson_use input_devices_wacom libwacom)
62                 -Dtests=false # tests are restricted
63                 -Dudev-dir="$(get_udevdir)"
64         )
65         meson_src_configure
66 }
67
68 src_install() {
69         meson_src_install
70         if use doc ; then
71                 docinto html
72                 dodoc -r "${BUILD_DIR}"/Documentation/.
73         fi
74 }
75
76 pkg_postinst() {
77         udevadm hwdb --update --root="${ROOT%/}"
78 }