dev-python/Kivy: Add missing python depends on media-libs/opencv
[gentoo.git] / dev-python / Kivy / Kivy-1.9.1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
8
9 inherit distutils-r1
10
11 DISTUTILS_IN_SOURCE_BUILD=1
12
13 DESCRIPTION="Library for rapid development of hardware-accelerated multitouch applications"
14 HOMEPAGE="http://kivy.org/"
15 SRC_URI="https://pypi.io/packages/source/${PN:0:1}/${PN}/${P,,}.tar.gz"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="cairo camera doc examples garden gstreamer +sdl spell test"
21
22 RDEPEND="
23         dev-python/pillow[${PYTHON_USEDEP}]
24         cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] )
25         camera? ( media-libs/opencv[${PYTHON_USEDEP}] )
26         garden? ( dev-python/kivy-garden[${PYTHON_USEDEP}] )
27         gstreamer? ( dev-python/gst-python:1.0[${PYTHON_USEDEP}] )
28         sdl? ( media-libs/libsdl2
29                 media-libs/sdl2-ttf
30                 media-libs/sdl2-image
31                 media-libs/sdl2-mixer )
32         !sdl? ( dev-python/pygame[${PYTHON_USEDEP}] )
33         spell? ( dev-python/pyenchant[${PYTHON_USEDEP}] )"
34 DEPEND="${RDEPEND}
35         dev-python/cython[${PYTHON_USEDEP}]
36         dev-python/setuptools[${PYTHON_USEDEP}]
37         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
38         test? ( dev-python/nose[${PYTHON_USEDEP}] )"
39
40 S="${WORKDIR}/${P,,}"
41
42 python_prepare_all() {
43         sed -e '/data_files=/d' -i "${S}/setup.py" || die
44         sed -e 's/PYTHON = python/PYTHON ?= python/' -i Makefile || die
45
46         export USE_SDL2=$(usex sdl 1 0)
47         export USE_GSTREAMER=$(usex gstreamer 1 0)
48         export KIVY_USE_SETUPTOOLS=1
49         distutils-r1_python_prepare_all
50 }
51
52 python_compile() {
53         esetup.py build_ext --inplace
54         esetup.py build
55 }
56
57 python_compile_all() {
58         use doc && emake html
59 }
60
61 python_test() {
62         emake test PYTHON="${PYTHON}"
63 }
64
65 python_install_all() {
66         use doc && HTML_DOCS=( doc/build/html/. )
67         use examples && EXAMPLES=( examples )
68         distutils-r1_python_install_all
69 }