Skip to contentSkip to conversation

Add support for the WPE WebKit RDK backend

PATCH Superseded Adrian Perez de Castro 3 participants 20 messages Feb 8, 2024 – Sep 2, 2024

lore
Share & tools
lore
#0 lore raw

cover Add support for the WPE WebKit RDK backend

Hello all,

This patch series allows using the RDK backend for WPE WebKit. Currently the main use case is to run WPEWebKit on RaspberryPi boards using on Dispmanx via the rpi-userland EGL/GLES libraries.

In order to allow using the new wpebackend-rdk package I needed to un-hardcode usage of wpebackend-fdo, in two places:

- The cog package may be built without wpebackend-fdo, passing an empty list of platform plug-ins. It has built-in support to load "simple" WPE backends like wpebackend-rdk. This was done by adding a config option for the headless plug-in, instead of always building it, and adjusting dependencies.

- The wpewebkit package does not need wpebackend-fdo at all during the build. It only needs a backend installed at run time. This means it is enough to make wpewebkit have a "depends on" on any of the backends, to make sure they will be in the build, but none needs to be listed in WPEWEBKIT_DEPENDENCIES.

I have tested this making builds based on raspberrypi3_defconfig, adding rpi-userland and then picking wpebackend-rdk + wpewebkit + cog.

Hopefully the patch set is fine and nothing has slipped in the Kconfig dependencies (typically my weakest part of Buildroot contributions).

Best regards,
-Adrian

Adrian Perez de Castro (3):
package/wpebackend-rdk: new package package/cog: depend on wpebackend-fdo only if needed package/wpewebkit: do not depend on wpebackend-fdo

 package/Config.in                          |  1 +
 package/cog/Config.in                      | 28 ++++++++++-
 package/cog/cog.mk                         | 13 +++--
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 package/wpewebkit/Config.in                |  9 ++--
 package/wpewebkit/wpewebkit.mk             |  2 +-
 8 files changed, 147 insertions(+), 11 deletions(-)
 create mode 100644 package/wpebackend-rdk/Config.in
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.hash
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.mk

--
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

PATCH 1/3 package/wpebackend-rdk: new package

The wpebackend-rdk can be used as an alternative to wpebackend-fdo in some cases, and also supports a few additional configurations. For now only the Wayland-EGL and Broadcom RaspberryPi userland implementations can be enabled. The former is useful for testing, and the latter allows using WPE WebKit directly on top of Dispmanx in combination with the rpi-userland package in supported RaspberryPi models.

This only adds the new package, follow-up commits will un-hardcode the usage of wpebackend-fdo and allow selecting either which of both to build.

---
 package/Config.in                          |  1 +
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 4 files changed, 106 insertions(+)
 create mode 100644 package/wpebackend-rdk/Config.in
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.hash
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.mk
package/Config.in +1 -0
index 91a6f1de00d..99bd6fee22e 100644
@@ -1723,6 +1723,7 @@ menu "Graphics"
 	source "package/wlroots/Config.in"
 	source "package/woff2/Config.in"
 	source "package/wpebackend-fdo/Config.in"
+	source "package/wpebackend-rdk/Config.in"
 	source "package/wpewebkit/Config.in"
 	source "package/zbar/Config.in"
 	source "package/zxing-cpp/Config.in"
package/wpebackend-rdk/Config.in new file +57 -0

57 lines not on this page · raw message

package/wpebackend-rdk/wpebackend-rdk.hash new file +5 -0
new file mode 100644
index 00000000000..af7dab6a365
@@ -0,0 +1,5 @@
+# Generated locally
+sha256  4c6ae288cf66f0a47052a50972e3d3727617c4c3e104db20494a3c5feb262f40  wpebackend-rdk-4.4.1.tar.gz
+
+# License files
+sha256  a5ba969938c2896411ea1a23ee7d9ccb68306a65615b6711afe738c8f6ff2153  COPYING
package/wpebackend-rdk/wpebackend-rdk.mk new file +43 -0

43 lines not on this page · raw message

Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/3 package/cog: depend on wpebackend-fdo only if needed

In reply to Adrian Perez de Castro

Make the Cog headless platform plug-in selectable, allowing to configure the build without any plug-in at all. When all plug-ins are disabled, Cog does not require wpebackend-fdo at build time, and it is still able to use its built-in "fallback" support to load other WPE backends like wpebackend-rdk.

---
 package/cog/Config.in | 28 ++++++++++++++++++++++++++--
 package/cog/cog.mk    | 13 ++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)
package/cog/Config.in +26 -2
index d2a910f9b89..d706b045b15 100644
@@ -19,6 +19,10 @@ config BR2_PACKAGE_COG
 
 if BR2_PACKAGE_COG
 
+config BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	bool
+	default n
+
 config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 	string "home uri"
 	default "https://wpewebkit.org"
@@ -30,6 +34,8 @@ config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 config BR2_PACKAGE_COG_PLATFORM_FDO
 	bool "Wayland backend"
 	default y
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
 	select BR2_PACKAGE_LIBXKBCOMMON
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	help
@@ -43,6 +49,8 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	depends on BR2_PACKAGE_HAS_LIBGBM
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBINPUT
 	help
@@ -50,16 +58,32 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	  with video drivers that support kernel mode-setting (KMS)
 	  via the DRM user-space API.
 
+config BR2_PACKAGE_COG_PLATFORM_HEADLESS
+	bool "Headless backend"
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	help
+	  Enable the headless platform backend.
+
 config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
 	bool "expose system D-Bus control interface"
 	help
 	  Expose remote control interface on system bus
 
-comment "DRM platform needs EGL and GBM"
+comment "Headless platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "DRM platform needs EGL, GBM, wpebackend-fdo"
 	depends on \
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBGBM || \
 		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF || \
-		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT || \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "Wayland platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
 
 endif
package/cog/cog.mk +10 -3
index e96909f7796..8fc50de56f1 100644
@@ -8,7 +8,7 @@ COG_VERSION = 0.18.2
 COG_SITE = https://wpewebkit.org/releases
 COG_SOURCE = cog-$(COG_VERSION).tar.xz
 COG_INSTALL_STAGING = YES
-COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo wayland
+COG_DEPENDENCIES = dbus wpewebkit wayland
 COG_LICENSE = MIT
 COG_LICENSE_FILES = COPYING
 COG_CONF_OPTS = \
@@ -19,8 +19,6 @@ COG_CONF_OPTS = \
 	-Dcog_home_uri='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))' \
 	-Dplatforms='$(subst $(space),$(comma),$(strip $(COG_PLATFORMS_LIST)))'
 
-COG_PLATFORMS_LIST = headless
-
 ifeq ($(BR2_PACKAGE_WESTON),y)
 COG_CONF_OPTS += -Dwayland_weston_direct_display=true
 COG_DEPENDENCIES += weston
@@ -28,6 +26,11 @@ else
 COG_CONF_OPTS += -Dwayland_weston_direct_display=false
 endif
 
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
+COG_PLATFORMS_LIST += headless
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
 COG_PLATFORMS_LIST += wayland
 COG_DEPENDENCIES += libxkbcommon wayland-protocols
@@ -48,4 +51,8 @@ ifeq ($(BR2_PACKAGE_LIBMANETTE),y)
 COG_DEPENDENCIES += libmanette
 endif
 
+ifeq ($(BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO),y)
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 $(eval $(meson-package))
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/3 package/wpewebkit: do not depend on wpebackend-fdo

In reply to Adrian Perez de Castro

Remove the wpewebkit package dependency on wpebackend-fdo, as it is not needed at all during the build. What is needed is a WPE backend at run time, which may be provided by wpebackend-fdo or wpebackend-rdk. To reflect this, we make wpewebkit depend on either being selected.

---
 package/wpewebkit/Config.in    | 9 ++++-----
 package/wpewebkit/wpewebkit.mk | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
package/wpewebkit/Config.in +4 -5
index 432aa4c3a30..779af0c892e 100644
@@ -24,11 +24,11 @@ comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc
 		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
 		|| !BR2_HOST_GCC_AT_LEAST_4_9
 
-comment "wpewebkit needs an OpenGL ES w/ EGL-capable Wayland backend"
+comment "wpewebkit needs an OpenGL ES w/ EGL-capable implementation and an WPE backend"
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
 	depends on !BR2_BINFMT_FLAT
-	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL \
-		|| !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL
+	depends on !BR2_PACKAGE_WPEBACKEND_FDO && !BR2_PACKAGE_WPEBACKEND_RDK
 
 config BR2_PACKAGE_WPEWEBKIT
 	bool "wpewebkit"
@@ -41,8 +41,8 @@ config BR2_PACKAGE_WPEWEBKIT
 	depends on BR2_USE_WCHAR # icu, libsoup3
 	depends on BR2_PACKAGE_HAS_LIBGLES # libepoxy
 	depends on BR2_PACKAGE_HAS_LIBEGL # libepoxy
-	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # wpebackend-fdo
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_WPEBACKEND_FDO || BR2_PACKAGE_WPEBACKEND_RDK
 	select BR2_PACKAGE_CAIRO
 	select BR2_PACKAGE_CAIRO_PNG
 	select BR2_PACKAGE_HARFBUZZ
@@ -59,7 +59,6 @@ config BR2_PACKAGE_WPEWEBKIT
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	select BR2_PACKAGE_WEBP
 	select BR2_PACKAGE_WEBP_DEMUX
-	select BR2_PACKAGE_WPEBACKEND_FDO
 	help
 	  WPE (Web Platform for Embedded) port of the WebKit engine,
 	  to allow embedders to create simple and performant systems
package/wpewebkit/wpewebkit.mk +1 -1
index 13143efb38b..e54ec2952ff 100644
@@ -16,7 +16,7 @@ WPEWEBKIT_CPE_ID_VENDOR = wpewebkit
 WPEWEBKIT_CPE_ID_PRODUCT = wpe_webkit
 WPEWEBKIT_DEPENDENCIES = host-gperf host-python3 host-ruby host-unifdef \
 	harfbuzz cairo icu jpeg libepoxy libgcrypt libgles libsoup3 libtasn1 \
-	libpng libxslt openjpeg wayland-protocols webp wpebackend-fdo
+	libpng libxslt libwpe openjpeg wayland-protocols webp
 
 WPEWEBKIT_CMAKE_BACKEND = ninja
 
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Adrian Perez de Castro

Hello Adrian,

Quoted 3 lines · On Thu, 8 Feb 2024 11:55:27 +0200 Adrian Perez de Castro <[email protected]>…

This patch series allows using the RDK backend for WPE WebKit. Currently the main use case is to run WPEWebKit on RaspberryPi boards using on Dispmanx via the rpi-userland EGL/GLES libraries.

Thanks for this patch series!

We have some other patches in patchwork related to webkit:

Some from you:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Are they still valid/application?

We also have twice the same (?) patch from Giulio:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

is it relevant?

Could you have a look so we can hopefully clear up the backlog?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Hi Thomas, all,

Quoted 10 lines · On Thu, 08 Feb 2024 11:29:40 +0100 Thomas Petazzoni…

Hello Adrian,

Quoted 3 lines · On Thu, 8 Feb 2024 11:55:27 +0200 Adrian Perez de Castro <[email protected]>…

This patch series allows using the RDK backend for WPE WebKit. Currently the main use case is to run WPEWebKit on RaspberryPi boards using on Dispmanx via the rpi-userland EGL/GLES libraries.

Thanks for this patch series!

:-)

Quoted 8 lines

We have some other patches in patchwork related to webkit:

Some from you:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Are they still valid/application?

These two are no longer needed after the update to wpewebkit and webkitgtk 2.44.x

Quoted 6 lines

We also have twice the same (?) patch from Giulio:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

is it relevant?

I think these two shouldn't be needed anymore, Giulio sent a PR to upstream WebKit which ended up being merged [1] and it was included in the 2.44.x releases as well.

Quoted 2 lines

Could you have a look so we can hopefully clear up the backlog? Thanks a lot!

My apologies for taking so long to reply, somehow I managed to let this slip ^_^

Cheers,
—Adrián

---
[1] https://github.com/WebKit/WebKit/commit/360f2f938bba406c0e9bff52710a13c74eb8d1e9

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Hello All,

On 15/06/24 01:45, Adrian Perez de Castro wrote:
[ SNIP ]

Quoted 11 lines
Quoted 6 lines

We also have twice the same (?) patch from Giulio:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

is it relevant?

I think these two shouldn't be needed anymore, Giulio sent a PR to upstream WebKit which ended up being merged [1] and it was included in the 2.44.x releases as well.

I have missed Github notification on merge 1 year ago. Anyway I've marked both patches as rejected on Patchwork since they are upstreamed.

Best regards

Signature · 6 lines
Giulio Benetti
CEO&CTO@Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw
In reply to Adrian Perez de Castro

Hello Adrian,

Quoted 9 lines · On Sat, 15 Jun 2024 02:45:13 +0300 Adrian Perez de Castro <[email protected]>…
Quoted 6 lines

Some from you:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Are they still valid/application?

These two are no longer needed after the update to wpewebkit and webkitgtk 2.44.x

Thanks, I marked those two patches as "Superseded".

Quoted 10 lines
Quoted 6 lines

We also have twice the same (?) patch from Giulio:

https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

is it relevant?

I think these two shouldn't be needed anymore, Giulio sent a PR to upstream WebKit which ended up being merged [1] and it was included in the 2.44.x releases as well.

ACK, Giulio took care of changing the state of those other two patches in patchwork.

Quoted 5 lines
Quoted 2 lines

Could you have a look so we can hopefully clear up the backlog? Thanks a lot!

My apologies for taking so long to reply, somehow I managed to let this slip ^_^

No worries :-)

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

PATCH v2 1/4 package/wpebackend-rdk: new package

In reply to Adrian Perez de Castro

The wpebackend-rdk can be used as an alternative to wpebackend-fdo in some cases, and also supports a few additional configurations. For now only the Wayland-EGL and Broadcom RaspberryPi userland implementations can be enabled. The former is useful for testing, and the latter allows using WPE WebKit directly on top of Dispmanx in combination with the rpi-userland package in supported RaspberryPi models.

This only adds the new package, follow-up commits will un-hardcode the usage of wpebackend-fdo and allow selecting either which of both to build.

---
 package/Config.in                          |  1 +
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 4 files changed, 106 insertions(+)
 create mode 100644 package/wpebackend-rdk/Config.in
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.hash
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.mk

---
v1 -> v2:
- Unchanged.

package/Config.in +1 -0
index 550fdc1f411..5dab5de59c1 100644
@@ -1734,6 +1734,7 @@ menu "Graphics"
 	source "package/wlroots/Config.in"
 	source "package/woff2/Config.in"
 	source "package/wpebackend-fdo/Config.in"
+	source "package/wpebackend-rdk/Config.in"
 	source "package/wpewebkit/Config.in"
 	source "package/zbar/Config.in"
 	source "package/zxing-cpp/Config.in"
package/wpebackend-rdk/Config.in new file +57 -0

57 lines not on this page · raw message

package/wpebackend-rdk/wpebackend-rdk.hash new file +5 -0
new file mode 100644
index 00000000000..af7dab6a365
@@ -0,0 +1,5 @@
+# Generated locally
+sha256  4c6ae288cf66f0a47052a50972e3d3727617c4c3e104db20494a3c5feb262f40  wpebackend-rdk-4.4.1.tar.gz
+
+# License files
+sha256  a5ba969938c2896411ea1a23ee7d9ccb68306a65615b6711afe738c8f6ff2153  COPYING
package/wpebackend-rdk/wpebackend-rdk.mk new file +43 -0

43 lines not on this page · raw message

Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

Re: [Buildroot] [PATCH v2 1/4] package/wpebackend-rdk: new package

Hello Adrian,

Quoted 7 lines · On Thu, 27 Jun 2024 22:33:29 +0300 Adrian Perez de Castro <[email protected]>…

The wpebackend-rdk can be used as an alternative to wpebackend-fdo in some cases, and also supports a few additional configurations. For now only the Wayland-EGL and Broadcom RaspberryPi userland implementations can be enabled. The former is useful for testing, and the latter allows using WPE WebKit directly on top of Dispmanx in combination with the rpi-userland package in supported RaspberryPi models.

Quoted 5 lines

This only adds the new package, follow-up commits will un-hardcode the usage of wpebackend-fdo and allow selecting either which of both to build.

I wanted to merge this, but unfortunately:

BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_RPI_USERLAND=y
BR2_PACKAGE_WPEBACKEND_RDK=y
# BR2_TARGET_ROOTFS_TAR is not set

fails to build with:

In file included from /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/bcm-rpi/view-backend.cpp:30:
/home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/input/Libinput/LibinputServer.h:37:10: fatal error: libudev.h: No such file or directory
37 | #include <libudev.h>

      |          ^~~~~~~~~~~

compilation terminated.

as far as I can see, LibinputServer.h includes <libinput.h> and <libudev.h>:

#ifndef KEY_INPUT_HANDLING_VIRTUAL
#include <libudev.h>
#include <libinput.h>
#else
#include <virtualinput.h>
#endif

whenever KEY_INPUT_HANDLING_VIRTUAL is *NOT* defined. And KEY_INPUT_HANDLING_VIRTUAL is only defined when USE_VIRTUAL_KEYBOARD=ON.

I believe you should also properly use the USE_INPUT_UDEV and USE_INPUT_WAYLAND options.

find_package(Libxkbcommon REQUIRED)

libxkbcommon is also a mandatory dependency. Even though it is indirectly pulled in by libwpe, it should be expressed as a direct dependency of wpebackend-rdk.

Quoted 6 lines
---
 package/Config.in                          |  1 +
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 4 files changed, 106 insertions(+)

Please add yourself in the DEVELOPERS file for this package.

package/wpebackend-rdk/Config.in line 4

Quoted 10 lines
package/wpebackend-rdk/Config.in new file +4 -0
new file mode 100644
index 00000000000..6125911bec9
@@ -0,0 +1,57 @@
+comment "wpebackend-rdk needs a toolchain w/ C++, wchar, threads, dynamic library, and rpi-userland or an OpenGL-capable Wayland backend"
+	depends on !(BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND) \
+		|| !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \
+		|| !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

Please split this into two comments, one for the toolchain things, one for the rpi-userland || wayland EGL.

Also, the option BR2_PACKAGE_HAS_LIBEGL_WAYLAND is gone, see commit 4fad6b3c58abd20c533b67b85658bc66d015110b. You can use BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_WAYLAND instead. This needs to be fixed globally.

package/wpebackend-rdk/Config.in line 17

Quoted 12 lines
package/wpebackend-rdk/Config.in new file +12 -0
+config BR2_PACKAGE_WPEBACKEND_RDK
+	bool "wpebackend-rdk"
+	depends on !BR2_STATIC_LIBS # wayland
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBWPE
+	help
+	  WPEBackend interface supporting a number of configurations.

Would be nice to have a slightly extended explanation for the poor souls like that are very confused by libwpe vs. wpebackend-fdo vs. wpebackend-rdk vs. wpewebkit vs. webkitgtk.

package/wpebackend-rdk/Config.in line 22

Quoted 4 lines
package/wpebackend-rdk/Config.in new file +4 -0
+if BR2_PACKAGE_WPEBACKEND_RDK
+
+choice
+	prompt Implementation

Double quotes around "Implementation". Maybe it should be "Backend" instead of "Implementation"?

package/wpebackend-rdk/Config.in line 27

Quoted 5 lines
package/wpebackend-rdk/Config.in new file +5 -0
+	default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI if BR2_PACKAGE_RPI_USERLAND
+	default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL if BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+
+comment "brcm-rpi needs rpi-userland"
+	depends on !BR2_PACKAGE_RPI_USERLAND || !BR2_arm

better expressed as:

depends on BR2_arm
depends on !BR2_PACKAGE_RPI_USERLAND

Quoted 16 lines
package/wpebackend-rdk/Config.in new file +16 -0
+
+config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI
+	bool "brcm-rpi"
+	depends on BR2_arm
+	depends on BR2_PACKAGE_RPI_USERLAND
+	help
+	  Build RaspberryPi support using Broadcom's rpi-userland.
+
+comment "wayland-egl needs an EGL capable Wayland implementation"
+	depends on !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+
+config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL
+	bool "wayland-egl"
+	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	help
+	  Build Wayland-EGL support.

package/wpebackend-rdk/Config.in line 53

Quoted 10 lines
package/wpebackend-rdk/Config.in new file +10 -0
+
+endchoice
+
+if BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI
+
+config BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT
+	bool "libinput support"
+	select BR2_PACKAGE_LIBINPUT
+	help
+	  Support keyboard and mouse input through libinput

Why is the keyboard/mouse support with libinput only available with the brcm-rpi backend? Reading the CMakeLists.txt, I don't really see any relationship.

Could you fix up those different issues and submit a v3 ?

Thanks a lot!

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

Re: [Buildroot] [PATCH v2 1/4] package/wpebackend-rdk: new package

Hi!

Quoted 51 lines · On Fri, 02 Aug 2024 23:00:13 +0200 Thomas Petazzoni via buildroot…
Quoted 7 lines · On Thu, 27 Jun 2024 22:33:29 +0300 Adrian Perez de Castro <[email protected]>…

The wpebackend-rdk can be used as an alternative to wpebackend-fdo in some cases, and also supports a few additional configurations. For now only the Wayland-EGL and Broadcom RaspberryPi userland implementations can be enabled. The former is useful for testing, and the latter allows using WPE WebKit directly on top of Dispmanx in combination with the rpi-userland package in supported RaspberryPi models.

Quoted 5 lines

This only adds the new package, follow-up commits will un-hardcode the usage of wpebackend-fdo and allow selecting either which of both to build.

I wanted to merge this, but unfortunately:

BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_RPI_USERLAND=y
BR2_PACKAGE_WPEBACKEND_RDK=y
# BR2_TARGET_ROOTFS_TAR is not set

fails to build with:

In file included from /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/bcm-rpi/view-backend.cpp:30:
/home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/input/Libinput/LibinputServer.h:37:10: fatal error: libudev.h: No such file or directory
37 | #include <libudev.h>

      |          ^~~~~~~~~~~

compilation terminated.

as far as I can see, LibinputServer.h includes <libinput.h> and <libudev.h>:

#ifndef KEY_INPUT_HANDLING_VIRTUAL
#include <libudev.h>
#include <libinput.h>
#else
#include <virtualinput.h>
#endif

whenever KEY_INPUT_HANDLING_VIRTUAL is *NOT* defined. And KEY_INPUT_HANDLING_VIRTUAL is only defined when USE_VIRTUAL_KEYBOARD=ON.

Quoted 8 lines

I believe you should also properly use the USE_INPUT_UDEV and USE_INPUT_WAYLAND options.

find_package(Libxkbcommon REQUIRED)

libxkbcommon is also a mandatory dependency. Even though it is indirectly pulled in by libwpe, it should be expressed as a direct dependency of wpebackend-rdk.

Aye, will fix. It seems I was a bit hasty checking the CMake build system for the package O:-)

Quoted 8 lines
Quoted 6 lines
---
 package/Config.in                          |  1 +
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 4 files changed, 106 insertions(+)

Please add yourself in the DEVELOPERS file for this package.

Will do.

Quoted 14 lines

package/wpebackend-rdk/Config.in line 4

Quoted 10 lines
package/wpebackend-rdk/Config.in new file +4 -0
new file mode 100644
index 00000000000..6125911bec9
@@ -0,0 +1,57 @@
+comment "wpebackend-rdk needs a toolchain w/ C++, wchar, threads, dynamic library, and rpi-userland or an OpenGL-capable Wayland backend"
+	depends on !(BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND) \
+		|| !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \
+		|| !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

Please split this into two comments, one for the toolchain things, one for the rpi-userland || wayland EGL.

Quoted 4 lines

Also, the option BR2_PACKAGE_HAS_LIBEGL_WAYLAND is gone, see commit 4fad6b3c58abd20c533b67b85658bc66d015110b. You can use BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_WAYLAND instead. This needs to be fixed globally.

Ok.

Quoted 8 lines
Quoted 8 lines
package/wpebackend-rdk/Config.in new file +8 -0
+config BR2_PACKAGE_WPEBACKEND_RDK
+	bool "wpebackend-rdk"
+	depends on !BR2_STATIC_LIBS # wayland
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND
Quoted 8 lines

package/wpebackend-rdk/Config.in line 17

Quoted 4 lines
package/wpebackend-rdk/Config.in new file +4 -0
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBWPE
+	help
+	  WPEBackend interface supporting a number of configurations.

Would be nice to have a slightly extended explanation for the poor souls like that are very confused by libwpe vs. wpebackend-fdo vs. wpebackend-rdk vs. wpewebkit vs. webkitgtk.

Wait for it... Things are gonna get even more complicated, probably in WPE WebKit 2.48.x we are introducing a new WPEPlatform library (which will be built part of the wpewebkit package) that will allow removing the need for libwpe+wpebackend-foo.

So, here goes a quick bullet-points explanation, also for myself to help later write the package descriptions when I re-spin this into an updated v3 patchset:

- WPE WebKit is, to a certain degree, independent from the mechanisms used to allocate graphics buffers and receiving user input.
- To achieve that independence, it uses interfaces defined by libwpe.
- In turn libwpe will dynamically load a WPE backend plug-in that provides a concrete implementation (wpebackend-fdo, wpebackend-rdk).
- wpebackend-fdo provides API for applications to obtain the rendered content as a series of EGLImages, and in that sense it is "generic" but applications are then responsible for arranging how to display things (this is what Cog's "platform plug-ins" do).
- wpebackend-rdk, on the other hand, handles displaying rendered content itself, which can be more performant in some scenarios, but at the cost of reduced flexibility and only being able to use one single WebKitWebView in your application.

Quoted 7 lines

package/wpebackend-rdk/Config.in line 22

Quoted 4 lines
package/wpebackend-rdk/Config.in new file +4 -0
+if BR2_PACKAGE_WPEBACKEND_RDK
+
+choice
+	prompt Implementation

Double quotes around "Implementation". Maybe it should be "Backend" instead of "Implementation"?

I wanted to use a term different from "backend" to make it different from the "WPE backend": wpebackend-rdk is a WPE backend, which has different "implementations" (one for Wayland-EGL, one for RPi/dispmanx, etc.). The issue here is that wpebackend-rdk can be built with different compile-time options to support different hardware/configurations, when in theory each one of those configurations should be a different wpebackend-$foobar. My understanding is that wpebackend-rdk ended up the way it is was to reuse common parts when building the different configurations :-S

Using "backend" for both can quickly get confusing, as in: "wpebackend-rdk is a WPE backend that has a Wayland-EGL backend". Compare with:
"wpebackend-rdk is a WPE backend that has a Wayland-EGL implementation". Still a mouthful, but I think one can get what I am trying to avoid.

Maybe using "Configuration" instead? Suggestions for better wording are more than welcome, too.

Quoted 10 lines

package/wpebackend-rdk/Config.in line 27

Quoted 5 lines
package/wpebackend-rdk/Config.in new file +5 -0
+	default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI if BR2_PACKAGE_RPI_USERLAND
+	default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL if BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+
+comment "brcm-rpi needs rpi-userland"
+	depends on !BR2_PACKAGE_RPI_USERLAND || !BR2_arm

better expressed as:

depends on BR2_arm
depends on !BR2_PACKAGE_RPI_USERLAND

Ok.

Quoted 22 lines
Quoted 22 lines
package/wpebackend-rdk/Config.in new file +22 -0
+
+config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI
+	bool "brcm-rpi"
+	depends on BR2_arm
+	depends on BR2_PACKAGE_RPI_USERLAND
+	help
+	  Build RaspberryPi support using Broadcom's rpi-userland.
+
+comment "wayland-egl needs an EGL capable Wayland implementation"
+	depends on !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+
+config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL
+	bool "wayland-egl"
+	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	help
+	  Build Wayland-EGL support.
+
+endchoice
+
+if BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI
+
+config BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT
Quoted 8 lines

package/wpebackend-rdk/Config.in line 53

Quoted 4 lines
package/wpebackend-rdk/Config.in new file +4 -0
+	bool "libinput support"
+	select BR2_PACKAGE_LIBINPUT
+	help
+	  Support keyboard and mouse input through libinput

Why is the keyboard/mouse support with libinput only available with the brcm-rpi backend? Reading the CMakeLists.txt, I don't really see any relationship.

When building wpebackend-rdk for Wayland-EGL then events coming from the Wayland compositor are used (wl_seat, wl_pointer, and so on) and there is no need for libinput there. And for the brcm-rpi configuration is optional to use e.g. in kiosk or signage deployments.

Quoted 1 line

Could you fix up those different issues and submit a v3 ?

May take a little while, but I will indeed submit a new version of the patch set at some point. Thanks for all the review comments!

Cheers,
—Adrián

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#11 lore raw

PATCH v2 2/4 package/cog: depend on wpebackend-fdo only if needed

In reply to Adrian Perez de Castro

Make the Cog headless platform plug-in selectable, allowing to configure the build without any plug-in at all. When all plug-ins are disabled, Cog does not require wpebackend-fdo at build time, and it is still able to use its built-in "fallback" support to load other WPE backends like wpebackend-rdk.

---
 package/cog/Config.in | 28 ++++++++++++++++++++++++++--
 package/cog/cog.mk    | 13 ++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)

