Skip to contentSkip to conversation

python3-kivy: Remove hardcoded include paths

PATCH In review Khem Raj 2 participants 5 messages Sep 4, 2021 – Sep 7, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 python3-kivy: Remove hardcoded include paths

Use RECIPE_SYSROOT instead of synthesizing the sysroot

Cc William Huang <[email protected]>
---
 .../0001-add-support-for-glesv2.patch         | 20 ++++++++++++++++---
 .../python/python3-kivy_2.0.0.bb              |  2 +-
 2 files changed, 18 insertions(+), 4 deletions(-)
meta-python/recipes-devtools/python/python3-kivy/0001-add-support-for-glesv2.patch +17 -3
index e50c7e7e24..bb236b4195 100644
@@ -1,8 +1,6 @@
-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():
+@@ -695,7 +695,18 @@ def determine_gl_flags():
          c_options['use_x11'] = True
          c_options['use_egl'] = True
      else:
@@ -22,3 +20,19 @@ index 9a507c6c4..3f5b70866 100644
      return flags, base_flags
 
 
+@@ -723,14 +734,13 @@ def determine_sdl2():
+             sdl_inc = join(include, 'SDL2')
+             if isdir(sdl_inc):
+                 sdl2_paths.append(sdl_inc)
+-        sdl2_paths.extend(['/usr/local/include/SDL2', '/usr/include/SDL2'])
+
+     flags['include_dirs'] = sdl2_paths
+     flags['extra_link_args'] = []
+     flags['extra_compile_args'] = []
+     flags['library_dirs'] = (
+         sdl2_paths if sdl2_paths else
+-        ['/usr/local/lib/'])
++        [''])
+
+     if sdl2_flags:
+         flags = merge(flags, sdl2_flags)
meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb +1 -1
index 3f6bafda81..63c2ae7334 100644
@@ -39,7 +39,7 @@ export USE_X11
 KIVY_GRAPHICS = "gles"
 export KIVY_GRAPHICS
 
-KIVY_CROSS_SYSROOT="${WORKDIR}/recipe-sysroot"
+KIVY_CROSS_SYSROOT="${RECIPE_SYSROOT}"
 export KIVY_CROSS_SYSROOT
 
 DEPENDS += " \

--
2.33.0

author
#1 lore raw

PATCH 2/3 python3-kivy: Check for x11 and opengl before enabling the recipe

Fixes

ERROR: Nothing PROVIDES 'libsdl2-ttf' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb DEPENDS on or otherwise requires it) libsdl2-ttf was skipped: missing required distro feature 'opengl' (not in DISTRO_FEATURES)
ERROR: Nothing RPROVIDES 'python3-kivy-dev' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'python3-kivy-dev'
NOTE: Runtime target 'python3-kivy-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-kivy-dev']
ERROR: Nothing RPROVIDES 'python3-kivy' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'python3-kivy'
NOTE: Runtime target 'python3-kivy' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-kivy']

Cc Martin Jansa <[email protected]>
Cc William Huang <[email protected]>
---
 meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb +3 -1
index 63c2ae7334..29a050a891 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "https://kivy.org/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=f0c851d60495c7e27225a819e179208a"
 
-inherit setuptools3
+inherit setuptools3 pkgconfig distro_features_check
 
 SRC_URI = "\
     git://github.com/kivy/kivy.git;protocol=git;\
@@ -42,6 +42,8 @@ export KIVY_GRAPHICS
 KIVY_CROSS_SYSROOT="${RECIPE_SYSROOT}"
 export KIVY_CROSS_SYSROOT
 
+REQUIRED_DISTRO_FEATURES += "x11 opengl"
+
 DEPENDS += " \
     gstreamer1.0 \
     gstreamer1.0-python \

--
2.33.0

author
#2 lore raw

Re: [meta-python][PATCH 2/3] python3-kivy: Check for x11 and opengl before enabling the recipe

Quoted 26 lines · Khem Raj

Fixes

ERROR: Nothing PROVIDES 'libsdl2-ttf' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb DEPENDS on or otherwise requires it) libsdl2-ttf was skipped: missing required distro feature 'opengl' (not in DISTRO_FEATURES)
ERROR: Nothing RPROVIDES 'python3-kivy-dev' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'python3-kivy-dev'
NOTE: Runtime target 'python3-kivy-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-kivy-dev']
ERROR: Nothing RPROVIDES 'python3-kivy' (but meta-openembedded/meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb RDEPENDS on or otherwise requires it) No eligible RPROVIDERs exist for 'python3-kivy'
NOTE: Runtime target 'python3-kivy' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-kivy']

Cc Martin Jansa <[email protected]>
Cc William Huang <[email protected]>
---
 meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb +0 -0
index 63c2ae7334..29a050a891 100644

meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb HOMEPAGE = "https://kivy.org/" · line 7

Quoted 5 lines
meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb +1 -1
@@ -4,7 +4,7 @@ HOMEPAGE = "https://kivy.org/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=f0c851d60495c7e27225a819e179208a"
 
-inherit setuptools3
+inherit setuptools3 pkgconfig distro_features_check

this should be using features_check I have fixed it before staging into master-next

Quoted 14 lines
meta-python/recipes-devtools/python/python3-kivy_2.0.0.bb +2 -1
 SRC_URI = "\
     git://github.com/kivy/kivy.git;protocol=git;\
@@ -42,6 +42,8 @@ export KIVY_GRAPHICS
 KIVY_CROSS_SYSROOT="${RECIPE_SYSROOT}"
 export KIVY_CROSS_SYSROOT
 
+REQUIRED_DISTRO_FEATURES += "x11 opengl"
+
 DEPENDS += " \
     gstreamer1.0 \
     gstreamer1.0-python \
--

2.33.0

author
#3 lore raw

PATCH 3/3 packagegroup-meta-python: Add python3-kivy

In reply to Khem Raj
---
 .../recipes-core/packagegroups/packagegroup-meta-python.bb       | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb +1 -0
index b5a2f5d7d9..2d51b4e1a3 100644
@@ -210,6 +210,7 @@ RDEPENDS:packagegroup-meta-python3 = "\
     python3-kconfiglib \
     python3-keras-applications \
     python3-keras-preprocessing \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11 opengl", "python3-kivy", "", d)} \
     python3-kiwisolver \
     python3-langtable \
     python3-lazy-object-proxy \

--
2.33.0

#4 lore raw

Re: [oe] [meta-python][PATCH 3/3] packagegroup-meta-python: Add python3-kivy

Thanks for fixing up the recipe!

Quoted 23 lines · Khem Raj
---
 .../recipes-core/packagegroups/packagegroup-meta-python.bb       | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb +1 -1
index b5a2f5d7d9..2d51b4e1a3 100644
@@ -210,6 +210,7 @@ RDEPENDS:packagegroup-meta-python3 = "\
     python3-kconfiglib \
     python3-keras-applications \
     python3-keras-preprocessing \
+    ${@bb.utils.contains("DISTRO_FEATURES", "x11 opengl", "python3-kivy", "", d)} \
     python3-kiwisolver \
     python3-langtable \
     python3-lazy-object-proxy \
--

2.33.0