Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Perez de Castro <aperez@igalia.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Samuel Martin <s.martin49@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 2/4] package/cog: depend on wpebackend-fdo only if needed
Date: Mon, 2 Sep 2024 23:21:44 +0300	[thread overview]
Message-ID: <20240902232144.GH1449890@igalia.com> (raw)
In-Reply-To: <20240802230644.69b29bac@windsurf>


[-- Attachment #1.1: Type: text/plain, Size: 6351 bytes --]

Hello,

On Fri, 02 Aug 2024 23:06:44 +0200 Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:
 
> On Thu, 27 Jun 2024 22:33:30 +0300
> Adrian Perez de Castro <aperez@igalia.com> wrote:
> 
> > 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:-)

> 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!
 
> > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
> > ---
> >  package/cog/Config.in | 28 ++++++++++++++++++++++++++--
> >  package/cog/cog.mk    | 13 ++++++++++---
> >  2 files changed, 36 insertions(+), 5 deletions(-)
> > 
> > ---
> > v1 -> v2:
> > - Unchanged.
> > 
> > diff --git a/package/cog/Config.in b/package/cog/Config.in
> > index d2a910f9b89..d706b045b15 100644
> > --- a/package/cog/Config.in
> > +++ b/package/cog/Config.in
> > @@ -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.
> 
> >  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
> 
> >  	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
> 
> >  	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.
> 
> > +	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
> 
> Drop all those changes.
> 
> >  endif
> > diff --git a/package/cog/cog.mk b/package/cog/cog.mk
> > index 7f680bb7005..166f095118b 100644
> > --- a/package/cog/cog.mk
> > +++ b/package/cog/cog.mk
> > @@ -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
> 
> 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

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.
 
> 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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-09-02 20:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  9:55 [Buildroot] [PATCH 0/3] Add support for the WPE WebKit RDK backend Adrian Perez de Castro
2024-02-08  9:55 ` [Buildroot] [PATCH 1/3] package/wpebackend-rdk: new package Adrian Perez de Castro
2024-02-08  9:55 ` [Buildroot] [PATCH 2/3] package/cog: depend on wpebackend-fdo only if needed Adrian Perez de Castro
2024-02-08  9:55 ` [Buildroot] [PATCH 3/3] package/wpewebkit: do not depend on wpebackend-fdo Adrian Perez de Castro
2024-02-08 10:29 ` [Buildroot] [PATCH 0/3] Add support for the WPE WebKit RDK backend Thomas Petazzoni via buildroot
2024-06-14 23:45   ` Adrian Perez de Castro
2024-06-15  6:54     ` Giulio Benetti
2024-06-18  6:53     ` Thomas Petazzoni via buildroot
2024-06-27 19:33 ` [Buildroot] [PATCH v2 0/4] " Adrian Perez de Castro
2024-06-27 19:33 ` [Buildroot] [PATCH v2 1/4] package/wpebackend-rdk: new package Adrian Perez de Castro
2024-08-02 21:00   ` Thomas Petazzoni via buildroot
2024-09-02 20:12     ` Adrian Perez de Castro
2024-06-27 19:33 ` [Buildroot] [PATCH v2 2/4] package/cog: depend on wpebackend-fdo only if needed Adrian Perez de Castro
2024-08-02 21:06   ` Thomas Petazzoni via buildroot
2024-09-02 20:21     ` Adrian Perez de Castro [this message]
2024-06-27 19:33 ` [Buildroot] [PATCH v2 3/4] package/wpewebkit: do not depend on wpebackend-fdo Adrian Perez de Castro
2024-08-02 21:08   ` Thomas Petazzoni via buildroot
2024-09-02 20:15     ` Adrian Perez de Castro
2024-06-27 19:33 ` [Buildroot] [PATCH v2 4/4] package/wpewebkit: disable libdrm usage when not available Adrian Perez de Castro
2024-08-02 21:15   ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240902232144.GH1449890@igalia.com \
    --to=aperez@igalia.com \
    --cc=buildroot@buildroot.org \
    --cc=s.martin49@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox