diff mbox series

[RFC,PATCH/next,1/2] package/wlroots: new package

Message ID 20190516220836.24543-2-aperez@igalia.com
State Changes Requested
Headers show
Series Add Cage and wlroots packages | expand

Commit Message

Adrian Perez de Castro May 16, 2019, 10:08 p.m. UTC
wlroots is a modular library which provides building blocks to
implement Wayland compositors. wlroots is a dependency of the
Cage Wayland compositor.

https://github.com/swaywm/wlroots/

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
---
 package/Config.in            |  1 +
 package/wlroots/Config.in    | 65 +++++++++++++++++++++++++++++
 package/wlroots/wlroots.hash |  5 +++
 package/wlroots/wlroots.mk   | 80 ++++++++++++++++++++++++++++++++++++
 4 files changed, 151 insertions(+)
 create mode 100644 package/wlroots/Config.in
 create mode 100644 package/wlroots/wlroots.hash
 create mode 100644 package/wlroots/wlroots.mk

Comments

Thomas Petazzoni May 17, 2019, 7:48 a.m. UTC | #1
Hello,

On Fri, 17 May 2019 01:08:35 +0300
Adrian Perez de Castro <aperez@igalia.com> wrote:

> diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
> new file mode 100644
> index 0000000000..45db63f62c
> --- /dev/null
> +++ b/package/wlroots/Config.in
> @@ -0,0 +1,65 @@
> +config BR2_PACKAGE_WLROOTS
> +	bool "wlroots"
> +	depends on !BR2_STATIC_LIBS # mesa3d, wayland

You're not selecting "mesa3d", so this "mesa3d" comment doesn't make
sense.

> +	depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d

You're not selecting freerdp nor mesa3d, so the comment doesn't make
sense either. This dependency doesn't seem to be needed at all.

> +	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d

This dependency doesn't seem to be needed, at least you don't use
mesa3d, and none of the packages you select has a "depends on
BR2_TOOLCHAIN_HAS_SYNC".

> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d

Same.


> +if BR2_PACKAGE_WLROOTS
> +
> +config BR2_PACKAGE_WLROOTS_RDP
> +	bool "RDP backend support"
> +	depends on BR2_PACKAGE_FREERDP

If you "depends on" something...

> +	depends on BR2_USE_WCHAR # freerdp
> +	depends on BR2_USE_MMU # libglib2
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp

... there's no point in replicating its dependencies.

> +WLROOTS_VERSION = 0.6.0
> +WLROOTS_SITE = https://github.com/swaywm/wlroots/archive
> +WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz
> +WLROOTS_LICENSE = MIT
> +WLROOTS_INSTALL_STAGING = YES
> +
> +WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \
> +					   libxkbcommon mesa3d pixman udev \

Ah, so you have mesa3d in your dependencies, but you don't select it ?

Thomas
Francois Perrad May 18, 2019, 3:47 p.m. UTC | #2
Le ven. 17 mai 2019 à 00:09, Adrian Perez de Castro <aperez@igalia.com> a
écrit :

> wlroots is a modular library which provides building blocks to
> implement Wayland compositors. wlroots is a dependency of the
> Cage Wayland compositor.
>
> https://github.com/swaywm/wlroots/
>
> Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
> ---
>  package/Config.in            |  1 +
>  package/wlroots/Config.in    | 65 +++++++++++++++++++++++++++++
>  package/wlroots/wlroots.hash |  5 +++
>  package/wlroots/wlroots.mk   | 80 ++++++++++++++++++++++++++++++++++++
>  4 files changed, 151 insertions(+)
>  create mode 100644 package/wlroots/Config.in
>  create mode 100644 package/wlroots/wlroots.hash
>  create mode 100644 package/wlroots/wlroots.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index f592e74a99..5b1f279b8e 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1341,6 +1341,7 @@ menu "Graphics"
>         source "package/waylandpp/Config.in"
>         source "package/webkitgtk/Config.in"
>         source "package/webp/Config.in"
> +       source "package/wlroots/Config.in"
>         source "package/woff2/Config.in"
>         source "package/wpebackend-fdo/Config.in"
>         source "package/wpewebkit/Config.in"
> diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
> new file mode 100644
> index 0000000000..45db63f62c
> --- /dev/null
> +++ b/package/wlroots/Config.in
> @@ -0,0 +1,65 @@
> +config BR2_PACKAGE_WLROOTS
> +       bool "wlroots"
> +       depends on !BR2_STATIC_LIBS # mesa3d, wayland
> +       depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d
> +       depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
> +       depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d
> +       depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d
> +       depends on BR2_ENABLE_LOCALE # libinput
> +       depends on BR2_PACKAGE_HAS_UDEV # libinput
> +       depends on BR2_PACKAGE_HAS_LIBEGL
> +       depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND
> +       depends on BR2_PACKAGE_HAS_LIBGLES
> +       select BR2_PACKAGE_LIBDRM
> +       select BR2_PACKAGE_LIBINPUT
> +       select BR2_PACKAGE_LIBXKBCOMMON
> +       select BR2_PACKAGE_PIXMAN
> +       select BR2_PACKAGE_WAYLAND
> +       select BR2_PACKAGE_WAYLAND_PROTOCOLS
> +       help
> +         wlroots is a modular Wayland library for building compositors
> +         which implements many of their common features.
> +
> +         https://github.com/swaywm/wlroots
> +
> +if BR2_PACKAGE_WLROOTS
> +
> +config BR2_PACKAGE_WLROOTS_RDP
> +       bool "RDP backend support"
> +       depends on BR2_PACKAGE_FREERDP
> +       depends on BR2_USE_WCHAR # freerdp
> +       depends on BR2_USE_MMU # libglib2
> +       depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp
> +       help
> +         Support Wayland sessions served using the RDP protocol
> +
> +comment "RDP backend support needs FreeRDP"
> +       depends on !BR2_PACKAGE_FREERDP
> +
> +config BR2_PACKAGE_WLROOTS_X11
> +       bool "X11 backend support"
> +       depends on BR2_PACKAGE_XORG7
> +       select BR2_PACKAGE_LIBXCB
> +       select BR2_PACKAGE_XLIB_LIBX11
> +       help
> +         Support Wayland sessions nested inside a X11 window
> +
> +comment "X11 backend support needs X.org enabled"
> +       depends on !BR2_PACKAGE_XORG7
> +
> +config BR2_PACKAGE_WLROOTS_XWAYLAND
> +       bool "XWayland support"
> +       depends on BR2_PACKAGE_XORG7
> +       select BR2_PACKAGE_LIBXCB
> +       help
> +         Enable support for XWayland
> +
> +comment "XWayland support needs X.org enabled"
> +       depends on !BR2_PACKAGE_XORG7
> +
> +config BR2_PACKAGE_WLROOTS_ROOTSTON
> +       bool "rootston"
> +       help
> +         Build and install the rootston example compositor
> +
> +endif
> diff --git a/package/wlroots/wlroots.hash b/package/wlroots/wlroots.hash
> new file mode 100644
> index 0000000000..dbb387a865
> --- /dev/null
> +++ b/package/wlroots/wlroots.hash
> @@ -0,0 +1,5 @@
> +# Generated locally
> +sha256 9cf3716f3683d800df8b150f256ff66dad65faf13a9d67c284f67a9444d28c70
> 0.6.0.tar.gz
> +
> +# Hashes for license files:
> +sha256 ffd3737a478b83a8b51b42757d3bf909ef36694508355879722e11fc1fa6736b
> LICENSE
> diff --git a/package/wlroots/wlroots.mk b/package/wlroots/wlroots.mk
> new file mode 100644
> index 0000000000..9d3581fd6f
> --- /dev/null
> +++ b/package/wlroots/wlroots.mk
> @@ -0,0 +1,80 @@
>
> +################################################################################
> +#
> +# wlroots
> +#
>
> +################################################################################
> +
> +WLROOTS_VERSION = 0.6.0
> +WLROOTS_SITE = https://github.com/swaywm/wlroots/archive
> +WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz
> +WLROOTS_LICENSE = MIT
> +WLROOTS_INSTALL_STAGING = YES
> +
> +WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \
> +                                          libxkbcommon mesa3d pixman udev
> \
> +                                          wayland wayland-protocols
>

wlroots has the same issue as WPEBackend-fdo:
>>> wlroots 0.6.0 Configuring

Native dependency wayland-scanner found: YES 1.17.0
Program /usr/bin/wayland-scanner found: NO

protocol/meson.build:5:1: ERROR: Program(s) ['/usr/bin/wayland-scanner']
not found or not executable

François


> +
> +WLROOTS_CONF_OPTS = -Dexamples=false
> +
> +ifeq ($(BR2_PACKAGE_FFMPEG),y)
> +WLROOTS_DEPENDENCIES += ffmpeg
> +endif
> +
> +ifeq ($(BR2_PACKAGE_LIBCAP),y)
> +WLROOTS_CONF_OPTS += -Dlibcap=enabled
> +WLROOTS_DEPENDENCIES += libcap
> +else
> +WLROOTS_CONF_OPTS += -Dlibcap=disabled
> +endif
> +
> +ifeq ($(BR2_PACKAGE_LIBPNG),y)
> +WLROOTS_DEPENDENCIES += libpng
> +endif
> +
> +ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
> +WLROOTS_CONF_OPTS += -Dlogind=enabled -Dlogind-provider=systemd
> +WLROOTS_DEPENDENCIES += systemd
> +else
> +WLROOTS_CONF_OPTS += -Dlogind=disabled
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WLROOTS_RDP),y)
> +WLROOTS_CONF_OPTS += -Dfreerdp=enabled
> +WLROOTS_DEPENDENCIES += freerdp
> +else
> +WLROOTS_CONF_OPTS += -Dfreerdp=disabled
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
> +WLROOTS_CONF_OPTS += -Dx11-backend=enabled
> +WLROOTS_DEPENDENCIES += xlib_libX11
> +else
> +WLROOTS_CONF_OPTS += -Dx11-backend=disabled
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WLROOTS_XWAYLAND),y)
> +WLROOTS_CONF_OPTS += -Dxwayland=enabled
> +WLROOTS_DEPENDENCIES += libxcb
> +ifeq ($(BR2_PACKAGE_XCB_UTIL),y)
> +WLROOTS_CONF_OPTS += -Dxcb-errors=enabled
> +WLROOTS_DEPENDENCIES += xcb-util
> +else
> +WLROOTS_CONF_OPTS += -Dxcb-errors=disabled
> +endif
> +ifeq ($(BR2_PACKAGE_XCB_UTIL_WM),y)
> +WLROOTS_CONF_OPTS += -Dxcb-icccm=enabled
> +WLROOTS_DEPENDENCIES += xcb-util-wm
> +else
> +WLROOTS_CONF_OPTS += -Dxcb-icccm=disabled
> +endif
> +else
> +WLROOTS_CONF_OPTS += -Dxwayland=disabled -Dxcb-errors=disabled
> -Dxcb-icccm=disabled
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WLROOTS_ROOTSTON),y)
> +WLROOTS_CONF_OPTS += -Drootston=true
> +else
> +WLROOTS_CONF_OPTS += -Drootston=false
> +endif
> +
> +$(eval $(meson-package))
> --
> 2.21.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Adrian Perez de Castro June 12, 2019, 11:31 p.m. UTC | #3
Hello François,

