Add cage and wlroots packages
v3 cover Add cage and wlroots packages
This is a patch series which adds the Cage Wayland compositor, and the wlroots library which is a dependency.
I find Cage well suited for kiosks and in general "single-application, fullscreen" use cases. I find it particularly suitable to use in combination with Cog (the WPE WebKit launcher), for many cases in which a full-fledged compositor like Weston is not really needed. A typical example is generating a small image to run a single Web application from a Raspberry Pi right after bootup.
Cheers,
?Adri?n
Adrian Perez de Castro (2):
package/wlroots: new package
package/cage: new package
DEVELOPERS | 2 + package/Config.in | 2 + package/cage/Config.in | 17 +++++ package/cage/cage.hash | 5 ++ package/cage/cage.mk | 18 +++++ ...onfig-to-find-wayland-scanner-when-c.patch | 45 ++++++++++++ package/wlroots/Config.in | 52 +++++++++++++ package/wlroots/wlroots.hash | 5 ++ package/wlroots/wlroots.mk | 73 +++++++++++++++++++ 9 files changed, 219 insertions(+) create mode 100644 package/cage/Config.in create mode 100644 package/cage/cage.hash create mode 100644 package/cage/cage.mk create mode 100644 package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch create mode 100644 package/wlroots/Config.in create mode 100644 package/wlroots/wlroots.hash create mode 100644 package/wlroots/wlroots.mk
Signature · 1 line
2.24.0
PATCH v3 1/2 package/wlroots: new package
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/
---
Changes v2 -> v3:
- Update package to use wlroots 0.8.1
- Remove the option to build the rootston compositor, which is no longer part of the source distribution.
- Rearrange items in Config.in to ensure sub-options are properly indented.
- Add comment in Config.in indicating that only Mesa provides a suitable libgbm.
- Remove "support" string in descriptions of sub-options in Config.in
- Enable XWayland support automatically if BR2_PACKAGE_XORG7 is enabled, and remove the sub-option from Config.in.
- Add note about the PGP signature being checked before generating the package hashes locally.
- Fix indentation in wlroots.mk
--- DEVELOPERS | 1 + package/Config.in | 1 + ...onfig-to-find-wayland-scanner-when-c.patch | 45 ++++++++++++ package/wlroots/Config.in | 52 +++++++++++++ package/wlroots/wlroots.hash | 5 ++ package/wlroots/wlroots.mk | 73 +++++++++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch create mode 100644 package/wlroots/Config.in create mode 100644 package/wlroots/wlroots.hash create mode 100644 package/wlroots/wlroots.mk
DEVELOPERS +1 -0
@@ -84,6 +84,7 @@ F: package/cog/ F: package/libepoxy/ F: package/libwpe/ F: package/webkitgtk/ +F: package/wlroots/ F: package/woff2/ F: package/wpebackend-fdo/ F: package/wpewebkit/
package/Config.in +1 -0
@@ -1388,6 +1388,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"
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch new file +45 -0
45 lines not on this page · raw message
package/wlroots/Config.in new file +52 -0
52 lines not on this page · raw message
package/wlroots/wlroots.hash new file +5 -0
@@ -0,0 +1,5 @@ +# Generated locally, after checking https://github.com/swaywm/wlroots/releases/download/0.8.1/wlroots-0.8.1.tar.gz.sig +sha256 202b86e0e21699b6660bbda56afc2e3358db7252f83ff69c89f01926b4900d98 wlroots-0.8.1.tar.gz + +# Hashes for license files: +sha256 ffd3737a478b83a8b51b42757d3bf909ef36694508355879722e11fc1fa6736b LICENSE
package/wlroots/wlroots.mk new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.24.0
PATCH v3 1/2 package/wlroots: new package
Hello Adrian,
Quoted 7 lines · On Sun, 10 Nov 2019 22:06:37 +0200 Adrian Perez de Castro <[email protected]>…
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 <[email protected]>
I have (finally) applied this patch, after doing a number of changes. See below for some comments, and questions.
Quoted 16 lines
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch new file +10
-0@@ -0,0 +1,45 @@ +From 72138a67c8e6b0154aadc1b5fcb3d661033fbcd3 Mon Sep 17 00:00:00 2001 +From: Adrian Perez de Castro <[email protected]> +Date: Thu, 13 Jun 2019 02:13:47 +0300 +Subject: [PATCH] Do not use pkg-config to find wayland-scanner when cross + building + +When cross-compiling it is still needed to run a native wayland-scanner, +but many tools for the task will still have pkg-config return the +location of wayland-scanner for the target in some location which may +be the same as for some native installation of wayland-scanner; but
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch line 20
Quoted 10 lines
package/wlroots/0001-Do-not-use-pkg-config-to-find-wayland-scanner-when-c.patch new file +10
-0+which is not the copy of the program that the compilation system wants +packages to use (which are typically in a "host tools" directory +elsewhere). + +This disables usage of pkg-config to find wayland-scanner when +cross-compiling because most tools for the job will set $PATH in a way +that the correct installation of the tool will be found first. + +Signed-off-by: Adrian Perez de Castro <[email protected]> +[Upstream status: https://github.com/swaywm/wlroots/pull/1722]
This patch was rejected upstream. As part of that, they pointed to another Buildroot-related discussion at
https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/157#note_154262.
And it turns out that Buildroot's support for meson was indeed improved since then when it comes to pkg-config handling. We are now compatible with Meson either using pkg-config to find libraries/tools for the target *or* for the host. See Arnout's commit 4e0bc29993376613d200e892d491e31ea5a49622.
So there is a chance that with this in place, wlroots now asks wayland-scanner with the host pkg-config, and not the for-cross-compilation pkg-config.
Could you have a look at this ?
package/wlroots/Config.in line 5
Quoted 11 lines
package/wlroots/Config.in new file +5
-0@@ -0,0 +1,52 @@ +comment "wlroots needs udev, mesa3d w/ EGL and GLES support, toolchain w/ threads, locale, shared libraries" + depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL || \ + !BR2_PACKAGE_MESA3D_OPENGL_ES || !BR2_PACKAGE_HAS_UDEV || \ + !BR2_ENABLE_LOCALE || !BR2_TOOLCHAIN_HAS_THREADS || \ + BR2_STATIC_LIBS
This was a bit too much, so I've split into two comments: one for the toolchain dependencies, one for the other dependencies.
package/wlroots/Config.in line 15
Quoted 10 lines
package/wlroots/Config.in new file +10
-0+ +config BR2_PACKAGE_WLROOTS + bool "wlroots" + depends on !BR2_STATIC_LIBS # wayland + depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland + depends on BR2_ENABLE_LOCALE # libinput + depends on BR2_PACKAGE_HAS_UDEV # libinput + # Technically wlroots should work with any OpenGL implementation + # which provides EGL, GLES2, and libgbm; but in practice only + # Mesa ships an usable libgbm.
In fact, some other OpenGL implementations might provide a suitable libgbm. I did some initial work on a libgbm virtual package, which got stopped due to incompatibilities between libgbm implementations. But after some research and discussion, I have some ideas on how to handle this.
package/wlroots/Config.in line 20
Quoted 5 lines
package/wlroots/Config.in new file +5
-0+ depends on BR2_PACKAGE_MESA3D_OPENGL_EGL + depends on BR2_PACKAGE_MESA3D_OPENGL_ES + select BR2_PACKAGE_LIBDRM + select BR2_PACKAGE_LIBINPUT + select BR2_PACKAGE_LIBXCB if BR2_PACKAGE_XORG7 # For XWayland.
This was a bit brutal as if you want the X11 backend but don't care about XWayland, you would still have libxcb, so I've dropped this line, and changed something in the .mk file accordingly.
Quoted 10 lines
package/wlroots/Config.in new file +10
-0+ 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 +
package/wlroots/Config.in line 40
Quoted 10 lines
package/wlroots/Config.in new file +10
-0+if BR2_PACKAGE_WLROOTS + +config BR2_PACKAGE_WLROOTS_RDP + bool "RDP backend" + depends on BR2_PACKAGE_FREERDP + help + Support Wayland sessions served using the RDP protocol + +comment "RDP backend needs freerdp" + depends on !BR2_PACKAGE_FREERDP
I dropped this comment: if you need the RDP backend, it's pretty obvious you need FreeRDP.
package/wlroots/Config.in line 50
Quoted 9 lines
package/wlroots/Config.in new file +9
-0+config BR2_PACKAGE_WLROOTS_X11 + bool "X11 backend" + depends on BR2_PACKAGE_XORG7 + select BR2_PACKAGE_XLIB_LIBX11 + help + Support Wayland sessions nested inside a X11 window + +comment "X11 backend needs X.org enabled" + depends on !BR2_PACKAGE_XORG7
Ditto.
package/wlroots/Config.in line 52
Quoted 3 lines
package/wlroots/Config.in new file +3
-0+WLROOTS_VERSION = 0.8.1 +WLROOTS_SITE = https://github.com/swaywm/wlroots/releases/download/$(WLROOTS_VERSION) +WLROOTS_SOURCE = wlroots-$(WLROOTS_VERSION).tar.gz
This is the default value -> triggers a check-package warning.
Quoted 35 lines
package/wlroots/Config.in new file +35
-0+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
package/wlroots/Config.in
Quoted 10 lines
package/wlroots/Config.in new file +10
-0+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_XORG7),y)
Changed to a test on BR2_PACKAGE_LIBXCB.
Quoted 7 lines
package/wlroots/Config.in new file +7
-0+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
package/wlroots/Config.in
Quoted 10 lines
package/wlroots/Config.in new file +10
-0+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
Also, since BR2_PACKAGE_XCB_UTIL and BR2_PACKAGE_XCB_UTIL_WM can't be enabled without BR2_PACKAGE_LIBXCB, I've simplified this whole block to:
+ifeq ($(BR2_PACKAGE_LIBXCB),y)
+WLROOTS_CONF_OPTS += -Dxwayland=enabled
+WLROOTS_DEPENDENCIES += libxcb
+else
+WLROOTS_CONF_OPTS += -Dxwayland=disabled
+endif
+
+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
Applied with those changes!
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 2/2 package/cage: new package
In reply to Adrian Perez de CastroCage is a "kiosk" Wayland compositor, which shows a single maximized application at a time and limits user interaction to that application.
https://www.hjdskes.nl/projects/cage/
---
Changes v2 -> v3:
- Fix dependencies in Config.in
- Enable XWayland support automatically if BR2_PACKAGE_XORG7 is enabled, and remove the sub-option from Config.in.
- Add note about the PGP signature being checked before generating the package hashes locally.
- Use GitHub helper for CAGE_SITE.
--- DEVELOPERS | 1 + package/Config.in | 1 + package/cage/Config.in | 17 +++++++++++++++++ package/cage/cage.hash | 5 +++++ package/cage/cage.mk | 18 ++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 package/cage/Config.in create mode 100644 package/cage/cage.hash create mode 100644 package/cage/cage.mk
DEVELOPERS +1 -0
@@ -80,6 +80,7 @@ F: package/jack1/ N: Adrian Perez de Castro <[email protected]> F: package/brotli/ +F: package/cage/ F: package/cog/ F: package/libepoxy/ F: package/libwpe/
package/Config.in +1 -0
@@ -337,6 +337,7 @@ comment "QT libraries and helper libraries" source "package/quazip/Config.in" source "package/qwt/Config.in" endif + source "package/cage/Config.in" source "package/tekui/Config.in" source "package/weston/Config.in" source "package/x11r7/Config.in"
package/cage/Config.in new file +17 -0
@@ -0,0 +1,17 @@ +config BR2_PACKAGE_CAGE + bool "cage" + depends on !BR2_STATIC_LIBS # wlroots -> wayland + depends on BR2_INSTALL_LIBSTDCPP # wlroots -> wayland + depends on BR2_TOOLCHAIN_HAS_THREADS # wlroots -> wayland + depends on BR2_TOOLCHAIN_HAS_SYNC_1 # wlroots + depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # wlroots + depends on BR2_ENABLE_LOCALE # wlroots -> libinput + depends on BR2_PACKAGE_HAS_UDEV # wlroots -> libinput + depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # wlroots + depends on BR2_PACKAGE_MESA3D_OPENGL_ES # wlroots + select BR2_PACKAGE_WLROOTS + help + Kiosk compositor for Wayland, which displays a single + maximized application at a time. + + https://www.hjdskes.nl/projects/cage/
package/cage/cage.hash new file +5 -0
@@ -0,0 +1,5 @@ +# Generated locally, after checking https://github.com/Hjdskes/cage/releases/download/v0.1.1/cage-0.1.1.tar.gz.sig +sha256 63efbe96cf307381f2bedf9b80153343e255970a70d612515da7dc325dd49478 cage-0.1.1.tar.gz + +# Hashes for license files: +sha256 1fd28695090b961ed2846627365489228d84f784bff60a90e933febcedaeb65d LICENSE
package/cage/cage.mk new file +18 -0
@@ -0,0 +1,18 @@ +################################################################################ +# +# cage +# +################################################################################ + +CAGE_VERSION = 0.1.1 +CAGE_SITE = $(call github,Hjdskes,cage,v$(CAGE_VERSION)) +CAGE_LICENSE = MIT +CAGE_DEPENDENCIES = host-pkgconf wlroots + +ifeq ($(BR2_PACKAGE_XORG7),y) +CAGE_CONF_OPTS = -Dxwayland=true +else +CAGE_CONF_OPTS = -Dxwayland=false +endif + +$(eval $(meson-package))
Signature · 1 line
2.24.0
PATCH v3 2/2 package/cage: new package
Hello,
I have applied, with some changes. See below.
package/Config.in comment "QT libraries and helper libraries" · line 340
Quoted 9 lines · On Sun, 10 Nov 2019 22:06:38 +0200 Adrian Perez de Castro <[email protected]>…
package/Config.in +1
-0@@ -337,6 +337,7 @@ comment "QT libraries and helper libraries" source "package/quazip/Config.in" source "package/qwt/Config.in" endif + source "package/cage/Config.in"
This was not sorted alphabetically, as reported by check-package. Also, cage is not really a "Graphics library", I moved it to "Graphics applications" instead.
package/cage/Config.in line 4
Quoted 10 lines
package/cage/Config.in new file +4
-0@@ -0,0 +1,17 @@ +config BR2_PACKAGE_CAGE + bool "cage" + depends on !BR2_STATIC_LIBS # wlroots -> wayland + depends on BR2_INSTALL_LIBSTDCPP # wlroots -> wayland
wlroots doesn't carry a C++ dependency, so I dropped this.
package/cage/Config.in line 6
Quoted 2 lines
package/cage/Config.in new file +2
-0+ depends on BR2_TOOLCHAIN_HAS_THREADS # wlroots -> wayland + depends on BR2_TOOLCHAIN_HAS_SYNC_1 # wlroots
wlroots doesn't carry this dependency, so I dropped it.
package/cage/Config.in line 7
Quoted 1 line
package/cage/Config.in new file +1
-0+ depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # wlroots
wlroots doesn't carry this dependency, so I dropped it.
package/cage/Config.in line 11
Quoted 4 lines
package/cage/Config.in new file +4
-0+ depends on BR2_ENABLE_LOCALE # wlroots -> libinput + depends on BR2_PACKAGE_HAS_UDEV # wlroots -> libinput + depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # wlroots + depends on BR2_PACKAGE_MESA3D_OPENGL_ES # wlroots
Also, the Config.in comments about the dependencies were missing, so I've added them.
Applied with those changes. Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com