From bbbc6c9d9e7f19df04f23c26445132863a0e4070 Mon Sep 17 00:00:00 2001 From: Raphael Pavlidis Date: Sat, 13 Dec 2025 17:52:00 +0000 Subject: [PATCH] package/x11r7/xwayland: add nettle and libmd as SHA1 providers Xwayland can use either nettle or libmd for SHA1 support. When one of these libraries is selected, use it as the SHA1 provider. Also reorder the preferred SHA1 libraries to match the order used by meson [1]. [1]: https://gitlab.freedesktop.org/xorg/xserver/-/blob/xwayland-24.1.9/meson.build?ref_type=tags#L235-239 Signed-off-by: Raphael Pavlidis [Julien: fix package path in commit title] Signed-off-by: Julien Olivain --- package/x11r7/xwayland/Config.in | 8 ++++---- package/x11r7/xwayland/xwayland.mk | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/package/x11r7/xwayland/Config.in b/package/x11r7/xwayland/Config.in index 311dae25ec..3df8677545 100644 --- a/package/x11r7/xwayland/Config.in +++ b/package/x11r7/xwayland/Config.in @@ -3,12 +3,12 @@ config BR2_PACKAGE_XWAYLAND 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. depends on BR2_TOOLCHAIN_HAS_SYNC_4 # xlib_libxshmfence select BR2_PACKAGE_LIBDRM - select BR2_PACKAGE_LIBSHA1 if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT) + # We need a SHA1 implementation. If either openssl, libgcrypt, nettle or + # libsha1 are already part of the build, we'll use one of them, + # otherwise, use the small libmd library. + select BR2_PACKAGE_LIBMD if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT && !BR2_PACKAGE_NETTLE && !BR2_PACKAGE_LIBSHA1) select BR2_PACKAGE_PIXMAN select BR2_PACKAGE_WAYLAND select BR2_PACKAGE_WAYLAND_PROTOCOLS diff --git a/package/x11r7/xwayland/xwayland.mk b/package/x11r7/xwayland/xwayland.mk index 59d607fb5b..98bc74200a 100644 --- a/package/x11r7/xwayland/xwayland.mk +++ b/package/x11r7/xwayland/xwayland.mk @@ -69,15 +69,22 @@ else XWAYLAND_CONF_OPTS += -Dxselinux=false endif -ifeq ($(BR2_PACKAGE_OPENSSL),y) -XWAYLAND_CONF_OPTS += -Dsha1=libcrypto -XWAYLAND_DEPENDENCIES += openssl +# The order of the preferred SHA1 libraries should match used by meson.build. +ifeq ($(BR2_PACKAGE_LIBMD),y) +XWAYLAND_CONF_OPTS += -Dsha1=libmd +XWAYLAND_DEPENDENCIES += libmd +else ifeq ($(BR2_PACKAGE_LIBSHA1),y) +XWAYLAND_CONF_OPTS += -Dsha1=libsha1 +XWAYLAND_DEPENDENCIES += libsha1 +else ifeq ($(BR2_PACKAGE_NETTLE),y) +XWAYLAND_CONF_OPTS += -Dsha1=libnettle +XWAYLAND_DEPENDENCIES += nettle else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) XWAYLAND_CONF_OPTS += -Dsha1=libgcrypt XWAYLAND_DEPENDENCIES += libgcrypt else -XWAYLAND_CONF_OPTS += -Dsha1=libsha1 -XWAYLAND_DEPENDENCIES += libsha1 +XWAYLAND_CONF_OPTS += -Dsha1=libcrypto +XWAYLAND_DEPENDENCIES += openssl endif ifeq ($(BR2_PACKAGE_LIBUNWIND),y)