Drop $Id$ per council decision in bug #611234.
[gentoo.git] / dev-python / Kivy / Kivy-1.9.1.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 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
7
8 inherit distutils-r1
9
10 DISTUTILS_IN_SOURCE_BUILD=1
11
12 DESCRIPTION="Library for rapid development of hardware-accelerated multitouch applications"
13 HOMEPAGE="http://kivy.org/"
14 SRC_URI="https://pypi.io/packages/source/${PN:0:1}/${PN}/${P,,}.tar.gz"
15
16 LICENSE="MIT"
17 SLOT="0"
18 KEYWORDS="amd64 x86"
19 IUSE="cairo camera doc examples garden gstreamer +sdl spell test"
20
21 RDEPEND="
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
28                 media-libs/sdl2-ttf
29                 media-libs/sdl2-image
30                 media-libs/sdl2-mixer )
31         !sdl? ( dev-python/pygame[${PYTHON_USEDEP}] )
32         spell? ( dev-python/pyenchant[${PYTHON_USEDEP}] )"
33 DEPEND="${RDEPEND}
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}] )"
38
39 S="${WORKDIR}/${P,,}"
40
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
44
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
49 }
50
51 python_compile() {
52         esetup.py build_ext --inplace
53         esetup.py build
54 }
55
56 python_compile_all() {
57         use doc && emake html
58 }
59
60 python_test() {
61         emake test PYTHON="${PYTHON}"
62 }
63
64 python_install_all() {
65         use doc && HTML_DOCS=( doc/build/html/. )
66         use examples && EXAMPLES=( examples )
67         distutils-r1_python_install_all
68 }