diff mbox series

package/sdl2: Add config for wayland, vivante, pulseaudio

Message ID 20230315085103.1671888-2-luke@ljones.dev
State New
Headers show
Series package/sdl2: Add config for wayland, vivante, pulseaudio | expand

Commit Message

Luke Jones March 15, 2023, 8:51 a.m. UTC
Add support for building SDL2 with the following enabled as either optional
or detected:

- Wayland video support, enables running SDL2 applications under
  pure wayland desktops/compositors
- Vivante video device support, this enables SDL2 to run on devices using
  this video chip without a full desktop (much like KMS/DRM)
- Pulseaudio support, this solves an ancient issue that still occurs in
  some cases. Described at: http://forums.libsdl.org/viewtopic.php?t=7609&sid=40fdb9756b8e22e1b8253cda3338845f

Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
 package/sdl2/Config.in | 16 ++++++++++++++++
 package/sdl2/sdl2.mk   | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)

Comments

Luke Jones March 16, 2023, 2:09 p.m. UTC | #1
On Wed, Mar 15 2023 at 09:51:03 +0100, Luke D. Jones <luke@ljones.dev> 
wrote:
> --enable-video-vivante

I made a mistake with -+SDL2_DEPENDENCIES += libdrm_etnaviv, this 
should have been +SDL2_DEPENDENCIES += libdrm

I will submit a revised patch later
diff mbox series

Patch

diff --git a/package/sdl2/Config.in b/package/sdl2/Config.in
index 7c8258fe73b3..365be28c8ddb 100644
--- a/package/sdl2/Config.in
+++ b/package/sdl2/Config.in
@@ -18,6 +18,22 @@  config BR2_PACKAGE_SDL2_DIRECTFB
 comment "DirectFB video driver needs directfb"
 	depends on !BR2_PACKAGE_DIRECTFB
 
+config BR2_PACKAGE_SDL2_WAYLAND
+	bool "wayland video driver"
+	depends on BR2_PACKAGE_WAYLAND
+
+comment "wayland video driver needs wayland"
+	depends on !BR2_PACKAGE_WAYLAND
+
+config BR2_PACKAGE_SDL2_PULSEAUDIO
+	bool "pulseaudio support"
+	depends on BR2_PACKAGE_PULSEAUDIO
+	depends on BR2_PACKAGE_ALSA_LIB
+
+comment "pulseaudio support needs the pulseaudio and alsa packages"
+	depends on !BR2_PACKAGE_PULSEAUDIO
+	depends on !BR2_PACKAGE_ALSA_LIB
+
 config BR2_PACKAGE_SDL2_X11
 	bool "X11 video driver"
 	depends on BR2_PACKAGE_XORG7
diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk
index c01f12d12cf7..12bfe0eb1592 100644
--- a/package/sdl2/sdl2.mk
+++ b/package/sdl2/sdl2.mk
@@ -81,6 +81,20 @@  else
 SDL2_CONF_OPTS += --disable-video-directfb
 endif
 
+ifeq ($(BR2_PACKAGE_SDL2_WAYLAND),y)
+SDL2_DEPENDENCIES += wayland
+SDL2_CONF_OPTS += --enable-video-wayland
+else
+SDL2_CONF_OPTS += --disable-video-wayland
+endif
+
+ifeq ($(BR2_PACKAGE_SDL2_PULSEAUDIO),y)
+SDL2_DEPENDENCIES += pulseaudio
+SDL2_CONF_OPTS += --enable-pulseaudio
+else
+SDL2_CONF_OPTS += --disable-pulseaudio
+endif
+
 ifeq ($(BR2_PACKAGE_SDL2_OPENGLES)$(BR2_PACKAGE_RPI_USERLAND),yy)
 SDL2_DEPENDENCIES += rpi-userland
 SDL2_CONF_OPTS += --enable-video-rpi
@@ -181,4 +195,11 @@  else
 SDL2_CONF_OPTS += --disable-video-kmsdrm
 endif
 
+ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
+SDL2_DEPENDENCIES += libdrm_etnaviv
+SDL2_CONF_OPTS += --enable-video-vivante
+else
+SDL2_CONF_OPTS += --disable-video-vivante
+endif
+
 $(eval $(autotools-package))