---
v1 -> v2:
- Unchanged.

package/cog/Config.in +26 -2
index d2a910f9b89..d706b045b15 100644
@@ -19,6 +19,10 @@ config BR2_PACKAGE_COG
 
 if BR2_PACKAGE_COG
 
+config BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	bool
+	default n
+
 config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 	string "home uri"
 	default "https://wpewebkit.org"
@@ -30,6 +34,8 @@ config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 config BR2_PACKAGE_COG_PLATFORM_FDO
 	bool "Wayland backend"
 	default y
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
 	select BR2_PACKAGE_LIBXKBCOMMON
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	help
@@ -43,6 +49,8 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	depends on BR2_PACKAGE_HAS_LIBGBM
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBINPUT
 	help
@@ -50,16 +58,32 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	  with video drivers that support kernel mode-setting (KMS)
 	  via the DRM user-space API.
 
+config BR2_PACKAGE_COG_PLATFORM_HEADLESS
+	bool "Headless backend"
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	help
+	  Enable the headless platform backend.
+
 config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
 	bool "expose system D-Bus control interface"
 	help
 	  Expose remote control interface on system bus
 
-comment "DRM platform needs EGL and GBM"
+comment "Headless platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "DRM platform needs EGL, GBM, wpebackend-fdo"
 	depends on \
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBGBM || \
 		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF || \
-		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT || \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "Wayland platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
 
 endif
package/cog/cog.mk +10 -3
index 7f680bb7005..166f095118b 100644
@@ -8,7 +8,7 @@ COG_VERSION = 0.18.4
 COG_SITE = https://wpewebkit.org/releases
 COG_SOURCE = cog-$(COG_VERSION).tar.xz
 COG_INSTALL_STAGING = YES
-COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo wayland
+COG_DEPENDENCIES = dbus wpewebkit wayland
 COG_LICENSE = MIT
 COG_LICENSE_FILES = COPYING
 COG_CONF_OPTS = \
@@ -19,8 +19,6 @@ COG_CONF_OPTS = \
 	-Dcog_home_uri='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))' \
 	-Dplatforms='$(subst $(space),$(comma),$(strip $(COG_PLATFORMS_LIST)))'
 
-COG_PLATFORMS_LIST = headless
-
 ifeq ($(BR2_PACKAGE_WESTON),y)
 COG_CONF_OPTS += -Dwayland_weston_direct_display=true
 COG_DEPENDENCIES += weston
@@ -28,6 +26,11 @@ else
 COG_CONF_OPTS += -Dwayland_weston_direct_display=false
 endif
 
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
+COG_PLATFORMS_LIST += headless
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
 COG_PLATFORMS_LIST += wayland
 COG_DEPENDENCIES += libxkbcommon wayland-protocols
@@ -48,4 +51,8 @@ ifeq ($(BR2_PACKAGE_LIBMANETTE),y)
 COG_DEPENDENCIES += libmanette
 endif
 
+ifeq ($(BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO),y)
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 $(eval $(meson-package))
Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

Re: [Buildroot] [PATCH v2 2/4] package/cog: depend on wpebackend-fdo only if needed

Hello,

Quoted 5 lines · On Thu, 27 Jun 2024 22:33:30 +0300 Adrian Perez de Castro <[email protected]>…

Make the Cog headless platform plug-in selectable, allowing to configure the build without any plug-in at all. When all plug-ins are disabled, Cog does not require wpebackend-fdo at build time, and it is still able to use its built-in "fallback" support to load other WPE backends like wpebackend-rdk.

This seems to makes sense to me, but I completely fail to understand the complicated implementation you are proposing below.

There is in fact something already super wrong in package/cog: it has wpebackend-fdo in COG_DEPENDENCIES, but it doesn't select it. It works because it depends on wpewebkit, which itself selects wpebackend-fdo, but that's really wrong. This should be fixed in a first patch.

Quoted 15 lines
---
 package/cog/Config.in | 28 ++++++++++++++++++++++++++--
 package/cog/cog.mk    | 13 ++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)

---
v1 -> v2:
- Unchanged.

package/cog/Config.in +0 -0
index d2a910f9b89..d706b045b15 100644

package/cog/Config.in config BR2_PACKAGE_COG · line 24

Quoted 6 lines
package/cog/Config.in +3 -0
@@ -19,6 +19,10 @@ config BR2_PACKAGE_COG
 
 if BR2_PACKAGE_COG
 
+config BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	bool
+	default n

I believe this is not needed.

package/cog/Config.in config BR2_PACKAGE_COG_PROGRAMS_HOME_URI · line 38

Quoted 9 lines
package/cog/Config.in +2 -0
 config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 	string "home uri"
 	default "https://wpewebkit.org"
@@ -30,6 +34,8 @@ config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 config BR2_PACKAGE_COG_PLATFORM_FDO
 	bool "Wayland backend"
 	default y
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

If the Wayland backend needs wpebackend-fdo, just select it:

select BR2_PACKAGE_WPEBACKEND_FDO

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 53

Quoted 9 lines
package/cog/Config.in +2 -0
 	select BR2_PACKAGE_LIBXKBCOMMON
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	help
@@ -43,6 +49,8 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	depends on BR2_PACKAGE_HAS_LIBGBM
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

If the DRM backend needs wpebackend-fdo, just select it:

select BR2_PACKAGE_WPEBACKEND_FDO

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 64

Quoted 11 lines
package/cog/Config.in +4 -0
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBINPUT
 	help
@@ -50,16 +58,32 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	  with video drivers that support kernel mode-setting (KMS)
 	  via the DRM user-space API.
 
+config BR2_PACKAGE_COG_PLATFORM_HEADLESS
+	bool "Headless backend"
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

Same, just select wpebackend-fdo.

Quoted 15 lines
package/cog/Config.in +8 -1
+	help
+	  Enable the headless platform backend.
+
 config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
 	bool "expose system D-Bus control interface"
 	help
 	  Expose remote control interface on system bus
 
-comment "DRM platform needs EGL and GBM"
+comment "Headless platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "DRM platform needs EGL, GBM, wpebackend-fdo"
 	depends on \

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 87

Quoted 10 lines
package/cog/Config.in +6 -1
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBGBM || \
 		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF || \
-		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT || \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "Wayland platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO

Drop all those changes.

Quoted 36 lines
package/cog/Config.in +0 -0
 endif
package/cog/cog.mk +6 -3
index 7f680bb7005..166f095118b 100644
@@ -8,7 +8,7 @@ COG_VERSION = 0.18.4
 COG_SITE = https://wpewebkit.org/releases
 COG_SOURCE = cog-$(COG_VERSION).tar.xz
 COG_INSTALL_STAGING = YES
-COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo wayland
+COG_DEPENDENCIES = dbus wpewebkit wayland
 COG_LICENSE = MIT
 COG_LICENSE_FILES = COPYING
 COG_CONF_OPTS = \
