1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_5} )
10 DISTUTILS_IN_SOURCE_BUILD=1
12 DESCRIPTION="Library for rapid development of hardware-accelerated multitouch applications"
13 HOMEPAGE="https://kivy.org/"
14 SRC_URI="https://pypi.io/packages/source/${PN:0:1}/${PN}/${P,,}.tar.gz"
19 IUSE="cairo camera doc examples garden gstreamer +sdl spell test"
22 dev-python/pillow[${PYTHON_USEDEP}]
23 cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] )
24 camera? ( media-libs/opencv:0/2.4[$(python_gen_usedep 'python2_7')] )
25 garden? ( dev-python/kivy-garden[${PYTHON_USEDEP}] )
26 gstreamer? ( dev-python/gst-python:1.0[${PYTHON_USEDEP}] )
27 sdl? ( media-libs/libsdl2
30 media-libs/sdl2-mixer )
31 !sdl? ( dev-python/pygame[${PYTHON_USEDEP}] )
32 spell? ( dev-python/pyenchant[${PYTHON_USEDEP}] )"
34 dev-python/cython[${PYTHON_USEDEP}]
35 dev-python/setuptools[${PYTHON_USEDEP}]
36 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
37 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
41 python_prepare_all() {
42 sed -e '/data_files=/d' -i "${S}/setup.py" || die
43 sed -e 's/PYTHON = python/PYTHON ?= python/' -i Makefile || die
45 export USE_SDL2=$(usex sdl 1 0)
46 export USE_GSTREAMER=$(usex gstreamer 1 0)
47 export KIVY_USE_SETUPTOOLS=1
48 distutils-r1_python_prepare_all
52 esetup.py build_ext --inplace
56 python_compile_all() {
61 emake test PYTHON="${PYTHON}"
64 python_install_all() {
65 use doc && HTML_DOCS=( doc/build/html/. )
66 use examples && EXAMPLES=( examples )
67 distutils-r1_python_install_all