diff --git a/DEVELOPERS b/DEVELOPERS
index df2b98ad53..b240b7c92a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2515,6 +2515,7 @@ F:	support/testing/tests/package/test_python_s3transfer.py
 N:	Raphael Pavlidis <raphael.pavlidis@gmail.com>
 F:	package/slirp4netns/
 F:	package/sway/
+F:	package/x11r7/xwayland/
 
 N:	Refik Tuzakli <tuzakli.refik@gmail.com>
 F:	package/freescale-imx/
diff --git a/package/weston/Config.in b/package/weston/Config.in
index 3b4e932b7d..db12afc43a 100644
--- a/package/weston/Config.in
+++ b/package/weston/Config.in
@@ -111,14 +111,22 @@ config BR2_PACKAGE_WESTON_XWAYLAND
 	bool "XWayland support"
 	depends on BR2_PACKAGE_XORG7
 	depends on BR2_PACKAGE_LIBEPOXY
+	depends on BR2_USE_MMU # xwayland
+	depends on !BR2_STATIC_LIBS # xwayland
+	depends on BR2_TOOLCHAIN_HAS_THREADS # xwayland
 	select BR2_PACKAGE_CAIRO
 	select BR2_PACKAGE_LIBXCB
 	select BR2_PACKAGE_XLIB_LIBX11
 	select BR2_PACKAGE_XLIB_LIBXCURSOR
+	select BR2_PACKAGE_XWAYLAND
 
 comment "XWayland support needs libepoxy and X.org enabled"
 	depends on !BR2_PACKAGE_XORG7 || !BR2_PACKAGE_LIBEPOXY
 
+comment "XWayland support needs a toolchain w/ threads, dynamic library"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
+
 # Weston needs at least one shell; this can be one of the bundled ones,
 # below, of from a third-party package, which should then select this.
 config BR2_PACKAGE_WESTON_HAS_SHELL
diff --git a/package/weston/weston.mk b/package/weston/weston.mk
index 5e71473640..01f84178b2 100644
--- a/package/weston/weston.mk
+++ b/package/weston/weston.mk
@@ -123,7 +123,7 @@ WESTON_CONF_OPTS += -Dbackend-default=$(call qstrip,$(BR2_PACKAGE_WESTON_DEFAULT
 
 ifeq ($(BR2_PACKAGE_WESTON_XWAYLAND),y)
 WESTON_CONF_OPTS += -Dxwayland=true
-WESTON_DEPENDENCIES += cairo libepoxy libxcb xlib_libX11 xlib_libXcursor
+WESTON_DEPENDENCIES += cairo libepoxy libxcb xlib_libX11 xlib_libXcursor xwayland
 else
 WESTON_CONF_OPTS += -Dxwayland=false
 endif
diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in
index 84a4ef846e..26992ca326 100644
--- a/package/wlroots/Config.in
+++ b/package/wlroots/Config.in
@@ -41,4 +41,16 @@ config BR2_PACKAGE_WLROOTS_X11
 	help
 	  Support Wayland sessions nested inside a X11 window
 
+config BR2_PACKAGE_WLROOTS_XWAYLAND
+	bool "XWayland support"
+	depends on BR2_PACKAGE_XORG7 # libxcb, xcb-util-wm, xwayland
+	select BR2_PACKAGE_LIBXCB
+	select BR2_PACKAGE_XCB_UTIL_WM
+	select BR2_PACKAGE_XWAYLAND
+	help
+	  Support for X11 applications
+
+comment "XWayland support needs X.org enabled"
+	depends on !BR2_PACKAGE_XORG7
+
 endif
diff --git a/package/wlroots/wlroots.mk b/package/wlroots/wlroots.mk
index 4f14d20b11..5b930a51be 100644
--- a/package/wlroots/wlroots.mk
+++ b/package/wlroots/wlroots.mk
@@ -30,8 +30,12 @@ WLROOTS_BACKENDS = libinput drm
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 WLROOTS_BACKENDS += x11
-WLROOTS_CONF_OPTS += -Dxwayland=enabled
 WLROOTS_DEPENDENCIES += libxcb xcb-util-wm xcb-util-renderutil xlib_libX11
+endif
+
+ifeq ($(BR2_PACKAGE_WLROOTS_XWAYLAND),y)
+WLROOTS_CONF_OPTS += -Dxwayland=enabled
+WLROOTS_DEPENDENCIES += libxcb xcb-util-wm xwayland
 else
 WLROOTS_CONF_OPTS += -Dxwayland=disabled
 endif
diff --git a/package/x11r7/Config.in b/package/x11r7/Config.in
index 365de34c98..4de8922e0d 100644
--- a/package/x11r7/Config.in
+++ b/package/x11r7/Config.in
@@ -12,6 +12,7 @@ menuconfig BR2_PACKAGE_XORG7
 if BR2_PACKAGE_XORG7
 	menu "X11R7 Servers"
 		source package/x11r7/xserver_xorg-server/Config.in
+		source package/x11r7/xwayland/Config.in
 	endmenu
 	menu "X11R7 Libraries"
 		source package/x11r7/libxcb/Config.in
diff --git a/package/x11r7/xwayland/Config.in b/package/x11r7/xwayland/Config.in
new file mode 100644
index 0000000000..4f14f2cc36
--- /dev/null
+++ b/package/x11r7/xwayland/Config.in
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_XWAYLAND
+	bool "xwayland server"
+	depends on BR2_USE_MMU # fork()
+	depends on !BR2_STATIC_LIBS # wayland
+	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
+	# We need a SHA1 implementation. If either openssl or
+	# libgcrypt are already part of the build, we'll use one of
+	# them, otherwise, use the small libsha1 library.
+	select BR2_PACKAGE_LIBSHA1 if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT)
+	select BR2_PACKAGE_PIXMAN
+	select BR2_PACKAGE_WAYLAND
+	select BR2_PACKAGE_WAYLAND_PROTOCOLS
+	select BR2_PACKAGE_XLIB_LIBXCVT
+	select BR2_PACKAGE_XLIB_LIBXFONT2
+	select BR2_PACKAGE_XLIB_LIBXKBFILE
+	select BR2_PACKAGE_XLIB_LIBXRANDR
+	select BR2_PACKAGE_XLIB_XTRANS
+	select BR2_PACKAGE_XORGPROTO
+	help
+	  X.Org X server to run X clients under wayland
+
+	  http://xorg.freedesktop.org
+
+comment "xwayland needs a toolchain w/ threads, dynamic library"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
diff --git a/package/x11r7/xwayland/xwayland.hash b/package/x11r7/xwayland/xwayland.hash
new file mode 100644
index 0000000000..0c476f3183
--- /dev/null
+++ b/package/x11r7/xwayland/xwayland.hash
@@ -0,0 +1,6 @@
+# From https://lists.x.org/archives/xorg-announce/2023-February/003322.html
+sha256  d11eeee73290b88ea8da42a7d9350dedfaba856ce4ae44e58c045ad9ecaa2f73  xwayland-22.1.8.tar.xz
+sha512  f52c6f99d8ef7605bc1c651d5ee5e306c12af30649a2d712b1c4c3cf4c7c80246ae24bd9ac39461d47aafc78f5d659446a459cd6259e05ef3128b204981d114a  xwayland-22.1.8.tar.xz
+
+# Locally calculated
+sha256  4cc0447a22635c7b2f1a93fec4aa94f1970fadeb72a063de006b51cf4963a06f  COPYING
diff --git a/package/x11r7/xwayland/xwayland.mk b/package/x11r7/xwayland/xwayland.mk
new file mode 100644
index 0000000000..174b440b07
--- /dev/null
+++ b/package/x11r7/xwayland/xwayland.mk
@@ -0,0 +1,94 @@
+################################################################################
+#
+# xwayland
+#
+################################################################################
+
+XWAYLAND_VERSION = 22.1.8
+XWAYLAND_SOURCE = xwayland-$(XWAYLAND_VERSION).tar.xz
+XWAYLAND_SITE = https://xorg.freedesktop.org/archive/individual/xserver
+XWAYLAND_LICENSE = MIT
+XWAYLAND_LICENSE_FILES = COPYING
+XWAYLAND_INSTALL_STAGING = YES
+XWAYLAND_DEPENDENCIES = \
+	pixman \
+	wayland \
+	wayland-protocols \
+	xlib_libxcvt \
+	xlib_libXfont2 \
+	xlib_libxkbfile \
+	xlib_libXrandr \
+	xlib_xtrans \
+	xorgproto
+XWAYLAND_CONF_OPTS = \
+	-Dxwayland_eglstream=false \
+	-Dxvfb=false \
+	-Ddefault_font_path=/usr/share/fonts/X11/ \
+	-Ddtrace=false \
+	-Ddocs=false
+
+ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_LIBEPOXY),yy)
+XWAYLAND_CONF_OPTS += -Dglamor=true
+XWAYLAND_DEPENDENCIES += libdrm libepoxy
+else
+XWAYLAND_CONF_OPTS += -Dglamor=false
+endif
+
+ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
+XWAYLAND_CONF_OPTS += -Dglx=true
+XWAYLAND_DEPENDENCIES += libgl
+else
+XWAYLAND_CONF_OPTS += -Dglx=false
+endif
+
+ifeq ($(BR2_PACKAGE_XLIB_LIBXDMCP),y)
+XWAYLAND_CONF_OPTS += \
+	-Dxdmcp=true \
+	-Dxdm-auth-1=true
+XWAYLAND_DEPENDENCIES += xlib_libXdmcp
+else
+XWAYLAND_CONF_OPTS += \
+	-Dxdmcp=false \
+	-Dxdm-auth-1=false
+endif
+
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+XWAYLAND_CONF_OPTS += -Dsecure-rpc=true
+XWAYLAND_DEPENDENCIES += libtirpc
+else
+XWAYLAND_CONF_OPTS += -Dsecure-rpc=false
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSELINUX)$(BR2_PACKAGE_AUDIT),yy)
+XWAYLAND_CONF_OPTS += -Dxselinux=true
+XWAYLAND_DEPENDENCIES += libselinux audit
+else
+XWAYLAND_CONF_OPTS += -Dxselinux=false
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+XWAYLAND_CONF_OPTS += -Dsha1=libcrypto
+XWAYLAND_DEPENDENCIES += openssl
+else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
+XWAYLAND_CONF_OPTS += -Dsha1=libgcrypt
+XWAYLAND_DEPENDENCIES += libgcrypt
+else
+XWAYLAND_CONF_OPTS += -Dsha1=libsha1
+XWAYLAND_DEPENDENCIES += libsha1
+endif
+
+ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE)$(BR2_PACKAGE_LIBDRM),yy)
+XWAYLAND_CONF_OPTS += -Ddri3=true
+XWAYLAND_DEPENDENCIES += xlib_libxshmfence libdrm
+else
+XWAYLAND_CONF_OPTS += -Ddri3=false
+endif
+
+ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
+XWAYLAND_CONF_OPTS += -Dlibunwind=true
+XWAYLAND_DEPENDENCIES += libunwind
+else
+XWAYLAND_CONF_OPTS += -Dlibunwind=false
+endif
+
+$(eval $(meson-package))