@@ -19,8 +19,6 @@ COG_CONF_OPTS = \
 	-Dcog_home_uri='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))' \
 	-Dplatforms='$(subst $(space),$(comma),$(strip $(COG_PLATFORMS_LIST)))'
 
-COG_PLATFORMS_LIST = headless
-
 ifeq ($(BR2_PACKAGE_WESTON),y)
 COG_CONF_OPTS += -Dwayland_weston_direct_display=true
 COG_DEPENDENCIES += weston
@@ -28,6 +26,11 @@ else
 COG_CONF_OPTS += -Dwayland_weston_direct_display=false
 endif
 
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
+COG_PLATFORMS_LIST += headless
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
 COG_PLATFORMS_LIST += wayland
 COG_DEPENDENCIES += libxkbcommon wayland-protocols

package/cog/cog.mk ifeq ($(BR2_PACKAGE_LIBMANETTE),y) · line 56

Quoted 6 lines
package/cog/cog.mk +3 -0
@@ -48,4 +51,8 @@ ifeq ($(BR2_PACKAGE_LIBMANETTE),y)
 COG_DEPENDENCIES += libmanette
 endif
 
+ifeq ($(BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO),y)
+COG_DEPENDENCIES += wpebackend-fdo
+endif

Drop this, and instead do:

ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
COG_PLATFORMS_LIST += headless
COG_DEPENDENCIES += wpebackend-fdo
endif

ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y) COG_PLATFORMS_LIST += wayland
COG_DEPENDENCIES += libxkbcommon wayland-protocols wpebackend-fdo endif

ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y) COG_PLATFORMS_LIST += drm
COG_DEPENDENCIES += libdrm libinput libgbm libegl udev wpebackend-fdo endif

Could you rework a v3 according to those suggestions?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

Re: [Buildroot] [PATCH v2 2/4] package/cog: depend on wpebackend-fdo only if needed

Hello,

Quoted 11 lines · On Fri, 02 Aug 2024 23:06:44 +0200 Thomas Petazzoni via buildroot…
Quoted 5 lines · On Thu, 27 Jun 2024 22:33:30 +0300 Adrian Perez de Castro <[email protected]>…

Make the Cog headless platform plug-in selectable, allowing to configure the build without any plug-in at all. When all plug-ins are disabled, Cog does not require wpebackend-fdo at build time, and it is still able to use its built-in "fallback" support to load other WPE backends like wpebackend-rdk.

This seems to makes sense to me, but I completely fail to understand the complicated implementation you are proposing below.

Oops O:-)

Quoted 4 lines

There is in fact something already super wrong in package/cog: it has wpebackend-fdo in COG_DEPENDENCIES, but it doesn't select it. It works because it depends on wpewebkit, which itself selects wpebackend-fdo, but that's really wrong. This should be fixed in a first patch.

You're right!

Quoted 149 lines
Quoted 15 lines
---
 package/cog/Config.in | 28 ++++++++++++++++++++++++++--
 package/cog/cog.mk    | 13 ++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)

---
v1 -> v2:
- Unchanged.

package/cog/Config.in +0 -0
index d2a910f9b89..d706b045b15 100644

package/cog/Config.in config BR2_PACKAGE_COG · line 24

Quoted 6 lines
package/cog/Config.in +3 -0
@@ -19,6 +19,10 @@ config BR2_PACKAGE_COG
 
 if BR2_PACKAGE_COG
 
+config BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO
+	bool
+	default n

I believe this is not needed.

package/cog/Config.in config BR2_PACKAGE_COG_PROGRAMS_HOME_URI · line 38

Quoted 9 lines
package/cog/Config.in +2 -0
 config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 	string "home uri"
 	default "https://wpewebkit.org"
@@ -30,6 +34,8 @@ config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
 config BR2_PACKAGE_COG_PLATFORM_FDO
 	bool "Wayland backend"
 	default y
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

If the Wayland backend needs wpebackend-fdo, just select it:

select BR2_PACKAGE_WPEBACKEND_FDO

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 53

Quoted 9 lines
package/cog/Config.in +2 -0
 	select BR2_PACKAGE_LIBXKBCOMMON
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	help
@@ -43,6 +49,8 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	depends on BR2_PACKAGE_HAS_LIBGBM
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

If the DRM backend needs wpebackend-fdo, just select it:

select BR2_PACKAGE_WPEBACKEND_FDO

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 64

Quoted 11 lines
package/cog/Config.in +4 -0
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBINPUT
 	help
@@ -50,16 +58,32 @@ config BR2_PACKAGE_COG_PLATFORM_DRM
 	  with video drivers that support kernel mode-setting (KMS)
 	  via the DRM user-space API.
 
+config BR2_PACKAGE_COG_PLATFORM_HEADLESS
+	bool "Headless backend"
+	depends on BR2_PACKAGE_WPEBACKEND_FDO
+	select BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO

Same, just select wpebackend-fdo.

Quoted 15 lines
package/cog/Config.in +8 -1
+	help
+	  Enable the headless platform backend.
+
 config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
 	bool "expose system D-Bus control interface"
 	help
 	  Expose remote control interface on system bus
 
-comment "DRM platform needs EGL and GBM"
+comment "Headless platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "DRM platform needs EGL, GBM, wpebackend-fdo"
 	depends on \

package/cog/Config.in config BR2_PACKAGE_COG_PLATFORM_DRM · line 87

Quoted 10 lines
package/cog/Config.in +6 -1
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBGBM || \
 		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF || \
-		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+		!BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT || \
+		!BR2_PACKAGE_WPEBACKEND_FDO
+
+comment "Wayland platform needs wpebackend-fdo"
+	depends on \
+		!BR2_PACKAGE_WPEBACKEND_FDO

Drop all those changes.

Quoted 36 lines
package/cog/Config.in +0 -0
 endif
package/cog/cog.mk +6 -3
index 7f680bb7005..166f095118b 100644
@@ -8,7 +8,7 @@ COG_VERSION = 0.18.4
 COG_SITE = https://wpewebkit.org/releases
 COG_SOURCE = cog-$(COG_VERSION).tar.xz
 COG_INSTALL_STAGING = YES
-COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo wayland
+COG_DEPENDENCIES = dbus wpewebkit wayland
 COG_LICENSE = MIT
 COG_LICENSE_FILES = COPYING
 COG_CONF_OPTS = \
@@ -19,8 +19,6 @@ COG_CONF_OPTS = \
 	-Dcog_home_uri='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))' \
 	-Dplatforms='$(subst $(space),$(comma),$(strip $(COG_PLATFORMS_LIST)))'
 
-COG_PLATFORMS_LIST = headless
-
 ifeq ($(BR2_PACKAGE_WESTON),y)
 COG_CONF_OPTS += -Dwayland_weston_direct_display=true
 COG_DEPENDENCIES += weston
@@ -28,6 +26,11 @@ else
 COG_CONF_OPTS += -Dwayland_weston_direct_display=false
 endif
 
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
+COG_PLATFORMS_LIST += headless
+COG_DEPENDENCIES += wpebackend-fdo
+endif
+
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
 COG_PLATFORMS_LIST += wayland
 COG_DEPENDENCIES += libxkbcommon wayland-protocols

package/cog/cog.mk ifeq ($(BR2_PACKAGE_LIBMANETTE),y) · line 56

Quoted 6 lines
package/cog/cog.mk +3 -0
@@ -48,4 +51,8 @@ ifeq ($(BR2_PACKAGE_LIBMANETTE),y)
 COG_DEPENDENCIES += libmanette
 endif
 
