1SUMMARY = "Open source Python library for rapid development of applications \
2    that make use of innovative user interfaces, such as multi-touch apps."
3HOMEPAGE = "https://kivy.org/"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=6d3bc49400e35d5a2279d14c40dcfb09"
6
7inherit setuptools3 pkgconfig features_check
8PIP_INSTALL_PACKAGE = "Kivy"
9
10# Kivy's setup files only look for GLES libraries for Android, iOS, RPi,
11# and mali-based OS's. We need to patch the setup file to tell Kivy setup
12# that our machine has GLES libaries installed as well
13# Also, if using SDL2 as backend, SDL2 needs to be configured with gles
14SRC_URI = "git://github.com/kivy/kivy.git;protocol=https;branch=stable \
15           file://0001-add-support-for-glesv2.patch \
16           "
17
18SRCREV = "9ef218027178115a66b417ae34b21f488bdd3617"
19
20S = "${WORKDIR}/git"
21
22PACKAGES += "${PN}-examples"
23FILES:${PN}-examples = "/usr/share/kivy-examples"
24
25USE_WAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '1', '0', d)}"
26export USE_WAYLAND
27
28# if using Wayland, let's use pure Wayland (and not XWayland)
29# so do not build using X11 flag when we detect Wayland
30USE_X11 = " \
31    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland',  '0', \
32       bb.utils.contains('DISTRO_FEATURES', 'x11',      '1', \
33                                                        '0', d), d)}"
34export USE_X11
35
36# Use OpenGL ES 2.0 library
37KIVY_GRAPHICS = "gles"
38export KIVY_GRAPHICS
39
40KIVY_CROSS_SYSROOT="${RECIPE_SYSROOT}"
41export KIVY_CROSS_SYSROOT
42
43REQUIRED_DISTRO_FEATURES += "opengl gobject-introspection-data"
44
45ANY_OF_DISTRO_FEATURES = "x11 wayland"
46
47DEPENDS += " \
48    gstreamer1.0 \
49    gstreamer1.0-python \
50    libsdl2 \
51    libsdl2-ttf \
52    libsdl2-image \
53    libsdl2-mixer \
54    pango \
55    python3 \
56    python3-cython-native \
57"
58
59RDEPENDS:${PN} = " \
60    gstreamer1.0 \
61    gstreamer1.0-python \
62    libsdl2 \
63    libsdl2-ttf \
64    libsdl2-image \
65    libsdl2-mixer \
66    pango \
67    python3 \
68    python3-docutils \
69    python3-fcntl \
70    python3-image \
71    python3-pillow \
72    python3-pygments \
73"
74