diff mbox series

[v2,2/4] package/kodi: add optional support for wayland

Message ID 20200202173333.305860-2-bernd.kuhls@t-online.de
State Accepted
Headers show
Series [1/4] package/libinput: remove dependency on BR2_ENABLE_LOCALE | expand

Commit Message

Bernd Kuhls Feb. 2, 2020, 5:33 p.m. UTC
For details see upstream PR 12664.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
v2: no changes

 package/kodi/Config.in | 44 +++++++++++++++++++++++++++++++++++++++---
 package/kodi/kodi.mk   | 16 +++++++++++++++
 2 files changed, 57 insertions(+), 3 deletions(-)

Comments

Thomas Petazzoni Feb. 3, 2020, 10:26 a.m. UTC | #1
Hello,

On Sun,  2 Feb 2020 18:33:31 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> For details see upstream PR 12664.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

I've applied, with a few changes, see below.

> +config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GL
> +	bool
> +	default y

I've added a

	depends on BR2_PACKAGE_HAS_LIBGL

cause you then depend on "libgl".

> +	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # waylandpp
> +	depends on BR2_HOST_GCC_AT_LEAST_4_9 # waylandpp
> +	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # waylandpp
> +	depends on BR2_PACKAGE_WAYLAND # waylandpp
> +	select BR2_PACKAGE_WAYLANDPP

You should not add such selects to blind options that are "default y".
Indeed here, waylandpp is going to be selected as soon as all the
dependencies of this option are met, regardless of whether you really
enable Kodi's Wayland backend.

So I moved the select to BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GL.

> +config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GLES
> +	bool
> +	default y
> +	depends on BR2_PACKAGE_HAS_LIBGLES
> +	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # waylandpp
> +	depends on BR2_HOST_GCC_AT_LEAST_4_9 # waylandpp
> +	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # waylandpp
> +	depends on BR2_PACKAGE_WAYLAND # waylandpp
> +	select BR2_PACKAGE_WAYLANDPP

Ditto here.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/kodi/Config.in b/package/kodi/Config.in
index 2782da5953..0f2f4e2df2 100644
--- a/package/kodi/Config.in
+++ b/package/kodi/Config.in
@@ -27,6 +27,27 @@  config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_RBPI
 	depends on BR2_PACKAGE_HAS_UDEV # libinput
 	select BR2_PACKAGE_KODI_PLATFORM_SUPPORTS
 
+config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GL
+	bool
+	default y
+	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # waylandpp
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # waylandpp
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # waylandpp
+	depends on BR2_PACKAGE_WAYLAND # waylandpp
+	select BR2_PACKAGE_WAYLANDPP
+	select BR2_PACKAGE_KODI_PLATFORM_SUPPORTS
+
+config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GLES
+	bool
+	default y
+	depends on BR2_PACKAGE_HAS_LIBGLES
+	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # waylandpp
+	depends on BR2_HOST_GCC_AT_LEAST_4_9 # waylandpp
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # waylandpp
+	depends on BR2_PACKAGE_WAYLAND # waylandpp
+	select BR2_PACKAGE_WAYLANDPP
+	select BR2_PACKAGE_KODI_PLATFORM_SUPPORTS
+
 config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_X11_OPENGL
 	bool
 	default y
@@ -189,6 +210,17 @@  config BR2_PACKAGE_KODI_PLATFORM_RBPI
 	select BR2_PACKAGE_LIBINPUT
 	select BR2_PACKAGE_LIBXKBCOMMON
 
+config BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GL
+	bool "Wayland/OpenGL"
+	depends on BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GL
+	select BR2_PACKAGE_LIBGLU
+	select BR2_PACKAGE_LIBXKBCOMMON
+
+config BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GLES
+	bool "Wayland/GLES"
+	depends on BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND_GLES
+	select BR2_PACKAGE_LIBXKBCOMMON
+
 config BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL
 	bool "X11/OpenGL"
 	depends on BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_X11_OPENGL
@@ -242,13 +274,19 @@  config BR2_PACKAGE_KODI_LIBUSB
 
 config BR2_PACKAGE_KODI_LIBVA
 	bool "va"
-	depends on BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL
+	depends on \
+		BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GL || \
+		BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GLES || \
+		BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL
 	select BR2_PACKAGE_LIBVA
 	help
 	  Enable libva support.
 
-comment "libva support needs platform 'X11/OpenGL'"
-	depends on !BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL
+comment "libva support needs platform 'Wayland' or 'X11/OpenGL'"
+	depends on \
+		!BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GL && \
+		!BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GLES && \
+		!BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL
 
 config BR2_PACKAGE_KODI_LIBVDPAU
 	bool "vdpau"
diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
index 1036151a89..2f2a92a889 100644
--- a/package/kodi/kodi.mk
+++ b/package/kodi/kodi.mk
@@ -174,6 +174,22 @@  KODI_CONF_OPTS += -DCORE_PLATFORM_NAME=rbpi
 KODI_DEPENDENCIES += libinput libxkbcommon rpi-userland
 endif
 
+ifeq ($(BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GL),y)
+KODI_CONF_OPTS += \
+	-DCORE_PLATFORM_NAME=wayland \
+	-DWAYLAND_RENDER_SYSTEM=gl
+KODI_DEPENDENCIES += libegl libgl libglu libxkbcommon waylandpp
+endif
+
+ifeq ($(BR2_PACKAGE_KODI_PLATFORM_WAYLAND_GLES),y)
+KODI_CONF_OPTS += \
+	-DCORE_PLATFORM_NAME=wayland \
+	-DWAYLAND_RENDER_SYSTEM=gles
+KODI_C_FLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
+KODI_CXX_FLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
+KODI_DEPENDENCIES += libegl libgles libxkbcommon waylandpp
+endif
+
 ifeq ($(BR2_PACKAGE_KODI_PLATFORM_X11_OPENGL),y)
 KODI_CONF_OPTS += -DCORE_PLATFORM_NAME=x11
 KODI_DEPENDENCIES += libegl libglu libgl xlib_libX11 xlib_libXext \