+ifeq ($(BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO),y)
+COG_DEPENDENCIES += wpebackend-fdo
+endif

Drop this, and instead do:

ifeq ($(BR2_PACKAGE_COG_PLATFORM_HEADLESS),y)
COG_PLATFORMS_LIST += headless
COG_DEPENDENCIES += wpebackend-fdo
endif

ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y) COG_PLATFORMS_LIST += wayland
COG_DEPENDENCIES += libxkbcommon wayland-protocols wpebackend-fdo endif

Quoted 4 lines

ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y) COG_PLATFORMS_LIST += drm
COG_DEPENDENCIES += libdrm libinput libgbm libegl udev wpebackend-fdo endif

With the additional BR2_PACKAGE_COG_NEEDS_WPEBACKEND_FDO configuration symbol I was trying to avoid adding wpebackend-fdo more than once to COG_DEPENDENCIES. If it's fine to have it there (as it seems to be the case) then yes, I am aboard for all the simplifications.

Quoted 1 line

Could you rework a v3 according to those suggestions?

Yes, will re-spin this into a v3 at some point. Thanks for all the recommendations!

Cheers,
—Adrián

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#14 lore raw

PATCH v2 3/4 package/wpewebkit: do not depend on wpebackend-fdo

In reply to Adrian Perez de Castro

Remove the wpewebkit package dependency on wpebackend-fdo, as it is not needed at all during the build. What is needed is a WPE backend at run time, which may be provided by wpebackend-fdo or wpebackend-rdk. To reflect this, we make wpewebkit depend on either being selected.

---
 package/wpewebkit/Config.in    | 9 ++++-----
 package/wpewebkit/wpewebkit.mk | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

---
v1 -> v2:
- Remove openjpeg dependency, which has been dropped in 2.44.x

package/wpewebkit/Config.in +4 -5
index e4b0320e1da..c55b827e2b8 100644
@@ -24,11 +24,11 @@ comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc
 		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
 		|| !BR2_HOST_GCC_AT_LEAST_4_9
 
-comment "wpewebkit needs an OpenGL ES w/ EGL-capable Wayland backend"
+comment "wpewebkit needs an OpenGL ES w/ EGL-capable implementation and an WPE backend"
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
 	depends on !BR2_BINFMT_FLAT
-	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL \
-		|| !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL
+	depends on !BR2_PACKAGE_WPEBACKEND_FDO && !BR2_PACKAGE_WPEBACKEND_RDK
 
 config BR2_PACKAGE_WPEWEBKIT
 	bool "wpewebkit"
@@ -41,8 +41,8 @@ config BR2_PACKAGE_WPEWEBKIT
 	depends on BR2_USE_WCHAR # icu, libsoup3
 	depends on BR2_PACKAGE_HAS_LIBGLES # libepoxy
 	depends on BR2_PACKAGE_HAS_LIBEGL # libepoxy
-	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # wpebackend-fdo
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_WPEBACKEND_FDO || BR2_PACKAGE_WPEBACKEND_RDK
 	select BR2_PACKAGE_CAIRO
 	select BR2_PACKAGE_CAIRO_PNG
 	select BR2_PACKAGE_HARFBUZZ
@@ -58,7 +58,6 @@ config BR2_PACKAGE_WPEWEBKIT
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	select BR2_PACKAGE_WEBP
 	select BR2_PACKAGE_WEBP_DEMUX
-	select BR2_PACKAGE_WPEBACKEND_FDO
 	help
 	  WPE (Web Platform for Embedded) port of the WebKit engine,
 	  to allow embedders to create simple and performant systems
package/wpewebkit/wpewebkit.mk +1 -1
index ecb3b3e352b..382c2adca10 100644
@@ -17,7 +17,7 @@ WPEWEBKIT_CPE_ID_VENDOR = wpewebkit
 WPEWEBKIT_CPE_ID_PRODUCT = wpe_webkit
 WPEWEBKIT_DEPENDENCIES = host-gperf host-python3 host-ruby host-unifdef \
 	harfbuzz cairo icu jpeg libepoxy libgcrypt libgles libsoup3 libtasn1 \
-	libpng libxslt wayland-protocols webp wpebackend-fdo
+	libpng libxslt libwpe wayland-protocols webp
 
 WPEWEBKIT_CMAKE_BACKEND = ninja
 
Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#15 lore raw

Re: [Buildroot] [PATCH v2 3/4] package/wpewebkit: do not depend on wpebackend-fdo

Hello,

Quoted 21 lines · On Thu, 27 Jun 2024 22:33:31 +0300 Adrian Perez de Castro <[email protected]>…

Remove the wpewebkit package dependency on wpebackend-fdo, as it is not needed at all during the build. What is needed is a WPE backend at run time, which may be provided by wpebackend-fdo or wpebackend-rdk. To reflect this, we make wpewebkit depend on either being selected.

---
 package/wpewebkit/Config.in    | 9 ++++-----
 package/wpewebkit/wpewebkit.mk | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

---
v1 -> v2:
- Remove openjpeg dependency, which has been dropped in 2.44.x

package/wpewebkit/Config.in +0 -0
index e4b0320e1da..c55b827e2b8 100644
@@ -24,11 +24,11 @@ comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc
 		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \

package/wpewebkit/Config.in comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc · line 31

Quoted 10 lines
package/wpewebkit/Config.in +3 -3
 		|| !BR2_HOST_GCC_AT_LEAST_4_9
 
-comment "wpewebkit needs an OpenGL ES w/ EGL-capable Wayland backend"
+comment "wpewebkit needs an OpenGL ES w/ EGL-capable implementation and an WPE backend"
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
 	depends on !BR2_BINFMT_FLAT
-	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL \
-		|| !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL
+	depends on !BR2_PACKAGE_WPEBACKEND_FDO && !BR2_PACKAGE_WPEBACKEND_RDK

I think we will want to select one, see below.

package/wpewebkit/Config.in config BR2_PACKAGE_WPEWEBKIT · line 45

Quoted 10 lines
package/wpewebkit/Config.in +1 -1
 config BR2_PACKAGE_WPEWEBKIT
 	bool "wpewebkit"
@@ -41,8 +41,8 @@ config BR2_PACKAGE_WPEWEBKIT
 	depends on BR2_USE_WCHAR # icu, libsoup3
 	depends on BR2_PACKAGE_HAS_LIBGLES # libepoxy
 	depends on BR2_PACKAGE_HAS_LIBEGL # libepoxy
-	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # wpebackend-fdo
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_WPEBACKEND_FDO || BR2_PACKAGE_WPEBACKEND_RDK

Please use instead:

select BR2_PACKAGE_WPEBACKEND_FDO if !BR2_PACKAGE_WPEBACKEND_RDK # runtime

this will ensure that at least one is selected, taking by default wpebackend-fdo, but allowing the user to enable wpebackend-rdk (and disable wpebackend-fdo).

Also the "# runtime" comment is important, because it explains why an option is selected, but not added to the build dependencies of the package.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#16 lore raw

Re: [Buildroot] [PATCH v2 3/4] package/wpewebkit: do not depend on wpebackend-fdo

Hi,

Quoted 26 lines · On Fri, 02 Aug 2024 23:08:32 +0200 Thomas Petazzoni via buildroot…
Quoted 23 lines · On Thu, 27 Jun 2024 22:33:31 +0300 Adrian Perez de Castro <[email protected]>…

Remove the wpewebkit package dependency on wpebackend-fdo, as it is not needed at all during the build. What is needed is a WPE backend at run time, which may be provided by wpebackend-fdo or wpebackend-rdk. To reflect this, we make wpewebkit depend on either being selected.

---
 package/wpewebkit/Config.in    | 9 ++++-----
 package/wpewebkit/wpewebkit.mk | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

---
v1 -> v2:
- Remove openjpeg dependency, which has been dropped in 2.44.x

package/wpewebkit/Config.in +0 -0
index e4b0320e1da..c55b827e2b8 100644
@@ -24,11 +24,11 @@ comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc
 		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
 		|| !BR2_HOST_GCC_AT_LEAST_4_9
 
Quoted 10 lines

package/wpewebkit/Config.in comment "wpewebkit needs a toolchain w/ C++, wchar, threads, dynamic library, gc · line 31

Quoted 8 lines
package/wpewebkit/Config.in +3 -3
-comment "wpewebkit needs an OpenGL ES w/ EGL-capable Wayland backend"
+comment "wpewebkit needs an OpenGL ES w/ EGL-capable implementation and an WPE backend"
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
 	depends on !BR2_BINFMT_FLAT
-	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL \
-		|| !BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	depends on !BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBEGL
+	depends on !BR2_PACKAGE_WPEBACKEND_FDO && !BR2_PACKAGE_WPEBACKEND_RDK

I think we will want to select one, see below.

Indeed, I didn't come up myself with a good way of making sure at least one is picked...

Quoted 12 lines

package/wpewebkit/Config.in config BR2_PACKAGE_WPEWEBKIT · line 45

Quoted 9 lines
package/wpewebkit/Config.in +1 -1
 config BR2_PACKAGE_WPEWEBKIT
 	bool "wpewebkit"
@@ -41,8 +41,8 @@ config BR2_PACKAGE_WPEWEBKIT
 	depends on BR2_USE_WCHAR # icu, libsoup3
 	depends on BR2_PACKAGE_HAS_LIBGLES # libepoxy
 	depends on BR2_PACKAGE_HAS_LIBEGL # libepoxy
-	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # wpebackend-fdo
 	depends on BR2_PACKAGE_WPEWEBKIT_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_WPEBACKEND_FDO || BR2_PACKAGE_WPEBACKEND_RDK

Please use instead:

Quoted 5 lines

select BR2_PACKAGE_WPEBACKEND_FDO if !BR2_PACKAGE_WPEBACKEND_RDK # runtime

this will ensure that at least one is selected, taking by default wpebackend-fdo, but allowing the user to enable wpebackend-rdk (and disable wpebackend-fdo).

...and no idea why this didn't cross my mind. Thanks for the suggestion, this is the right thing to do.

Quoted 3 lines

Also the "# runtime" comment is important, because it explains why an option is selected, but not added to the build dependencies of the package.

TIL, thanks.

Cheers,
—Adrián

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#17 lore raw

v2 cover Add support for the WPE WebKit RDK backend

In reply to Adrian Perez de Castro

Hello all,

Here's a v2 re-spin after a rebase and adding one additional fixup =)

This patch series allows using the RDK backend for WPE WebKit. Currently the main use case is to run WPEWebKit on RaspberryPi boards using on Dispmanx via the rpi-userland EGL/GLES libraries.

In order to allow using the new wpebackend-rdk package I needed to un-hardcode usage of wpebackend-fdo, in two places:

- The cog package may be built without wpebackend-fdo, passing an empty list of platform plug-ins. It has built-in support to load "simple" WPE backends like wpebackend-rdk. This was done by adding a config option for the headless plug-in, instead of always building it, and adjusting dependencies.

- The wpewebkit package does not need wpebackend-fdo at all during the build. It only needs a backend installed at run time. This means it is enough to make wpewebkit have a "depends on" on any of the backends, to make sure they will be in the build, but none needs to be listed in WPEWEBKIT_DEPENDENCIES. Also, libdrm is not strictly needed and only used if selected by some other means.

I have tested this making builds based on raspberrypi3_defconfig, adding rpi-userland and then picking wpebackend-rdk + wpewebkit + cog.

Adrian Perez de Castro (4):
package/wpebackend-rdk: new package
package/cog: depend on wpebackend-fdo only if needed package/wpewebkit: do not depend on wpebackend-fdo package/wpewebkit: disable libdrm usage when not available

 package/Config.in                          |  1 +
 package/cog/Config.in                      | 28 ++++++++++-
 package/cog/cog.mk                         | 13 +++--
 package/wpebackend-rdk/Config.in           | 57 ++++++++++++++++++++++
 package/wpebackend-rdk/wpebackend-rdk.hash |  5 ++
 package/wpebackend-rdk/wpebackend-rdk.mk   | 43 ++++++++++++++++
 package/wpewebkit/Config.in                |  9 ++--
 package/wpewebkit/wpewebkit.mk             |  9 +++-
 8 files changed, 154 insertions(+), 11 deletions(-)
 create mode 100644 package/wpebackend-rdk/Config.in
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.hash
 create mode 100644 package/wpebackend-rdk/wpebackend-rdk.mk
Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#18 lore raw

PATCH v2 4/4 package/wpewebkit: disable libdrm usage when not available

In reply to Adrian Perez de Castro

Pass USE_LIBDRM=OFF to the wpewebkit CMake configuration step when the libdrm package has not been selected.

WPE WebKit can be built without libdrm support, and it will still work with backends that use other platform-specific methods to handle graphics buffers and/or presenting content onto an output. For example this is the case with wpebackend-rdk configured to use rpi-userland, which uses dispmanx to produce the output instead of DRM/KMS.

---
 package/wpewebkit/wpewebkit.mk | 7 +++++++
 1 file changed, 7 insertions(+)

---
v1 -> v2:
- Patch added.

package/wpewebkit/wpewebkit.mk +7 -0
index 382c2adca10..4071cbb0d83 100644
@@ -87,6 +87,13 @@ else
 WPEWEBKIT_CONF_OPTS += -DUSE_LIBBACKTRACE=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBDRM),y)
+WPEWEBKIT_CONF_OPTS += -DUSE_LIBDRM=ON
+WPEWEBKIT_DEPENDENCIES += libdrm
+else
+WPEWEBKIT_CONF_OPTS += -DUSE_LIBDRM=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_WOFF2),y)
 WPEWEBKIT_CONF_OPTS += -DUSE_WOFF2=ON
 WPEWEBKIT_DEPENDENCIES += woff2
Signature · 6 lines
2.45.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#19 lore raw

Re: [Buildroot] [PATCH v2 4/4] package/wpewebkit: disable libdrm usage when not available

Quoted 9 lines · On Thu, 27 Jun 2024 22:33:32 +0300 Adrian Perez de Castro <[email protected]>…

Pass USE_LIBDRM=OFF to the wpewebkit CMake configuration step when the libdrm package has not been selected.

WPE WebKit can be built without libdrm support, and it will still work with backends that use other platform-specific methods to handle graphics buffers and/or presenting content onto an output. For example this is the case with wpebackend-rdk configured to use rpi-userland, which uses dispmanx to produce the output instead of DRM/KMS.

Quoted 4 lines
---
 package/wpewebkit/wpewebkit.mk | 7 +++++++
 1 file changed, 7 insertions(+)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot