* [meta-python][PATCH] recipes-devtools: python: add support for Kivy
@ 2021-09-02 11:25 William Huang
2021-10-20 17:08 ` [oe] " Martin Jansa
0 siblings, 1 reply; 2+ messages in thread
From: William Huang @ 2021-09-02 11:25 UTC (permalink / raw)
To: openembedded-devel; +Cc: William Huang
---
.../0001-add-support-for-glesv2.patch | 24 +++++++
.../python/python3-kivy_2.0.0.bb | 71 +++++++++++++++++++
2 files changed, 95 insertions(+)
create mode 100644 meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
create mode 100644 meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
diff --git a/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch b/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
new file mode 100644
index 000000000..e50c7e7e2
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
@@ -0,0 +1,24 @@
+diff --git a/setup.py b/setup.py
+index 9a507c6c4..3f5b70866 100644
+--- a/setup.py
++++ b/setup.py
+@@ -680,7 +680,18 @@ def determine_gl_flags():
+ c_options['use_x11'] = True
+ c_options['use_egl'] = True
+ else:
+- flags['libraries'] = ['GL']
++ if cross_sysroot:
++ flags['include_dirs'] = [cross_sysroot + '/usr/include']
++ flags['library_dirs'] = [cross_sysroot + '/usr/lib']
++
++ if c_options['use_opengl_es2']:
++ print("using GLESv2 libraries")
++ flags['libraries'] = ['GLESv2']
++ else:
++ flags['libraries'] = ['GL']
++
++
++ print("cross_sysroot: " + str(cross_sysroot))
+ return flags, base_flags
+
+
diff --git a/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb b/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
new file mode 100644
index 000000000..3f6bafda8
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Open source Python library for rapid development of applications \
+ that make use of innovative user interfaces, such as multi-touch apps."
+HOMEPAGE = "https://kivy.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f0c851d60495c7e27225a819e179208a"
+
+inherit setuptools3
+
+SRC_URI = "\
+ git://github.com/kivy/kivy.git;protocol=git;\
+"
+
+# Kivy's setup files only look for GLES libraries for Android, iOS, RPi,
+# and mali-based OS's. We need to patch the setup file to tell Kivy setup
+# that our machine has GLES libaries installed as well
+# Also, if using SDL2 as backend, SDL2 needs to be configured wth gles
+SRC_URI += " \
+ file://0001-add-support-for-glesv2.patch \
+"
+SRCREV = "dedcb6bcabe3d8d6758dcee607e8c33b174d782b"
+
+S = "${WORKDIR}/git"
+
+PACKAGES += "${PN}-examples"
+FILES:${PN}-examples = "/usr/share/kivy-examples"
+
+USE_WAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '1', '0', d)}"
+export USE_WAYLAND
+
+# if using Wayland, let's use pure Wayland (and not XWayland)
+# so do not build using X11 flag when we detect Wayland
+USE_X11 = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '0', \
+ bb.utils.contains('DISTRO_FEATURES', 'x11', '1', \
+ '0', d), d)}"
+export USE_X11
+
+# Use OpenGL ES 2.0 library
+KIVY_GRAPHICS = "gles"
+export KIVY_GRAPHICS
+
+KIVY_CROSS_SYSROOT="${WORKDIR}/recipe-sysroot"
+export KIVY_CROSS_SYSROOT
+
+DEPENDS += " \
+ gstreamer1.0 \
+ gstreamer1.0-python \
+ libsdl2 \
+ libsdl2-ttf \
+ libsdl2-image \
+ libsdl2-mixer \
+ pango \
+ python3 \
+ python3-cython-native \
+"
+
+RDEPENDS_${PN} = " \
+ gstreamer1.0 \
+ gstreamer1.0-python \
+ libsdl2 \
+ libsdl2-ttf \
+ libsdl2-image \
+ libsdl2-mixer \
+ pango \
+ python3 \
+ python3-docutils \
+ python3-fcntl \
+ python3-image \
+ python3-pillow \
+ python3-pygments \
+"
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [oe] [meta-python][PATCH] recipes-devtools: python: add support for Kivy
2021-09-02 11:25 [meta-python][PATCH] recipes-devtools: python: add support for Kivy William Huang
@ 2021-10-20 17:08 ` Martin Jansa
0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2021-10-20 17:08 UTC (permalink / raw)
To: William Huang; +Cc: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 4537 bytes --]
This RDEPENDS_ syntax is no longer valid, please update to RDEPENDS:.
On Thu, Sep 2, 2021 at 1:25 PM William Huang <whuang8933@gmail.com> wrote:
> ---
> .../0001-add-support-for-glesv2.patch | 24 +++++++
> .../python/python3-kivy_2.0.0.bb | 71 +++++++++++++++++++
> 2 files changed, 95 insertions(+)
> create mode 100644
> meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
> create mode 100644 meta-python/recipes-devtools/python/
> python3-kivy_2.0.0.bb
>
> diff --git
> a/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
> b/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
> new file mode 100644
> index 000000000..e50c7e7e2
> --- /dev/null
> +++
> b/meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch
> @@ -0,0 +1,24 @@
> +diff --git a/setup.py b/setup.py
> +index 9a507c6c4..3f5b70866 100644
> +--- a/setup.py
> ++++ b/setup.py
> +@@ -680,7 +680,18 @@ def determine_gl_flags():
> + c_options['use_x11'] = True
> + c_options['use_egl'] = True
> + else:
> +- flags['libraries'] = ['GL']
> ++ if cross_sysroot:
> ++ flags['include_dirs'] = [cross_sysroot + '/usr/include']
> ++ flags['library_dirs'] = [cross_sysroot + '/usr/lib']
> ++
> ++ if c_options['use_opengl_es2']:
> ++ print("using GLESv2 libraries")
> ++ flags['libraries'] = ['GLESv2']
> ++ else:
> ++ flags['libraries'] = ['GL']
> ++
> ++
> ++ print("cross_sysroot: " + str(cross_sysroot))
> + return flags, base_flags
> +
> +
> diff --git a/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
> b/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
> new file mode 100644
> index 000000000..3f6bafda8
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb
> @@ -0,0 +1,71 @@
> +SUMMARY = "Open source Python library for rapid development of
> applications \
> + that make use of innovative user interfaces, such as multi-touch
> apps."
> +HOMEPAGE = "https://kivy.org/"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=f0c851d60495c7e27225a819e179208a"
> +
> +inherit setuptools3
> +
> +SRC_URI = "\
> + git://github.com/kivy/kivy.git;protocol=git;\
> +"
> +
> +# Kivy's setup files only look for GLES libraries for Android, iOS, RPi,
> +# and mali-based OS's. We need to patch the setup file to tell Kivy setup
> +# that our machine has GLES libaries installed as well
> +# Also, if using SDL2 as backend, SDL2 needs to be configured wth gles
> +SRC_URI += " \
> + file://0001-add-support-for-glesv2.patch \
> +"
> +SRCREV = "dedcb6bcabe3d8d6758dcee607e8c33b174d782b"
> +
> +S = "${WORKDIR}/git"
> +
> +PACKAGES += "${PN}-examples"
> +FILES:${PN}-examples = "/usr/share/kivy-examples"
> +
> +USE_WAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '1',
> '0', d)}"
> +export USE_WAYLAND
> +
> +# if using Wayland, let's use pure Wayland (and not XWayland)
> +# so do not build using X11 flag when we detect Wayland
> +USE_X11 = " \
> + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '0', \
> + bb.utils.contains('DISTRO_FEATURES', 'x11', '1', \
> + '0', d), d)}"
> +export USE_X11
> +
> +# Use OpenGL ES 2.0 library
> +KIVY_GRAPHICS = "gles"
> +export KIVY_GRAPHICS
> +
> +KIVY_CROSS_SYSROOT="${WORKDIR}/recipe-sysroot"
> +export KIVY_CROSS_SYSROOT
> +
> +DEPENDS += " \
> + gstreamer1.0 \
> + gstreamer1.0-python \
> + libsdl2 \
> + libsdl2-ttf \
> + libsdl2-image \
> + libsdl2-mixer \
> + pango \
> + python3 \
> + python3-cython-native \
> +"
> +
> +RDEPENDS_${PN} = " \
> + gstreamer1.0 \
> + gstreamer1.0-python \
> + libsdl2 \
> + libsdl2-ttf \
> + libsdl2-image \
> + libsdl2-mixer \
> + pango \
> + python3 \
> + python3-docutils \
> + python3-fcntl \
> + python3-image \
> + python3-pillow \
> + python3-pygments \
> +"
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#92832):
> https://lists.openembedded.org/g/openembedded-devel/message/92832
> Mute This Topic: https://lists.openembedded.org/mt/85324963/3617156
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> Martin.Jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
[-- Attachment #2: Type: text/html, Size: 6729 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-20 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 11:25 [meta-python][PATCH] recipes-devtools: python: add support for Kivy William Huang
2021-10-20 17:08 ` [oe] " Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).