On Sat, 18 May 2019 17:47:09 +0200, François Perrad <francois.perrad@gadz.org> wrote:
> Le ven. 17 mai 2019 à 00:09, Adrian Perez de Castro <aperez@igalia.com> a
> écrit :
> 
> > wlroots is a modular library which provides building blocks to
> > implement Wayland compositors. wlroots is a dependency of the
> > Cage Wayland compositor.
> >
> > https://github.com/swaywm/wlroots/
> >
> > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
> > ---
> >  package/Config.in            |  1 +
> >  package/wlroots/Config.in    | 65 +++++++++++++++++++++++++++++
> >  package/wlroots/wlroots.hash |  5 +++
> >  package/wlroots/wlroots.mk   | 80 ++++++++++++++++++++++++++++++++++++
> >  4 files changed, 151 insertions(+)
> >  create mode 100644 package/wlroots/Config.in
> >  create mode 100644 package/wlroots/wlroots.hash
> >  create mode 100644 package/wlroots/wlroots.mk
> >
> > diff --git a/package/Config.in b/package/Config.in
> > index f592e74a99..5b1f279b8e 100644
> > --- a/package/Config.in
> > +++ b/package/Config.in
> > @@ -1341,6 +1341,7 @@ menu "Graphics"
> >         source "package/waylandpp/Config.in"
> >         source "package/webkitgtk/Config.in"
> >         source "package/webp/Config.in"
> > +       source "package/wlroots/Config.in"
> >         source "package/woff2/Config.in"
> >         source "package/wpebackend-fdo/Config.in"
> >         source "package/wpewebkit/Config.in"
> > diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
> > new file mode 100644
> > index 0000000000..45db63f62c
> > --- /dev/null
> > +++ b/package/wlroots/Config.in
> > @@ -0,0 +1,65 @@
> > +config BR2_PACKAGE_WLROOTS
> > +       bool "wlroots"
> > +       depends on !BR2_STATIC_LIBS # mesa3d, wayland
> > +       depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d
> > +       depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
> > +       depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d
> > +       depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d
> > +       depends on BR2_ENABLE_LOCALE # libinput
> > +       depends on BR2_PACKAGE_HAS_UDEV # libinput
> > +       depends on BR2_PACKAGE_HAS_LIBEGL
> > +       depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND
> > +       depends on BR2_PACKAGE_HAS_LIBGLES
> > +       select BR2_PACKAGE_LIBDRM
> > +       select BR2_PACKAGE_LIBINPUT
> > +       select BR2_PACKAGE_LIBXKBCOMMON
> > +       select BR2_PACKAGE_PIXMAN
> > +       select BR2_PACKAGE_WAYLAND
> > +       select BR2_PACKAGE_WAYLAND_PROTOCOLS
> > +       help
> > +         wlroots is a modular Wayland library for building compositors
> > +         which implements many of their common features.
> > +
> > +         https://github.com/swaywm/wlroots
> > +
> > +if BR2_PACKAGE_WLROOTS
> > +
> > +config BR2_PACKAGE_WLROOTS_RDP
> > +       bool "RDP backend support"
> > +       depends on BR2_PACKAGE_FREERDP
> > +       depends on BR2_USE_WCHAR # freerdp
> > +       depends on BR2_USE_MMU # libglib2
> > +       depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp
> > +       help
> > +         Support Wayland sessions served using the RDP protocol
> > +
> > +comment "RDP backend support needs FreeRDP"
> > +       depends on !BR2_PACKAGE_FREERDP
> > +
> > +config BR2_PACKAGE_WLROOTS_X11
> > +       bool "X11 backend support"
> > +       depends on BR2_PACKAGE_XORG7
> > +       select BR2_PACKAGE_LIBXCB
> > +       select BR2_PACKAGE_XLIB_LIBX11
> > +       help
> > +         Support Wayland sessions nested inside a X11 window
> > +
> > +comment "X11 backend support needs X.org enabled"
> > +       depends on !BR2_PACKAGE_XORG7
> > +
> > +config BR2_PACKAGE_WLROOTS_XWAYLAND
> > +       bool "XWayland support"
> > +       depends on BR2_PACKAGE_XORG7
> > +       select BR2_PACKAGE_LIBXCB
> > +       help
> > +         Enable support for XWayland
> > +
> > +comment "XWayland support needs X.org enabled"
> > +       depends on !BR2_PACKAGE_XORG7
> > +
> > +config BR2_PACKAGE_WLROOTS_ROOTSTON
> > +       bool "rootston"
> > +       help
> > +         Build and install the rootston example compositor
> > +
> > +endif
> > diff --git a/package/wlroots/wlroots.hash b/package/wlroots/wlroots.hash
> > new file mode 100644
> > index 0000000000..dbb387a865
> > --- /dev/null
> > +++ b/package/wlroots/wlroots.hash
> > @@ -0,0 +1,5 @@
> > +# Generated locally
> > +sha256 9cf3716f3683d800df8b150f256ff66dad65faf13a9d67c284f67a9444d28c70
> > 0.6.0.tar.gz
> > +
> > +# Hashes for license files:
> > +sha256 ffd3737a478b83a8b51b42757d3bf909ef36694508355879722e11fc1fa6736b
> > LICENSE
> > diff --git a/package/wlroots/wlroots.mk b/package/wlroots/wlroots.mk
> > new file mode 100644
> > index 0000000000..9d3581fd6f
> > --- /dev/null
> > +++ b/package/wlroots/wlroots.mk
> > @@ -0,0 +1,80 @@
> >
> > +################################################################################
> > +#
> > +# wlroots
> > +#
> >
> > +################################################################################
> > +
> > +WLROOTS_VERSION = 0.6.0
> > +WLROOTS_SITE = https://github.com/swaywm/wlroots/archive
> > +WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz
> > +WLROOTS_LICENSE = MIT
> > +WLROOTS_INSTALL_STAGING = YES
> > +
> > +WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \
> > +                                          libxkbcommon mesa3d pixman udev
> > \
> > +                                          wayland wayland-protocols
> >
> 
> wlroots has the same issue as WPEBackend-fdo:
> >>> wlroots 0.6.0 Configuring
> 
> Native dependency wayland-scanner found: YES 1.17.0
> Program /usr/bin/wayland-scanner found: NO
> 
> protocol/meson.build:5:1: ERROR: Program(s) ['/usr/bin/wayland-scanner']
> not found or not executable

Good catch, somehow I missed this when checking the build logs for my test
build before submitting.

I have proposed a patch to be applied upstream [1], which I will include
as part of the improvements in v2 of the patchset =)

> > +
> > +WLROOTS_CONF_OPTS = -Dexamples=false
> > +
> > +ifeq ($(BR2_PACKAGE_FFMPEG),y)
> > +WLROOTS_DEPENDENCIES += ffmpeg
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_LIBCAP),y)
> > +WLROOTS_CONF_OPTS += -Dlibcap=enabled
> > +WLROOTS_DEPENDENCIES += libcap
> > +else
> > +WLROOTS_CONF_OPTS += -Dlibcap=disabled
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_LIBPNG),y)
> > +WLROOTS_DEPENDENCIES += libpng
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
> > +WLROOTS_CONF_OPTS += -Dlogind=enabled -Dlogind-provider=systemd
> > +WLROOTS_DEPENDENCIES += systemd
> > +else
> > +WLROOTS_CONF_OPTS += -Dlogind=disabled
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_WLROOTS_RDP),y)
> > +WLROOTS_CONF_OPTS += -Dfreerdp=enabled
> > +WLROOTS_DEPENDENCIES += freerdp
> > +else
> > +WLROOTS_CONF_OPTS += -Dfreerdp=disabled
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
> > +WLROOTS_CONF_OPTS += -Dx11-backend=enabled
> > +WLROOTS_DEPENDENCIES += xlib_libX11
> > +else
> > +WLROOTS_CONF_OPTS += -Dx11-backend=disabled
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_WLROOTS_XWAYLAND),y)
> > +WLROOTS_CONF_OPTS += -Dxwayland=enabled
> > +WLROOTS_DEPENDENCIES += libxcb
> > +ifeq ($(BR2_PACKAGE_XCB_UTIL),y)
> > +WLROOTS_CONF_OPTS += -Dxcb-errors=enabled
> > +WLROOTS_DEPENDENCIES += xcb-util
> > +else
> > +WLROOTS_CONF_OPTS += -Dxcb-errors=disabled
> > +endif
> > +ifeq ($(BR2_PACKAGE_XCB_UTIL_WM),y)
> > +WLROOTS_CONF_OPTS += -Dxcb-icccm=enabled
> > +WLROOTS_DEPENDENCIES += xcb-util-wm
> > +else
> > +WLROOTS_CONF_OPTS += -Dxcb-icccm=disabled
> > +endif
> > +else
> > +WLROOTS_CONF_OPTS += -Dxwayland=disabled -Dxcb-errors=disabled
> > -Dxcb-icccm=disabled
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_WLROOTS_ROOTSTON),y)
> > +WLROOTS_CONF_OPTS += -Drootston=true
> > +else
> > +WLROOTS_CONF_OPTS += -Drootston=false
> > +endif
> > +
> > +$(eval $(meson-package))
> > --
> > 2.21.0

Cheers,
—Adrián

---
[1] https://github.com/swaywm/wlroots/pull/1722
Adrian Perez de Castro June 12, 2019, 11:41 p.m. UTC | #4
On Fri, 17 May 2019 09:48:23 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
> 
> On Fri, 17 May 2019 01:08:35 +0300
> Adrian Perez de Castro <aperez@igalia.com> wrote:
> 
> > diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
> > new file mode 100644
> > index 0000000000..45db63f62c
> > --- /dev/null
> > +++ b/package/wlroots/Config.in
> > @@ -0,0 +1,65 @@
> > +config BR2_PACKAGE_WLROOTS
> > +	bool "wlroots"
> > +	depends on !BR2_STATIC_LIBS # mesa3d, wayland
> 
> You're not selecting "mesa3d", so this "mesa3d" comment doesn't make
> sense.
> 
> > +	depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d
> 
> You're not selecting freerdp nor mesa3d, so the comment doesn't make
> sense either. This dependency doesn't seem to be needed at all.
> 
> > +	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
> > +	depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d
> 
> This dependency doesn't seem to be needed, at least you don't use
> mesa3d, and none of the packages you select has a "depends on
> BR2_TOOLCHAIN_HAS_SYNC".
> 
> > +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d
> 
> Same.
> 
> 
> > +if BR2_PACKAGE_WLROOTS
> > +
> > +config BR2_PACKAGE_WLROOTS_RDP
> > +	bool "RDP backend support"
> > +	depends on BR2_PACKAGE_FREERDP
> 
> If you "depends on" something...
> 
> > +	depends on BR2_USE_WCHAR # freerdp
> > +	depends on BR2_USE_MMU # libglib2
> > +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp
> 
> ... there's no point in replicating its dependencies.
> 
> > +WLROOTS_VERSION = 0.6.0
> > +WLROOTS_SITE = https://github.com/swaywm/wlroots/archive
> > +WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz
> > +WLROOTS_LICENSE = MIT
> > +WLROOTS_INSTALL_STAGING = YES
> > +
> > +WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \
> > +					   libxkbcommon mesa3d pixman udev \
> 
> Ah, so you have mesa3d in your dependencies, but you don't select it ?

I was just double checking now and... it's complicated. While in theory
Mesa is not strictly needed (any EGL driver with Wayland support should
do), then wlroots wants to *also* have libgbm which is part of Mesa...

While in theory other implementations of libgbm should work, there is none
other than Mesa's in Buildroot. Probably the best option here is to use:

    depends on BR2_PACKAGE_MESA3D_OPENGL_EGL
	depends on BR2_PACKAGE_MESA3D_OPENGL_ES

At least that's what other packages do ¯\_(ツ)_/¯

—Adrián


P.S: I'll fix the depends/selects before submitting v2 of the patchset.
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index f592e74a99..5b1f279b8e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1341,6 +1341,7 @@  menu "Graphics"
 	source "package/waylandpp/Config.in"
 	source "package/webkitgtk/Config.in"
 	source "package/webp/Config.in"
+	source "package/wlroots/Config.in"
 	source "package/woff2/Config.in"
 	source "package/wpebackend-fdo/Config.in"
 	source "package/wpewebkit/Config.in"
diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
new file mode 100644
index 0000000000..45db63f62c
--- /dev/null
+++ b/package/wlroots/Config.in
@@ -0,0 +1,65 @@ 
+config BR2_PACKAGE_WLROOTS
+	bool "wlroots"
+	depends on !BR2_STATIC_LIBS # mesa3d, wayland
+	depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
+	depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d
+	depends on BR2_ENABLE_LOCALE # libinput
+	depends on BR2_PACKAGE_HAS_UDEV # libinput
+	depends on BR2_PACKAGE_HAS_LIBEGL
+	depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	depends on BR2_PACKAGE_HAS_LIBGLES
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBINPUT
+	select BR2_PACKAGE_LIBXKBCOMMON
+	select BR2_PACKAGE_PIXMAN
+	select BR2_PACKAGE_WAYLAND
+	select BR2_PACKAGE_WAYLAND_PROTOCOLS
+	help
+	  wlroots is a modular Wayland library for building compositors
+	  which implements many of their common features.
+
+	  https://github.com/swaywm/wlroots
+
+if BR2_PACKAGE_WLROOTS
+
+config BR2_PACKAGE_WLROOTS_RDP
+	bool "RDP backend support"
+	depends on BR2_PACKAGE_FREERDP
+	depends on BR2_USE_WCHAR # freerdp
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp
+	help
+	  Support Wayland sessions served using the RDP protocol
+
+comment "RDP backend support needs FreeRDP"
+	depends on !BR2_PACKAGE_FREERDP
+
+config BR2_PACKAGE_WLROOTS_X11
+	bool "X11 backend support"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LIBXCB
+	select BR2_PACKAGE_XLIB_LIBX11
+	help
+	  Support Wayland sessions nested inside a X11 window
+
+comment "X11 backend support needs X.org enabled"
+	depends on !BR2_PACKAGE_XORG7
+
+config BR2_PACKAGE_WLROOTS_XWAYLAND
+	bool "XWayland support"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LIBXCB
+	help
+	  Enable support for XWayland
+
+comment "XWayland support needs X.org enabled"
+	depends on !BR2_PACKAGE_XORG7
+
+config BR2_PACKAGE_WLROOTS_ROOTSTON
+	bool "rootston"
+	help
+	  Build and install the rootston example compositor
+
+endif
diff --git a/package/wlroots/wlroots.hash b/package/wlroots/wlroots.hash
new file mode 100644
index 0000000000..dbb387a865
--- /dev/null
+++ b/package/wlroots/wlroots.hash
@@ -0,0 +1,5 @@ 
+# Generated locally
+sha256 9cf3716f3683d800df8b150f256ff66dad65faf13a9d67c284f67a9444d28c70  0.6.0.tar.gz
+
+# Hashes for license files:
+sha256 ffd3737a478b83a8b51b42757d3bf909ef36694508355879722e11fc1fa6736b  LICENSE
diff --git a/package/wlroots/wlroots.mk b/package/wlroots/wlroots.mk
new file mode 100644
index 0000000000..9d3581fd6f
--- /dev/null
+++ b/package/wlroots/wlroots.mk
@@ -0,0 +1,80 @@ 
+################################################################################
+#
+# wlroots
+#
+################################################################################
+
+WLROOTS_VERSION = 0.6.0
+WLROOTS_SITE = https://github.com/swaywm/wlroots/archive
+WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz
+WLROOTS_LICENSE = MIT
+WLROOTS_INSTALL_STAGING = YES
+
+WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \
+					   libxkbcommon mesa3d pixman udev \
+					   wayland wayland-protocols
+
+WLROOTS_CONF_OPTS = -Dexamples=false
+
+ifeq ($(BR2_PACKAGE_FFMPEG),y)
+WLROOTS_DEPENDENCIES += ffmpeg
+endif
+
+ifeq ($(BR2_PACKAGE_LIBCAP),y)
+WLROOTS_CONF_OPTS += -Dlibcap=enabled
+WLROOTS_DEPENDENCIES += libcap
+else
+WLROOTS_CONF_OPTS += -Dlibcap=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_LIBPNG),y)
+WLROOTS_DEPENDENCIES += libpng
+endif
+
+ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
+WLROOTS_CONF_OPTS += -Dlogind=enabled -Dlogind-provider=systemd
+WLROOTS_DEPENDENCIES += systemd
+else
+WLROOTS_CONF_OPTS += -Dlogind=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_WLROOTS_RDP),y)
+WLROOTS_CONF_OPTS += -Dfreerdp=enabled
+WLROOTS_DEPENDENCIES += freerdp
+else
+WLROOTS_CONF_OPTS += -Dfreerdp=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
+WLROOTS_CONF_OPTS += -Dx11-backend=enabled
+WLROOTS_DEPENDENCIES += xlib_libX11
+else
+WLROOTS_CONF_OPTS += -Dx11-backend=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_WLROOTS_XWAYLAND),y)
+WLROOTS_CONF_OPTS += -Dxwayland=enabled
+WLROOTS_DEPENDENCIES += libxcb
+ifeq ($(BR2_PACKAGE_XCB_UTIL),y)
+WLROOTS_CONF_OPTS += -Dxcb-errors=enabled
+WLROOTS_DEPENDENCIES += xcb-util
+else
+WLROOTS_CONF_OPTS += -Dxcb-errors=disabled
+endif
+ifeq ($(BR2_PACKAGE_XCB_UTIL_WM),y)
+WLROOTS_CONF_OPTS += -Dxcb-icccm=enabled
+WLROOTS_DEPENDENCIES += xcb-util-wm
+else
+WLROOTS_CONF_OPTS += -Dxcb-icccm=disabled
+endif
+else
+WLROOTS_CONF_OPTS += -Dxwayland=disabled -Dxcb-errors=disabled -Dxcb-icccm=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_WLROOTS_ROOTSTON),y)
+WLROOTS_CONF_OPTS += -Drootston=true
+else
+WLROOTS_CONF_OPTS += -Drootston=false
+endif
+
+$(eval $(meson-package))